Subash Abhinov Kasiviswanathan
5c346525d3
net: qualcomm: rmnet: Fix rcu splat in rmnet_is_real_dev_registered
Xiaolong reported a suspicious rcu_dereference_check in the device
unregister notifier callback. Since we do not dereference the
rx_handler_data, it's ok to just check for the value of the pointer.
Note that this section is already protected by rtnl_lock.
[ 101.364846] WARNING: suspicious RCU usage
[ 101.365654] 4.13.0-rc6-01701-gceed73a #1 Not tainted
[ 101.370873] -----------------------------
[ 101.372472] drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:57 suspicious rcu_dereference_check() usage!
[ 101.374427]
[ 101.374427] other info that might help us debug this:
[ 101.374427]
[ 101.387491]
[ 101.387491] rcu_scheduler_active = 2, debug_locks = 1
[ 101.389368] 1 lock held by trinity-main/2809:
[ 101.390736] #0: (rtnl_mutex){+.+.+.}, at: [<8146085b>] rtnl_lock+0xf/0x11
[ 101.395482]
[ 101.395482] stack backtrace:
[ 101.396948] CPU: 0 PID: 2809 Comm: trinity-main Not tainted 4.13.0-rc6-01701-gceed73a #1
[ 101.398857] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-20161025_171302-gandalf 04/01/2014
[ 101.401079] Call Trace:
[ 101.401656] dump_stack+0xa1/0xeb
[ 101.402871] lockdep_rcu_suspicious+0xc7/0xd0
[ 101.403665] rmnet_is_real_dev_registered+0x40/0x4e
[ 101.405199] rmnet_config_notify_cb+0x2c/0x142
[ 101.406344] ? wireless_nlevent_flush+0x47/0x71
[ 101.407385] notifier_call_chain+0x2d/0x47
[ 101.408645] raw_notifier_call_chain+0xc/0xe
[ 101.409882] call_netdevice_notifiers_info+0x41/0x49
[ 101.411402] call_netdevice_notifiers+0xc/0xe
[ 101.412713] rollback_registered_many+0x268/0x36e
[ 101.413702] rollback_registered+0x39/0x56
[ 101.414965] unregister_netdevice_queue+0x79/0x88
[ 101.415908] unregister_netdev+0x16/0x1d
Fixes: ceed73a2cf ("drivers: net: ethernet: qualcomm: rmnet: Initial implementation")
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Reported-by: kernel test robot <xiaolong.ye@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-23 19:59:53 -07:00
..
2017-09-22 23:38:45 +02:00
2017-09-01 09:22:50 +02:00
2017-09-06 22:41:21 -07:00
2017-09-22 17:28:59 -10:00
2017-09-12 20:03:53 -07:00
2017-09-10 20:40:00 -07:00
2017-09-14 11:59:30 +02:00
2017-09-13 11:04:14 -07:00
2017-09-15 20:43:33 -07:00
2017-09-20 00:51:01 +02:00
2017-09-19 23:10:51 +02:00
2017-09-20 17:42:42 +08:00
2017-09-14 13:43:16 -07:00
2017-09-07 14:03:05 -07:00
2017-09-14 11:59:30 +02:00
2017-09-07 13:51:13 -07:00
2017-09-21 08:02:39 +10:00
2017-09-07 12:53:14 -07:00
2017-09-07 09:25:15 -07:00
2017-09-14 11:59:30 +02:00
2017-09-14 17:34:43 +02:00
2017-09-07 11:59:42 -07:00
2017-09-05 12:19:08 -07:00
2017-09-07 13:51:13 -07:00
2017-09-23 05:47:04 -10:00
2017-09-22 17:23:41 -10:00
2017-09-22 12:05:43 +02:00
2017-09-15 20:43:33 -07:00
2017-09-20 16:01:36 -07:00
2017-09-14 11:59:30 +02:00
2017-09-01 16:42:54 +10:00
2017-09-07 13:23:37 -07:00
2017-09-05 11:08:17 -07:00
2017-09-19 08:39:32 -07:00
2017-09-14 18:13:32 -07:00
2017-09-10 20:40:00 -07:00
2017-09-14 11:59:30 +02:00
2017-09-13 18:53:16 -07:00
2017-09-08 15:38:22 +02:00
2017-09-18 14:51:02 +02:00
2017-09-23 19:59:53 -07:00
2017-09-18 17:29:01 -07:00
2017-09-11 12:29:40 -04:00
2017-09-12 13:30:06 -07:00
2017-09-05 11:08:17 -07:00
2017-09-20 13:56:06 -05:00
2017-09-22 15:11:46 +01:00
2017-09-15 20:43:33 -07:00
2017-09-12 15:58:45 +02:00
2017-09-14 11:59:30 +02:00
2017-09-14 11:59:30 +02:00
2017-09-09 14:44:39 -07:00
2017-09-08 18:26:51 -07:00
2017-09-11 13:04:32 -07:00
2017-09-07 13:51:13 -07:00
2017-09-09 14:34:38 -07:00
2017-09-15 20:43:33 -07:00
2017-09-04 10:52:30 -07:00
2017-09-13 10:56:00 -07:00
2017-09-19 08:36:19 +02:00
2017-09-15 15:16:49 -04:00
2017-09-15 20:43:33 -07:00
2017-09-05 12:45:03 -07:00
2017-09-14 18:54:01 -07:00
2017-09-14 18:13:32 -07:00
2017-09-08 11:20:04 +08:00
2017-09-05 12:45:03 -07:00
2017-09-14 11:59:30 +02:00
2017-09-14 18:13:32 -07:00
2017-08-30 14:03:42 -06:00
2017-09-08 18:26:49 -07:00
2017-09-14 13:33:33 -07:00
2017-09-07 21:11:05 -07:00
2017-09-09 14:44:39 -07:00
2017-09-15 20:43:33 -07:00
2017-09-22 06:40:47 -10:00