linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Shilovsky <piastryyy@gmail.com>
To: Vincent Whitchurch <vincent.whitchurch@axis.com>
Cc: Steve French <smfrench@gmail.com>,
	linux-cifs <linux-cifs@vger.kernel.org>,
	kernel@axis.com, Pavel Shilovskiy <pshilov@microsoft.com>
Subject: Re: [PATCH] CIFS: Fix task struct use-after-free on reconnect
Date: Thu, 23 Jan 2020 10:47:11 -0800	[thread overview]
Message-ID: <CAKywueSZpBd-VEWLz6WRadEbne-PMsOGYjErRuYsG5gML66mmg@mail.gmail.com> (raw)
In-Reply-To: <20200123170136.wnujtew76wwhpbmh@axis.com>

чт, 23 янв. 2020 г. в 09:02, Vincent Whitchurch <vincent.whitchurch@axis.com>:
>
> On Thu, Jan 23, 2020 at 05:35:16PM +0100, Steve French wrote:
> > On Thu, Jan 23, 2020, 10:17 Vincent Whitchurch <vincent.whitchurch@axis.com> wrote:
> > > This can be reliably reproduced by adding the below delay to
> > > cifs_reconnect(), running find(1) on the mount, restarting the samba
> > > server while find is running, and killing find during the delay:
> > >
> > >         spin_unlock(&GlobalMid_Lock);
> > >         mutex_unlock(&server->srv_mutex);
> > >
> > >  +      msleep(10000);
> > >  +
> > >         cifs_dbg(FYI, "%s: issuing mid callbacks\n", __func__);
> > >         list_for_each_safe(tmp, tmp2, &retry_list) {
> > >                 mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
> > >
> > > Fix this by holding a reference to the task struct until the MID is
> > > freed.
> >
> > Cc:stable as well?
>
> Yes, I think this bug has been there for a while.
>
> Note that the test described above usually triggers a different crash on
> kernels earlier than v5.4 because abe57073d08c13b95a46ccf48c ("CIFS: Fix
> retry mid list corruption on reconnects") has not (yet?) been backported
> to those stable kernels.

It has been only backported to 5.3.x - available from version 5.3.10.

The patch in the thread looks good. Good catch, thanks!

Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>

--
Best regards,
Pavel Shilovsky

  reply	other threads:[~2020-01-23 18:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 16:09 [PATCH] CIFS: Fix task struct use-after-free on reconnect Vincent Whitchurch
     [not found] ` <CAH2r5mtGMGSPoOKtGK1+DqRswV=k7B05L6SSm02CUamDw2=0ew@mail.gmail.com>
2020-01-23 17:01   ` Vincent Whitchurch
2020-01-23 18:47     ` Pavel Shilovsky [this message]
2020-01-23 17:07 ` Paulo Alcantara
2020-01-23 20:20 ` Steve French

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=CAKywueSZpBd-VEWLz6WRadEbne-PMsOGYjErRuYsG5gML66mmg@mail.gmail.com \
    --to=piastryyy@gmail.com \
    --cc=kernel@axis.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=pshilov@microsoft.com \
    --cc=smfrench@gmail.com \
    --cc=vincent.whitchurch@axis.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).