linux/net/core
Jakub Kicinski 65783e46da net: fix race on decreasing number of TX queues
commit ac5b70198a upstream.

netif_set_real_num_tx_queues() can be called when netdev is up.
That usually happens when user requests change of number of
channels/rings with ethtool -L.  The procedure for changing
the number of queues involves resetting the qdiscs and setting
dev->num_tx_queues to the new value.  When the new value is
lower than the old one, extra care has to be taken to ensure
ordering of accesses to the number of queues vs qdisc reset.

Currently the queues are reset before new dev->num_tx_queues
is assigned, leaving a window of time where packets can be
enqueued onto the queues going down, leading to a likely
crash in the drivers, since most drivers don't check if TX
skbs are assigned to an active queue.

Fixes: e6484930d7 ("net: allocate tx queues in register_netdevice")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-06-16 22:22:14 +01:00
..
datagram.c Revert "[stable-only] net: add length argument to skb_copy_and_csum_datagram_iovec" 2016-01-25 10:44:07 +00:00
dev.c net: fix race on decreasing number of TX queues 2018-06-16 22:22:14 +01:00
dev_addr_lists.c net: Add support for device specific address syncing 2014-06-02 10:40:54 -07:00
dev_ioctl.c net_tstamp: Add SIOCGHWTSTAMP ioctl to match SIOCSHWTSTAMP 2013-11-19 19:07:21 +00:00
drop_monitor.c drop_monitor: consider inserted data in genlmsg_end 2017-03-16 02:27:22 +00:00
dst.c ipv4: add reference counting to metrics 2017-11-11 13:33:21 +00:00
ethtool.c ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings 2015-10-28 10:33:20 +00:00
fib_rules.c fib_rules: Fix dump_rules() not to exit early 2015-10-19 11:23:19 +01:00
filter.c rose: limit sk_filter trim to payload 2017-02-23 03:54:46 +00:00
flow.c flowcache: Fix kernel panic in flow_cache_flush_task 2015-03-12 15:46:26 +00:00
flow_dissector.c net: Rename skb->rxhash to skb->hash 2014-03-26 15:58:20 -04:00
gen_estimator.c net_sched: add 64bit rate estimators 2013-06-11 02:51:03 -07:00
gen_stats.c gen_stats.c: Duplicate xstats buffer for later use 2015-03-12 16:27:17 +00:00
iovec.c net: sendmsg: fix NULL pointer dereference 2014-07-29 12:20:22 -07:00
link_watch.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
Makefile net: Add a software TSO helper API 2014-05-22 14:57:15 -04:00
neighbour.c net/neighbour: fix crash at dumping device-agnostic proxy entries 2015-12-18 16:06:24 +00:00
net-procfs.c rps: selective flow shedding during softnet overflow 2013-05-20 13:48:04 -07:00
net-sysfs.c net: don't decrement kobj reference count on init failure 2017-11-26 13:50:21 +00:00
net-sysfs.h net: netdev_kobject_init: annotate with __init 2014-01-05 20:27:54 -05:00
net-traces.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
net_namespace.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-05-24 00:32:30 -04:00
netclassid_cgroup.c cgroup: remove css_parent() 2014-05-16 13:22:48 -04:00
netevent.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
netpoll.c netpoll: Use skb_irq_freeable to make zap_completion_queue safe. 2014-04-01 17:53:36 -04:00
netprio_cgroup.c cgroup: remove css_parent() 2014-05-16 13:22:48 -04:00
pktgen.c dst: Increase alignment of metrics to allow extra flag on pointers 2017-11-11 13:33:20 +00:00
ptp_classifier.c net: filter: let unattached filters use sock_fprog_kern 2014-05-23 16:48:05 -04:00
request_sock.c net: remove unnecessary return's 2014-02-13 18:33:38 -05:00
rtnetlink.c net: enable interface alias removal via rtnl 2018-01-01 20:51:54 +00:00
scm.c unix: correctly track in-flight fds in sending process user_struct 2016-02-25 10:51:00 +00:00
secure_seq.c inetpeer: get rid of ip_id_count 2014-06-02 11:00:41 -07:00
skbuff.c netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed 2018-01-01 20:52:04 +00:00
sock.c net: fix compile error in skb_orphan_partial() 2017-09-15 18:29:43 +01:00
sock_diag.c net: Move the permission check in sock_diag_put_filterinfo to packet_diag_dump 2014-04-24 13:44:53 -04:00
stream.c net: replace macros net_random and net_srandom with direct calls to prandom 2014-01-14 15:15:25 -08:00
sysctl_net_core.c net:Add sysctl_max_skb_frags 2016-03-24 10:00:44 +00:00
timestamping.c net: ptp: move PTP classifier in its own file 2014-04-01 16:43:18 -04:00
tso.c net: tso: fix unaligned access to crafted TCP header in helper API 2014-11-05 16:39:43 +00:00
user_dma.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
utils.c net: avoid dependency of net_get_random_once on nop patching 2014-05-14 00:37:34 -04:00