linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.org>
To: linux-cifs@vger.kernel.org
Cc: syzbot+5003556314abc915a71f@syzkaller.appspotmail.com,
	David Howells <dhowells@redhat.com>,
	Shyam Prasad N <sprasad@microsoft.com>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>,
	Namjae Jeon <linkinjeon@kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] smb: client: cancel reconnect work in clean_demultiplex_info()
Date: Sun, 13 Sep 2026 15:26:09 -0300	[thread overview]
Message-ID: <dacbe87f887b4ce6c93846c8d34c162e@manguebit.org> (raw)
In-Reply-To: <20260912152008.392251-1-pc@manguebit.org>

Paulo Alcantara <pc@manguebit.org> writes:

> clean_demultiplex_info() cancels server->echo delayed work but not
> server->reconnect, which can cause a use-after-free when the
> demultiplex thread exits while a reconnect work is still queued:
>
>   cifs_demultiplex_thread()
>     cifs_readv_from_socket()
>       cifs_reconnect()
>         __cifs_reconnect()
>           cifs_queue_server_reconn()
>             mod_delayed_work(cifsiod_wq, &server->reconnect, 0)
>     clean_demultiplex_info()
>       cancel_delayed_work_sync(&server->echo)   // echo canceled
>                                                  // reconnect NOT canceled
>       kfree_sensitive(server)                    // server freed
>
>   ...later, on cifsiod_wq:
>
>   smb2_reconnect_server()
>     server->srv_count  // UAF read of freed server
>
> Fix this by canceling server->reconnect delayed work in
> clean_demultiplex_info() before the server is freed, the same way
> cifs_put_tcp_session() already does.
> ...

Applied.

      parent reply	other threads:[~2026-09-13 18:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 15:20 [PATCH] smb: client: cancel reconnect work in clean_demultiplex_info() Paulo Alcantara
2026-09-13  0:16 ` Namjae Jeon
2026-09-13 18:26 ` 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=dacbe87f887b4ce6c93846c8d34c162e@manguebit.org \
    --to=pc@manguebit.org \
    --cc=bharathsm@microsoft.com \
    --cc=dhowells@redhat.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=sprasad@microsoft.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+5003556314abc915a71f@syzkaller.appspotmail.com \
    --cc=tom@talpey.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;
as well as URLs for NNTP newsgroup(s).