Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Wentao Guan <guanwentao@uniontech.com>
Cc: sashal@kernel.org, dhowells@redhat.com, horms@kernel.org,
	jaltman@auristor.com, kuba@kernel.org,
	linux-afs@lists.infradead.org, marc.dionne@auristor.com,
	stable@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH RFC 6.6] rxrpc: Fix potential UAF after skb_unshare() failure
Date: Fri, 8 May 2026 10:57:43 +0200	[thread overview]
Message-ID: <2026050805-chill-winking-91d5@gregkh> (raw)
In-Reply-To: <20260508083142.1752208-1-guanwentao@uniontech.com>

On Fri, May 08, 2026 at 04:31:42PM +0800, Wentao Guan wrote:
> From: David Howells <dhowells@redhat.com>
> 
> [ Upstream commit 1f2740150f904bfa60e4bad74d65add3ccb5e7f8 ]
> 
> If skb_unshare() fails to unshare a packet due to allocation failure in
> rxrpc_input_packet(), the skb pointer in the parent (rxrpc_io_thread())
> will be NULL'd out.  This will likely cause the call to
> trace_rxrpc_rx_done() to oops.
> 
> Fix this by moving the unsharing down to where rxrpc_input_call_event()
> calls rxrpc_input_call_packet().  There are a number of places prior to
> that where we ignore DATA packets for a variety of reasons (such as the
> call already being complete) for which an unshare is then avoided.
> 
> And with that, rxrpc_input_packet() doesn't need to take a pointer to the
> pointer to the packet, so change that to just a pointer.
> 
> Fixes: 2d1faf7a0ca3 ("rxrpc: Simplify skbuff accounting in receive path")
> Closes: https://sashiko.dev/#/patchset/20260408121252.2249051-1-dhowells%40redhat.com
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Marc Dionne <marc.dionne@auristor.com>
> cc: Jeffrey Altman <jaltman@auristor.com>
> cc: Simon Horman <horms@kernel.org>
> cc: linux-afs@lists.infradead.org
> cc: stable@kernel.org
> Link: https://patch.msgid.link/20260422161438.2593376-4-dhowells@redhat.com
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> [ Relocated the unshare/skb_copy block from rxrpc_input_call_event()'s rx_queue dequeue loop to existing `if (skb) rxrpc_input_call_packet()` site, and substituted rxrpc_skb_put_call_rx with rxrpc_skb_put_input. ]
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> [ Readd rxrpc_skb_put_response_copy() or will cause a build fail with commit 24481a7f5733 ("rxrpc: Fix conn-level packet handling to unshare RESPONSE packets") ]
> Signed-off-by: Wentao Guan <guanwentao@uniontech.com>

Why not backport the needed commits before this one instead?  That would
make the difference here much smaller.

thanks,

greg k-h

  reply	other threads:[~2026-05-08  8:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 12:07 FAILED: patch "[PATCH] rxrpc: Fix conn-level packet handling to unshare RESPONSE" failed to apply to 6.6-stable tree gregkh
2026-05-03 14:33 ` [PATCH 6.6.y] rxrpc: Fix conn-level packet handling to unshare RESPONSE packets Sasha Levin
2026-05-08  8:31   ` [PATCH RFC 6.6] rxrpc: Fix potential UAF after skb_unshare() failure Wentao Guan
2026-05-08  8:57     ` Greg KH [this message]
2026-05-08  9:38       ` Wentao Guan
2026-05-08 21:11     ` Sasha Levin
2026-05-09 20:01       ` Backport RXRPC for 6.1.y from 6.2 Wentao Guan
2026-05-10 16:17         ` Greg KH
2026-05-10 16:36           ` Wentao Guan
2026-05-10 16:43             ` Greg KH
2026-05-10 17:25             ` Jeffrey E Altman
2026-05-10 17:41               ` Wentao Guan
2026-05-10 18:04                 ` Jeffrey E Altman
2026-05-10 18:26                   ` Wentao Guan
2026-05-10 18:38                     ` Jeffrey E Altman
2026-05-10 20:21                       ` Wentao Guan
2026-05-10 20:50                         ` Jeffrey Altman
2026-05-10 21:47                           ` Wentao Guan
2026-05-10 22:30                           ` Wentao Guan

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=2026050805-chill-winking-91d5@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dhowells@redhat.com \
    --cc=guanwentao@uniontech.com \
    --cc=horms@kernel.org \
    --cc=jaltman@auristor.com \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=marc.dionne@auristor.com \
    --cc=sashal@kernel.org \
    --cc=stable@kernel.org \
    --cc=stable@vger.kernel.org \
    /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