linux/net
Patrick McHardy 24023451c8 [NET]: Add net_device change_rx_mode callback
Currently the set_multicast_list (and set_rx_mode) callbacks are
responsible for configuring the device according to the IFF_PROMISC,
IFF_MULTICAST and IFF_ALLMULTI flags and the mc_list (and uc_list in
case of set_rx_mode).

These callbacks can be invoked from BH context without the rtnl_mutex
by dev_mc_add/dev_mc_delete, which makes reading the device flags and
promiscous/allmulti count racy. For real hardware drivers that just
commit all changes to the hardware this is not a real problem since
the stack guarantees to call them for every change, so at least the
final call will not race and commit the correct configuration to the
hardware.

For software devices that want to synchronize promiscous and multicast
state to an underlying device however this can cause corruption of the
underlying device's flags or promisc/allmulti counts.

When the software device is concurrently put in promiscous or allmulti
mode while set_multicast_list is invoked from bottem half context, the
device might synchronize the change to the underlying device without
holding the rtnl_mutex, which races with concurrent changes to the
underlying device.

Add a dev->change_rx_flags hook that is invoked when any of the flags
that affect rx filtering change (under the rtnl_mutex), which allows
drivers to perform synchronization immediately and only synchronize
the address lists in set_multicast_list/set_rx_mode.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-07-14 18:51:31 -07:00
..
802 [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
8021q [RTNETLINK]: rtnl_link: allow specifying initial device address 2007-07-11 19:45:36 -07:00
appletalk [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
atm [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
ax25 [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
bluetooth [Bluetooth] Add basics to better support and handle eSCO links 2007-07-11 07:35:32 +02:00
bridge Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6 2007-07-12 13:40:20 -07:00
core [NET]: Add net_device change_rx_mode callback 2007-07-14 18:51:31 -07:00
dccp [IPV6]: Do not send RH0 anymore. 2007-07-10 22:55:49 -07:00
decnet [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
econet [SK_BUFF]: Convert skb->tail to sk_buff_data_t 2007-04-25 22:26:28 -07:00
ethernet [ETH]: Validate address in eth_mac_addr 2007-07-11 19:41:18 -07:00
ieee80211 [PATCH] softmac: use list_for_each_entry 2007-07-08 22:16:37 -04:00
ipv4 Merge branch 'ioat-md-accel-for-linus' of git://lost.foo-projects.org/~dwillia2/git/iop 2007-07-13 10:52:27 -07:00
ipv6 [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
ipx [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
irda [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
iucv Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
key xfrm: Add security check before flushing SAD/SPD 2007-06-07 13:42:46 -07:00
lapb [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
llc [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
mac80211 [MAC80211]: Set low initial rate in rc80211_simple 2007-07-10 22:16:25 -07:00
netfilter [NETFILTER]: {ip, nf}_conntrack_sctp: fix remotely triggerable NULL ptr dereference (CVE-2007-2876) 2007-07-10 23:24:52 -07:00
netlabel [NetLabel]: consolidate the struct socket/sock handling to just struct sock 2007-06-08 13:33:09 -07:00
netlink [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
netrom [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
packet [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
rfkill [RFKILL]: fix net/rfkill/rfkill-input.c bug on 64-bit systems 2007-07-14 18:50:15 -07:00
rose [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
rxrpc [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
sched [NET_SCHED]: ematch: module autoloading 2007-07-11 19:46:26 -07:00
sctp [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
sunrpc Merge git://git.linux-nfs.org/pub/linux/nfs-2.6 2007-07-13 16:46:18 -07:00
tipc [TIPC]: Optimize stream send routine to avoid fragmentation 2007-07-10 22:06:12 -07:00
unix [AF_UNIX]: Rewrite garbage collector, fixes race. 2007-07-11 14:22:39 -07:00
wanrouter [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
wireless [PATCH] cfg80211: fix signed macaddress in sysfs 2007-06-11 17:47:41 -04:00
x25 [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
xfrm [XFRM] Introduce standalone SAD lookup 2007-07-10 22:16:35 -07:00
compat.c [NET]: Adding SO_TIMESTAMPNS / SCM_TIMESTAMPNS support 2007-04-25 22:24:21 -07:00
Kconfig [S390] Kconfig: no wireless on s390. 2007-05-10 15:46:08 +02:00
Makefile [RXRPC]: Remove Makefile reference to obsolete RXRPC config variable 2007-07-10 22:19:01 -07:00
nonet.c [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
socket.c Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
sysctl_net.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
TUNABLE