From: "Rémi Denis-Courmont" <remi@remlab.net>
To: Remi Denis-Courmont <courmisch@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Elkin Cruz <elkin@google.com>
Cc: Simon Horman <horms@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
netdev@vger.kernel.org, llvm@lists.linux.dev,
linux-kernel@vger.kernel.org, irogers@google.com,
Elkin Cruz <elkin@google.com>,
stable@vger.kernel.org
Subject: Re: [PATCH net] phonet: fix use-after-free in can_respond()
Date: Fri, 27 Nov 2026 22:17:00 +0200 [thread overview]
Message-ID: <IJCtsfWGQROQ4yf6qjbzpw@remlab.net> (raw)
In-Reply-To: <20261125221627.1419412-1-elkin@google.com>
Le torstaina 26. marraskuuta 2026, 0.16.27 Itä-Euroopan normaaliaika Elkin
Cruz a écrit :
> In can_respond(), ph is cached before pskb_may_pull(skb, 5). When
> ph->pn_res == PN_PREFIX and pskb_may_pull() reallocates skb->head,
> the check `if (ph->pn_res == PN_COMMGR)` dereferences the dangling ph
> pointer before the code re-acquires ph = pn_hdr(skb).
>
> Check for PN_COMMGR before calling pskb_may_pull() to avoid accessing
> the potentially invalidated header pointer.
>
> This issue was found while trying out new Clang static analysis checks for
> kernel bug classes. The finding was triaged and fixed, and this commit
> description was drafted with the help of AI, then verified by code
> inspection and compile-tested against linux-next (not reproduced and not
> runtime-tested on hardware).
>
> Fixes: c3a90c788b74 ("Phonet: do not reply to indication reset packets")
> Cc: stable@vger.kernel.org
> Signed-off-by: Elkin Cruz <elkin@google.com>
Acked-by: Rémi Denis-Courmont <courmisch@gmail.com>
--
ヅニ-クーモン・レミ
https://www.remlab.net/
prev parent reply other threads:[~2026-11-27 20:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 22:16 [PATCH net] phonet: fix use-after-free in can_respond() Elkin Cruz
2026-11-27 20:17 ` Rémi Denis-Courmont [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=IJCtsfWGQROQ4yf6qjbzpw@remlab.net \
--to=remi@remlab.net \
--cc=courmisch@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=elkin@google.com \
--cc=horms@kernel.org \
--cc=irogers@google.com \
--cc=justinstitt@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=willemb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox