[Devel] [PATCH hci-8.2 v2 1/8] ms/inet: reject unhashed sockets during established lookups
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Nov 25 13:35:25 MSK 2026
I won't apply this version, please send v3 with the changes below.
- Add 97c8a3c1f73d8 before this patch: item 1 of the cover letter
reply.
On Wed, 25 Nov 2026 08:14:11 +0200, Eva Kurchatova wrote:
> if (nreq) {
> __NET_INC_STATS(net, LINUX_MIB_TCPMIGRATEREQFAILURE);
> + /* The timer was not armed, drop its reference here. */
> + reqsk_put(nreq);
> no_ownership:
> reqsk_migrate_reset(nreq);
> reqsk_queue_removed(queue, nreq);
> - __reqsk_free(nreq);
> + /* Drop the temporary reference and the one reserved for ehash. */
> + reqsk_put(nreq);
> + reqsk_put(nreq);
Upstream this patch sits on top of 97c8a3c1f73d8. Without it the goto
no_ownership path still leaves the timer of nreq armed. Before this
patch that is a use-after-free; with it, the two puts leave the last
reference to the timer, and the orphaned request keeps sending SYN-ACKs
for a connection that is already established, until the retries run
out.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list