From: David Miller <davem@davemloft.net>
To: fw@strlen.de
Cc: netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com,
bot+e52a2ae091b628f72765583c9faedc961c83b7e7@syzkaller.appspotmail.com
Subject: Re: [PATCH net] fib: fib_dump_info can no longer use __in_dev_get_rtnl
Date: Fri, 03 Nov 2017 14:28:08 +0900 (KST) [thread overview]
Message-ID: <20171103.142808.654415128418406242.davem@davemloft.net> (raw)
In-Reply-To: <20171102150220.9865-1-fw@strlen.de>
From: Florian Westphal <fw@strlen.de>
Date: Thu, 2 Nov 2017 16:02:20 +0100
> syzbot reported yet another regression added with DOIT_UNLOCKED.
> When nexthop is marked as dead, fib_dump_info uses __in_dev_get_rtnl():
>
> ./include/linux/inetdevice.h:230 suspicious rcu_dereference_protected() usage!
> rcu_scheduler_active = 2, debug_locks = 1
> 1 lock held by syz-executor2/23859:
> #0: (rcu_read_lock){....}, at: [<ffffffff840283f0>]
> inet_rtm_getroute+0xaa0/0x2d70 net/ipv4/route.c:2738
> [..]
> lockdep_rcu_suspicious+0x123/0x170 kernel/locking/lockdep.c:4665
> __in_dev_get_rtnl include/linux/inetdevice.h:230 [inline]
> fib_dump_info+0x1136/0x13d0 net/ipv4/fib_semantics.c:1377
> inet_rtm_getroute+0xf97/0x2d70 net/ipv4/route.c:2785
> ..
>
> This isn't safe anymore, callers either hold RTNL mutex or rcu read lock,
> so these spots must use rcu_dereference_rtnl() or plain rcu_derefence()
> (plus unconditional rcu read lock).
>
> This does the latter.
>
> Fixes: 394f51abb3d04f ("ipv4: route: set ipv4 RTM_GETROUTE to not use rtnl")
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
Applied, thanks Florian.
next prev parent reply other threads:[~2017-11-03 5:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-02 10:53 suspicious RCU usage at ./include/linux/inetdevice.h:LINE syzbot
2017-11-02 15:02 ` [PATCH net] fib: fib_dump_info can no longer use __in_dev_get_rtnl Florian Westphal
2017-11-03 5:28 ` David Miller [this message]
2017-11-02 18:56 ` suspicious RCU usage at ./include/linux/inetdevice.h:LINE Cong Wang
2017-11-02 19:06 ` Florian Westphal
2017-11-02 20:55 ` Cong Wang
2018-01-31 0:43 ` Eric Biggers
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=20171103.142808.654415128418406242.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bot+e52a2ae091b628f72765583c9faedc961c83b7e7@syzkaller.appspotmail.com \
--cc=fw@strlen.de \
--cc=netdev@vger.kernel.org \
--cc=syzkaller-bugs@googlegroups.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).