linux-stable/net
Tetsuo Handa ec38df2445 can: bcm/raw/isotp: use per module netdevice notifier
commit 8d0caedb75 upstream.

syzbot is reporting hung task at register_netdevice_notifier() [1] and
unregister_netdevice_notifier() [2], for cleanup_net() might perform
time consuming operations while CAN driver's raw/bcm/isotp modules are
calling {register,unregister}_netdevice_notifier() on each socket.

Change raw/bcm/isotp modules to call register_netdevice_notifier() from
module's __init function and call unregister_netdevice_notifier() from
module's __exit function, as with gw/j1939 modules are doing.

Link: https://syzkaller.appspot.com/bug?id=391b9498827788b3cc6830226d4ff5be87107c30 [1]
Link: https://syzkaller.appspot.com/bug?id=1724d278c83ca6e6df100a2e320c10d991cf2bce [2]
Link: https://lore.kernel.org/r/54a5f451-05ed-f977-8534-79e7aa2bcc8f@i-love.sakura.ne.jp
Cc: linux-stable <stable@vger.kernel.org>
Reported-by: syzbot <syzbot+355f8edb2ff45d5f95fa@syzkaller.appspotmail.com>
Reported-by: syzbot <syzbot+0f1827363a305f74996f@syzkaller.appspotmail.com>
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Tested-by: syzbot <syzbot+355f8edb2ff45d5f95fa@syzkaller.appspotmail.com>
Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-30 08:48:55 -04:00
..
6lowpan 6lowpan: Off by one handling ->nexthdr 2020-01-27 14:46:30 +01:00
9p net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid 2020-11-05 11:06:57 +01:00
802
8021q net: vlan: avoid leaks on register_vlan_dev() failures 2021-01-17 13:58:58 +01:00
appletalk appletalk: Fix skb allocation size in loopback case 2021-04-07 12:47:02 +02:00
atm atm: fix a memory leak of vcc->user_back 2020-10-01 13:12:42 +02:00
ax25 AX.25: Prevent integer overflows in connect and sendmsg 2020-07-31 16:44:44 +02:00
batman-adv batman-adv: Avoid WARN_ON timing related checks 2021-06-30 08:48:48 -04:00
bluetooth Bluetooth: use correct lock to prevent UAF of hdev object 2021-06-10 12:43:50 +02:00
bpf
bridge net: bridge: fix vlan tunnel dst refcnt when egressing 2021-06-30 08:48:54 -04:00
caif net: caif: fix memory leak in cfusbl_device_notify 2021-06-10 12:43:51 +02:00
can can: bcm/raw/isotp: use per module netdevice notifier 2021-06-30 08:48:55 -04:00
ceph libceph: clear con->out_msg on Policy::stateful_server faults 2020-11-05 11:07:03 +01:00
core rtnetlink: Fix regression in bridge VLAN configuration 2021-06-30 08:48:49 -04:00
dcb net: dcb: Accept RTM_GETDCB messages carrying set-like DCB commands 2021-01-23 15:48:46 +01:00
dccp ipv6: weaken the v4mapped source check 2021-04-07 12:47:00 +02:00
decnet net: add bool confirm_neigh parameter for dst_ops.update_pmtu 2020-01-04 14:00:14 +01:00
dns_resolver KEYS: Don't write out to userspace while holding key semaphore 2020-04-24 08:01:25 +02:00
dsa net: dsa: Fix duplicate frames flooded by learning 2020-04-02 16:34:24 +02:00
ethernet net: add annotations on hh->hh_len lockless accesses 2020-01-09 10:17:59 +01:00
hsr hsr: use netdev_err() instead of WARN_ONCE() 2021-05-22 10:57:24 +02:00
ieee802154 net: ieee802154: fix null deref in parse dev addr 2021-06-30 08:48:45 -04:00
ife
ipv4 icmp: don't send out ICMP messages with a source address of 0.0.0.0 2021-06-30 08:48:51 -04:00
ipv6 udp: fix race between close() and udp_abort() 2021-06-30 08:48:49 -04:00
ipx
iucv net/af_iucv: set correct sk_protocol for child sockets 2020-12-08 10:17:32 +01:00
kcm
key af_key: relax availability checks for skb size calculation 2021-02-23 14:00:29 +01:00
l2tp l2tp: remove skb_dst_set() from l2tp_xmit_skb() 2020-07-22 09:22:19 +02:00
l3mdev
lapb net: lapb: Copy the skb before sending a packet 2021-02-10 09:12:08 +01:00
llc llc: make sure applications use ARPHRD_ETHER 2020-07-22 09:22:20 +02:00
mac80211 mac80211: extend protection against mixed key and fragment cache attacks 2021-06-03 08:36:14 +02:00
mac802154 net: mac802154: Fix general protection fault 2021-04-16 11:57:52 +02:00
mpls net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0 2021-03-17 16:34:28 +01:00
ncsi net/ncsi: Avoid GFP_KERNEL in response handler 2021-04-16 11:57:51 +02:00
netfilter netfilter: synproxy: Fix out of bounds when parsing TCP options 2021-06-30 08:48:49 -04:00
netlabel cipso,calipso: resolve a number of problems with the DOI refcounts 2021-03-17 16:34:29 +01:00
netlink netlink: disable IRQs for netlink_lock_table() 2021-06-16 11:53:01 +02:00
netrom net: netrom: Fix potential nr_neigh refcnt leak in nr_add_node 2020-05-02 17:24:17 +02:00
nfc net/nfc/rawsock.c: fix a permission check bug 2021-06-16 11:53:00 +02:00
nsh
openvswitch openvswitch: fix stack OOB read while fragmenting IPv4 packets 2021-05-22 10:57:21 +02:00
packet net/packet: fix overflow in tpacket_rcv 2020-10-14 09:51:09 +02:00
phonet
psample
qrtr net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() 2021-03-30 14:40:12 +02:00
rds net: rds: fix memory leak in rds_recvmsg 2021-06-30 08:48:49 -04:00
rfkill rfkill: Fix incorrect check to avoid NULL pointer dereference 2020-01-12 12:11:57 +01:00
rose rose: Fix Null pointer dereference in rose_send_frame() 2020-12-08 10:17:32 +01:00
rxrpc rxrpc: Fix handling of an unsupported token type in rxrpc_read() 2021-01-23 15:48:47 +01:00
sched sch_dsmark: fix a NULL deref in qdisc_reset() 2021-06-03 08:36:25 +02:00
sctp sctp: fix a SCTP_MIB_CURRESTAB leak in sctp_sf_do_dupcook_b 2021-05-22 10:57:38 +02:00
smc net/smc: check for valid ib_client_data 2020-03-20 10:54:20 +01:00
strparser
sunrpc rpc: fix NULL dereference on kmalloc failure 2021-04-07 12:47:00 +02:00
switchdev
tipc tipc: skb_linearize the head skb when reassembling msgs 2021-06-03 08:36:19 +02:00
tls
unix net/af_unix: fix a data-race in unix_dgram_sendmsg / unix_release_sock 2021-06-30 08:48:51 -04:00
vmw_vsock vsock/vmci: log once the failed queue pair allocation 2021-05-22 10:57:34 +02:00
wimax
wireless cfg80211: mitigate A-MSDU aggregation attacks 2021-06-03 08:36:13 +02:00
x25 net/x25: Return the correct errno code 2021-06-30 08:48:47 -04:00
xfrm xfrm: Fix oops in xfrm_replay_advance_bmp 2021-02-03 23:22:22 +01:00
compat.c net: Return the correct errno code 2021-06-30 08:48:47 -04:00
Kconfig
Makefile
socket.c net: Set fput_needed iff FDPUT_FPUT is set 2020-08-21 09:48:14 +02:00
sysctl_net.c