mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.org>
To: Weiming Shi <bestswngs@gmail.com>,
	Namjae Jeon <linkinjeon@kernel.org>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Shyam Prasad N <sprasad@microsoft.com>,
	Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>
Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Steve French <stfrench@microsoft.com>,
	David Howells <dhowells@redhat.com>, Xiang Mei <xmei5@asu.edu>,
	stable@vger.kernel.org, co+24c7c12d69e63c6d@bugs.sh
Subject: Re: [PATCH] smb: client: stop processing a read response after a receive error
Date: Mon, 26 Oct 2026 22:31:41 -0300	[thread overview]
Message-ID: <7fefb04108efc48418cb2a8ff7287293@manguebit.org> (raw)
In-Reply-To: <20261025090730.2893106-1-bestswngs@gmail.com>

Weiming Shi <bestswngs@gmail.com> writes:

> cifs_read_iter_from_socket() may call cifs_reconnect() before returning an
> error.  The reconnect path aborts pending mids and invokes their callbacks.
> The callback can then release the cifs_io_subrequest containing rdata.
>
> cifs_readv_receive() nevertheless continues after a negative return and may
> dereference rdata in cifs_readv_discard().  KASAN reports the resulting
> UAF:
>
>   BUG: KASAN: slab-use-after-free in cifs_readv_receive
>   Read of size 4 by task cifsd
>   cifs_readv_receive (fs/smb/client/transport.c:1284)
>   cifs_demultiplex_thread (fs/smb/client/connect.c:1355)
>   kthread (kernel/kthread.c:436)
>   ret_from_fork (arch/x86/kernel/process.c:158)
>
>   Freed by task 148:
>   netfs_put_subrequest (fs/netfs/objects.c:267)
>   netfs_read_collection (fs/netfs/read_collect.c:460)
>   netfs_wait_for_in_progress (fs/netfs/misc.c:462)
>
> Return the socket error immediately, as this path did before the iterator
> conversion.  This also avoids adding a negative length to total_read.
> ...

Applied.

      reply	other threads:[~2026-10-27  1:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25  9:07 Weiming Shi
2026-10-27  1:31 ` Paulo Alcantara [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=7fefb04108efc48418cb2a8ff7287293@manguebit.org \
    --to=pc@manguebit.org \
    --cc=bestswngs@gmail.com \
    --cc=bharathsm@microsoft.com \
    --cc=co+24c7c12d69e63c6d@bugs.sh \
    --cc=dhowells@redhat.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=sprasad@microsoft.com \
    --cc=stable@vger.kernel.org \
    --cc=stfrench@microsoft.com \
    --cc=tom@talpey.com \
    --cc=xmei5@asu.edu \
    /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

all inboxes | Powered by JetHome®