linux/net
Ido Schimmel 0fea83e06f drop_monitor: Do not cancel uninitialized work item
[ Upstream commit dfa7f70959 ]

Drop monitor uses a work item that takes care of constructing and
sending netlink notifications to user space. In case drop monitor never
started to monitor, then the work item is uninitialized and not
associated with a function.

Therefore, a stop command from user space results in canceling an
uninitialized work item which leads to the following warning [1].

Fix this by not processing a stop command if drop monitor is not
currently monitoring.

[1]
[   31.735402] ------------[ cut here ]------------
[   31.736470] WARNING: CPU: 0 PID: 143 at kernel/workqueue.c:3032 __flush_work+0x89f/0x9f0
...
[   31.738120] CPU: 0 PID: 143 Comm: dwdump Not tainted 5.5.0-custom-09491-g16d4077796b8 #727
[   31.741968] RIP: 0010:__flush_work+0x89f/0x9f0
...
[   31.760526] Call Trace:
[   31.771689]  __cancel_work_timer+0x2a6/0x3b0
[   31.776809]  net_dm_cmd_trace+0x300/0xef0
[   31.777549]  genl_rcv_msg+0x5c6/0xd50
[   31.781005]  netlink_rcv_skb+0x13b/0x3a0
[   31.784114]  genl_rcv+0x29/0x40
[   31.784720]  netlink_unicast+0x49f/0x6a0
[   31.787148]  netlink_sendmsg+0x7cf/0xc80
[   31.790426]  ____sys_sendmsg+0x620/0x770
[   31.793458]  ___sys_sendmsg+0xfd/0x170
[   31.802216]  __sys_sendmsg+0xdf/0x1a0
[   31.806195]  do_syscall_64+0xa0/0x540
[   31.806885]  entry_SYSCALL_64_after_hwframe+0x49/0xbe

Fixes: 8e94c3bc92 ("drop_monitor: Allow user to start monitoring hardware drops")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-11 04:35:51 -08:00
..
6lowpan
9p
802
8021q vlan: vlan_changelink() should propagate errors 2020-01-12 12:21:50 +01:00
appletalk
atm
ax25
batman-adv batman-adv: Fix DAT candidate selection on little endian systems 2020-01-23 08:22:49 +01:00
bluetooth Bluetooth: Fix race condition in hci_release_sock() 2020-02-05 21:22:42 +00:00
bpf
bpfilter
bridge
caif
can
ceph
core drop_monitor: Do not cancel uninitialized work item 2020-02-11 04:35:51 -08:00
dcb
dccp
decnet
dns_resolver
dsa net: dsa: tag_gswip: fix typo in tagger name 2020-01-23 08:22:52 +01:00
ethernet
hsr net: hsr: fix possible NULL deref in hsr_handle_frame() 2020-02-11 04:35:04 -08:00
ieee802154
ife
ipv4 tcp: clear tp->segs_{in|out} in tcp_disconnect() 2020-02-11 04:35:06 -08:00
ipv6 ipv6/addrconf: fix potential NULL deref in inet6_set_link_af() 2020-02-11 04:35:51 -08:00
iucv
kcm
key
l2tp l2tp: Allow duplicate session creation with UDP 2020-02-11 04:35:04 -08:00
l3mdev
lapb
llc llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c) 2020-01-12 12:21:45 +01:00
mac80211 mac80211: Fix TKIP replay protection immediately after key setup 2020-02-05 21:22:46 +00:00
mac802154
mpls
ncsi
netfilter netfilter: ipset: fix suspicious RCU usage in find_set_and_id 2020-02-11 04:35:07 -08:00
netlabel
netlink
netrom
nfc
nsh
openvswitch net: openvswitch: don't unlock mutex when changing the user_features fails 2020-01-26 10:01:05 +01:00
packet packet: fix data-race in fanout_flow_is_huge() 2020-01-26 10:01:06 +01:00
phonet
psample
qrtr
rds
rfkill rfkill: Fix incorrect check to avoid NULL pointer dereference 2020-01-12 12:21:33 +01:00
rose
rxrpc rxrpc: Fix NULL pointer deref due to call->conn being cleared on disconnect 2020-02-11 04:35:05 -08:00
sched taprio: Fix dropping packets when using taprio + ETF offloading 2020-02-11 04:35:51 -08:00
sctp sctp: free cmd->obj.chunk for the unprocessed SCTP_CMD_REPLY 2020-01-12 12:21:48 +01:00
smc
strparser
sunrpc sunrpc: expiry_time should be seconds not timeval 2020-02-11 04:35:35 -08:00
switchdev
tipc tipc: fix wrong timeout input for tipc_wait_for_cond() 2020-01-26 10:01:00 +01:00
tls net/tls: fix async operation 2020-01-29 16:45:28 +01:00
unix af_unix: add compat_ioctl support 2020-01-17 19:48:52 +01:00
vmw_vsock
wimax
wireless wireless: wext: avoid gcc -O3 warning 2020-02-05 21:22:47 +00:00
x25 net/x25: fix nonblocking connect 2020-01-29 16:45:33 +01:00
xdp xsk: Add rcu_read_lock around the XSK wakeup 2020-01-12 12:21:41 +01:00
xfrm xfrm: interface: do not confirm neighbor when do pmtu update 2020-02-05 21:22:48 +00:00
Kconfig
Makefile
compat.c
socket.c compat_ioctl: handle SIOCOUTQNSD 2020-01-17 19:48:52 +01:00
sysctl_net.c