From: Simon Horman <horms@kernel.org>
To: Michael Bommarito <michael.bommarito@gmail.com>
Cc: Taehee Yoo <ap420073@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v5 0/2] amt: fix use-after-free of the skb head across pulls
Date: Mon, 20 Jul 2026 12:06:20 +0100 [thread overview]
Message-ID: <20260720110620.GF19108@horms.kernel.org> (raw)
In-Reply-To: <20260711151934.2955226-1-michael.bommarito@gmail.com>
On Sat, Jul 11, 2026 at 11:19:32AM -0400, Michael Bommarito wrote:
> Several AMT receive and transmit paths cache a pointer into the skb head
> and then call a helper that can reallocate that head before the cached
> pointer is used again, so the later access reads or writes freed memory.
>
> Patch 1 walks every AMT path and, for each pointer used after a
> reallocating call, either snapshots the value before the first pull or
> re-derives the pointer after the last one.
>
> Patch 2 is a smaller, separable hardening change: the three handlers
> that rewrite the ethernet header do so in place without making the head
> private, which corrupts a cloned skb (for example one held by a packet
> tap). It adds skb_cow_head() before the rewrite, split out so the
> use-after-free fix is not held up by discussion of the clone case.
>
> Both patches build cleanly (x86_64, CONFIG_AMT, W=1) and are
> checkpatch --strict clean.
>
> Changes since v4:
> - amt_update_handler(): also snapshot amtmu->nonce and
> amtmu->response_mac before iptunnel_pull_header(), which can
> reallocate the head for a GSO cloned skb; the tunnel-match loop read
> both fields through the stale amtmu. This is the same class as the
> query handler's response_mac snapshot and was the one remaining site
> the v4 fix missed.
> - Remove the explanatory comments added in v4; the reason for each
> snapshot/re-derive is described in the commit message instead.
> - Order the local variable declarations longest-to-shortest in the
> handlers that gained locals (amt_membership_query_handler and
> amt_update_handler).
>
> v4: https://lore.kernel.org/all/20260707193243.3448201-1-michael.bommarito@gmail.com/
> v3: https://lore.kernel.org/all/20260626111917.802243-1-michael.bommarito@gmail.com/
> v2: https://lore.kernel.org/all/20260617123443.3586930-1-michael.bommarito@gmail.com/
For the series:
Reviewed-by: Simon Horman <horms@kernel.org>
FTR, I believe the issues flagged in the AI-generated review of this patch
should not block it's progress. Rather, you may wish to consider then in
the context of possible follow-up.
prev parent reply other threads:[~2026-07-20 11:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-11 15:19 [PATCH net v5 0/2] amt: fix use-after-free of the skb head across pulls Michael Bommarito
2026-07-11 15:19 ` [PATCH net v5 1/2] amt: re-read skb header pointers after every pull Michael Bommarito
2026-07-11 15:19 ` [PATCH net v5 2/2] amt: make the head writable before rewriting the L2 header Michael Bommarito
2026-07-20 11:06 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260720110620.GF19108@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.bommarito@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.