linux-stable/drivers
Nikolay Aleksandrov 4f5474e7fd bonding: fix igmp_retrans type and two related races
First the type of igmp_retrans (which is the actual counter of
igmp_resend parameter) is changed to u8 to be able to store values up
to 255 (as per documentation). There are two races that were hidden
there and which are easy to trigger after the previous fix, the first is
between bond_resend_igmp_join_requests and bond_change_active_slave
where igmp_retrans is set and can be altered by the periodic. The second
race condition is between multiple running instances of the periodic
(upon execution it can be scheduled again for immediate execution which
can cause the counter to go < 0 which in the unsigned case leads to
unnecessary igmp retransmissions).
Since in bond_change_active_slave bond->lock is held for reading and
curr_slave_lock for writing, we use curr_slave_lock for mutual
exclusion. We can't drop them as there're cases where RTNL is not held
when bond_change_active_slave is called. RCU is unlocked in
bond_resend_igmp_join_requests before getting curr_slave_lock since we
don't need it there and it's pointless to delay.
The decrement is moved inside the "if" block because if we decrement
unconditionally there's still a possibility for a race condition although
it is much more difficult to hit (many changes have to happen in
a very short period in order to trigger) which in the case of 3 parallel
running instances of this function and igmp_retrans == 1
(with check bond->igmp_retrans-- > 1) is:
f1 passes, doesn't re-schedule, but decrements - igmp_retrans = 0
f2 then passes, doesn't re-schedule, but decrements - igmp_retrans = 255
f3 does the unnecessary retransmissions.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-06-13 02:33:37 -07:00
..
accessibility
acpi Revert "ACPI / scan: do not match drivers against objects having scan handlers" 2013-06-07 18:33:12 -07:00
amba
ata Merge branch 'for-3.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2013-06-03 17:55:09 +09:00
atm
auxdisplay
base Merge remote-tracking branch 'regmap/fix/debugfs' into regmap-linus 2013-06-03 18:07:38 +01:00
bcma bcma: add more core IDs 2013-05-17 14:31:05 -04:00
block Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2013-06-12 16:42:39 -07:00
bluetooth Bluetooth: btmrvl: support Marvell Bluetooth device SD8897 2013-06-12 10:20:54 -04:00
bus
cdrom block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
char random: fix accounting race condition with lockless irq entropy_count update 2013-05-24 16:22:52 -07:00
clk clk: mxs: Include clk mxs header file 2013-05-30 18:27:24 -07:00
clocksource ARM: late Exynos multiplatform changes 2013-05-07 11:28:42 -07:00
connector
cpufreq cpufreq: cpufreq-cpu0: use the exact frequency for clk_set_rate() 2013-06-05 13:51:29 +02:00
cpuidle
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2013-06-10 13:25:50 -07:00
dca
devfreq
dio
dma dmatest: do not allow to interrupt ongoing tests 2013-06-08 02:13:44 +05:30
edac amd64_edac: Fix bogus sysfs file permissions 2013-05-21 09:13:11 +02:00
eisa
extcon Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
firewire IEEE 1394 (FireWire) subsystem changes: 2013-05-09 10:11:48 -07:00
firmware efivar: fix oops in efivar_update_sysfs_entries() caused by memory reuse 2013-05-13 20:20:02 +01:00
gpio GPIO fixes for the v3.10 series: 2013-05-23 18:24:10 -07:00
gpu Merge tag 'drm-intel-fixes-2013-06-11' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes 2013-06-11 19:38:27 +10:00
hid HID: multitouch: prevent memleak with the allocated name 2013-06-12 11:13:38 +02:00
hsi
hv Drivers: hv: Fix a bug in get_vp_index() 2013-05-21 09:56:55 -07:00
hwmon hwmon: (adm1021) Strengthen chip detection for ADM1021, LM84 and MAX1617 2013-06-07 12:29:31 -07:00
hwspinlock A single patch from Vincent extending OMAP's hwspinlock support to OMAP5. 2013-05-07 14:01:27 -07:00
i2c Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2013-05-21 11:11:45 -07:00
ide block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
idle Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2013-05-11 15:23:17 -07:00
iio iio:inkern: Fix typo/bug in convert raw to processed. 2013-06-04 18:46:45 +01:00
infiniband Merge branches 'iser' and 'qib' into for-next 2013-06-04 17:06:46 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2013-06-05 09:11:06 +09:00
iommu IOMMU Updates for Linux v3.10 2013-05-06 14:59:13 -07:00
ipack
irqchip irqdomain bug fixes for v3.10-rc4 2013-06-08 15:50:42 -07:00
isdn isdn/kcapi: fix a small underflow 2013-05-20 13:38:14 -07:00
leds drivers/leds/leds-ot200.c: fix error caused by shifted mask 2013-05-24 16:22:51 -07:00
lguest lguest: clear cached last cpu when guest_set_pgd() called. 2013-05-08 10:49:18 +09:30
macintosh Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-05-02 10:16:16 -07:00
mailbox
md Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2013-06-12 16:42:39 -07:00
media fbdev: fixes for 3.10-rc4 2013-06-01 19:53:41 +09:00
memory drivers/memory: don't check resource with devm_ioremap_resource 2013-05-18 11:55:52 +02:00
memstick block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
message Merge branch 'for-3.10/core' of git://git.kernel.dk/linux-block 2013-05-08 10:13:35 -07:00
mfd This is the first batch of MFD fixes for 3.10. 2013-05-22 07:18:41 -07:00
misc drivers/misc/sgi-gru/grufile.c: fix info leak in gru_get_config_info() 2013-06-12 16:29:46 -07:00
mmc mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case 2013-05-26 14:23:11 -04:00
mtd drivers/mtd/nand: don't check resource with devm_ioremap_resource 2013-05-18 11:55:55 +02:00
net bonding: fix igmp_retrans type and two related races 2013-06-13 02:33:37 -07:00
nfc NFC: mei: Do not disable MEI devices from their remove routine 2013-05-21 10:48:41 +02:00
ntb NTB: Multiple NTB client fix 2013-05-15 10:58:22 -07:00
nubus nubus: Kill nubus_proc_detach_device() 2013-05-04 14:47:26 -04:00
of Device tree bug fixes and documentation updates for v3.10 2013-05-18 10:46:50 -07:00
oprofile
parisc parisc/PCI: lba: fix: convert to pci_create_root_bus() for correct root bus resources (v2) 2013-06-01 14:44:25 +02:00
parport parisc: parport0: fix this legacy no-device port driver! 2013-06-01 14:46:42 +02:00
pci aerdrv: Move cper_print_aer() call out of interrupt context 2013-05-30 10:51:20 -07:00
pcmcia
pinctrl Renesas ARM based SoC fixes for v3.10 2013-06-07 18:11:02 -07:00
platform x86 / platform / hp_wmi: Fix bluetooth_rfkill misuse in hp_wmi_rfkill_setup() 2013-06-01 23:51:48 +02:00
pnp Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-05-02 10:16:16 -07:00
power Last minute one-liners: wrong kfree usage fix, module alias fixup and 2013-05-25 20:32:49 -07:00
pps
ps3
ptp ptp_pch: fix error handling in pch_probe() 2013-05-25 21:24:15 -07:00
pwm drivers/pwm: don't check resource with devm_ioremap_resource 2013-05-18 11:55:58 +02:00
rapidio rapidio/tsi721: fix bug in MSI interrupt handling 2013-05-24 16:22:51 -07:00
regulator Merge remote-tracking branch 'regulator/fix/palmas' into regulator-linus 2013-05-30 11:58:40 +01:00
remoteproc This pull request contains: 2013-05-07 14:04:56 -07:00
reset
rpmsg A small pull request consisting of: 2013-05-07 14:02:00 -07:00
rtc rtc-at91rm9200: use shadow IMR on at91sam9x5 2013-06-12 16:29:46 -07:00
s390 s390/dasd: fix handling of gone paths 2013-05-31 17:23:49 +02:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-06-01 20:05:20 +09:00
sfi
sh
sn
spi Merge remote-tracking branch 'spi/fix/xilinx' into spi-linus 2013-06-04 18:52:05 +01:00
ssb - Lots of cleanups from Artem, including deletion of some obsolete drivers 2013-05-09 10:15:46 -07:00
ssbi
staging Staging driver fixes for 3.10-rc5 2013-06-06 16:34:11 -07:00
target iscsi-target: Fix iscsit_free_cmd() se_cmd->cmd_kref shutdown handling 2013-05-31 01:21:28 -07:00
tc
thermal drivers/thermal: don't check resource with devm_ioremap_resource 2013-05-18 11:57:30 +02:00
tty Revert "serial: 8250: Make SERIAL_8250_RUNTIME_UARTS work correctly" 2013-06-03 10:08:28 -07:00
uio uio: UIO_DMEM_GENIRQ should depend on HAS_DMA 2013-05-21 10:13:23 -07:00
usb USB: option,zte_ev: move most ZTE CDMA devices to zte_ev 2013-06-06 09:06:25 -07:00
uwb
vfio vfio: fix crash on rmmod 2013-06-05 08:54:16 -06:00
vhost vhost: fix ubuf_info cleanup 2013-06-11 02:46:21 -07:00
video atmel_lcdfb: blank the backlight on remove 2013-06-01 03:18:55 +08:00
virt
virtio
vlynq
vme
w1 drivers/w1/masters: don't check resource with devm_ioremap_resource 2013-05-18 11:58:03 +02:00
watchdog drivers/watchdog: don't check resource with devm_ioremap_resource 2013-05-18 11:58:04 +02:00
xen xen/tmem: Don't over-write tmem_frontswap_poolid after tmem_frontswap_init set it. 2013-06-10 10:14:33 -04:00
zorro
Kconfig ARM: arm-soc driver changes for 3.10 2013-05-04 12:31:18 -07:00
Makefile ARM: arm-soc driver changes for 3.10 2013-05-04 12:31:18 -07:00