From: Vincent Whitchurch <vincent.whitchurch@axis.com>
To: Steve French <smfrench@gmail.com>
Cc: <linux-cifs@vger.kernel.org>, <kernel@axis.com>, <pshilov@microsoft.com>
Subject: Re: [PATCH] CIFS: Fix task struct use-after-free on reconnect
Date: Thu, 23 Jan 2020 18:01:36 +0100 [thread overview]
Message-ID: <20200123170136.wnujtew76wwhpbmh@axis.com> (raw)
In-Reply-To: <CAH2r5mtGMGSPoOKtGK1+DqRswV=k7B05L6SSm02CUamDw2=0ew@mail.gmail.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.
next prev parent reply other threads:[~2020-01-23 17:01 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 [this message]
2020-01-23 18:47 ` Pavel Shilovsky
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=20200123170136.wnujtew76wwhpbmh@axis.com \
--to=vincent.whitchurch@axis.com \
--cc=kernel@axis.com \
--cc=linux-cifs@vger.kernel.org \
--cc=pshilov@microsoft.com \
--cc=smfrench@gmail.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).