From: David Miller <davem@davemloft.net>
To: rpalethorpe@suse.com
Cc: linux-can@vger.kernel.org,
syzbot+017e491ae13c0068598a@syzkaller.appspotmail.com,
wg@grandegger.com, mkl@pengutronix.de, tylerwhall@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
syzkaller@googlegroups.com
Subject: Re: [PATCH v3] can, slip: Protect tty->disc_data in write_wakeup and close with RCU
Date: Wed, 22 Jan 2020 20:32:52 +0100 (CET) [thread overview]
Message-ID: <20200122.203252.1974816529601154217.davem@davemloft.net> (raw)
In-Reply-To: <20200121134258.18013-1-rpalethorpe@suse.com>
From: Richard Palethorpe <rpalethorpe@suse.com>
Date: Tue, 21 Jan 2020 14:42:58 +0100
> write_wakeup can happen in parallel with close/hangup where tty->disc_data
> is set to NULL and the netdevice is freed thus also freeing
> disc_data. write_wakeup accesses disc_data so we must prevent close from
> freeing the netdev while write_wakeup has a non-NULL view of
> tty->disc_data.
>
> We also need to make sure that accesses to disc_data are atomic. Which can
> all be done with RCU.
>
> This problem was found by Syzkaller on SLCAN, but the same issue is
> reproducible with the SLIP line discipline using an LTP test based on the
> Syzkaller reproducer.
>
> A fix which didn't use RCU was posted by Hillf Danton.
>
> Fixes: 661f7fda21b1 ("slip: Fix deadlock in write_wakeup")
> Fixes: a8e83b17536a ("slcan: Port write_wakeup deadlock fix from slip")
> Reported-by: syzbot+017e491ae13c0068598a@syzkaller.appspotmail.com
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2020-01-22 19:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-21 13:42 [PATCH v3] can, slip: Protect tty->disc_data in write_wakeup and close with RCU Richard Palethorpe
2020-01-22 19:32 ` David Miller [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=20200122.203252.1974816529601154217.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=rpalethorpe@suse.com \
--cc=syzbot+017e491ae13c0068598a@syzkaller.appspotmail.com \
--cc=syzkaller@googlegroups.com \
--cc=tylerwhall@gmail.com \
--cc=wg@grandegger.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).