Paolo Abeni
8230819494
ipvlan: use per device spinlock to protect addrs list updates
...
This changeset moves ipvlan address under RCU protection, using
a per ipvlan device spinlock to protect list mutation and RCU
read access to protect list traversal.
Also explicitly use RCU read lock to traverse the per port
ipvlans list, so that we can now perform a full address lookup
without asserting the RTNL lock.
Overall this allows the ipvlan driver to check fully for duplicate
addresses - before this commit ipv6 addresses assigned by autoconf
via prefix delegation where accepted without any check - and avoid
the following rntl assertion failure still in the same code path:
RTNL: assertion failed at drivers/net/ipvlan/ipvlan_core.c (124)
WARNING: CPU: 15 PID: 0 at drivers/net/ipvlan/ipvlan_core.c:124 ipvlan_addr_busy+0x97/0xa0 [ipvlan]
Modules linked in: ipvlan(E) ixgbe
CPU: 15 PID: 0 Comm: swapper/15 Tainted: G E 4.16.0-rc2.ipvlan+ #1782
Hardware name: Dell Inc. PowerEdge R730/072T6D, BIOS 2.1.7 06/16/2016
RIP: 0010:ipvlan_addr_busy+0x97/0xa0 [ipvlan]
RSP: 0018:ffff881ff9e03768 EFLAGS: 00010286
RAX: 0000000000000000 RBX: ffff881fdf2a9000 RCX: 0000000000000000
RDX: 0000000000000001 RSI: 00000000000000f6 RDI: 0000000000000300
RBP: ffff881fdf2a8000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: ffff881ff9e034c0 R12: ffff881fe07bcc00
R13: 0000000000000001 R14: ffffffffa02002b0 R15: 0000000000000001
FS: 0000000000000000(0000) GS:ffff881ff9e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc5c1a4f248 CR3: 000000207e012005 CR4: 00000000001606e0
Call Trace:
<IRQ>
ipvlan_addr6_event+0x6c/0xd0 [ipvlan]
notifier_call_chain+0x49/0x90
atomic_notifier_call_chain+0x6a/0x100
ipv6_add_addr+0x5f9/0x720
addrconf_prefix_rcv_add_addr+0x244/0x3c0
addrconf_prefix_rcv+0x2f3/0x790
ndisc_router_discovery+0x633/0xb70
ndisc_rcv+0x155/0x180
icmpv6_rcv+0x4ac/0x5f0
ip6_input_finish+0x138/0x6a0
ip6_input+0x41/0x1f0
ipv6_rcv+0x4db/0x8d0
__netif_receive_skb_core+0x3d5/0xe40
netif_receive_skb_internal+0x89/0x370
napi_gro_receive+0x14f/0x1e0
ixgbe_clean_rx_irq+0x4ce/0x1020 [ixgbe]
ixgbe_poll+0x31a/0x7a0 [ixgbe]
net_rx_action+0x296/0x4f0
__do_softirq+0xcf/0x4f5
irq_exit+0xf5/0x110
do_IRQ+0x62/0x110
common_interrupt+0x91/0x91
</IRQ>
v1 -> v2: drop unneeded in_softirq check in ipvlan_addr6_validator_event()
Fixes: e9997c2938 ("ipvlan: fix check for IP addresses in control path")
Signed-off-by: Paolo Abeni <[email protected] >
Signed-off-by: David S. Miller <[email protected] >
2018-02-28 12:20:13 -05:00
..
accessibility
acpi
Merge branches 'acpi-ec', 'acpi-tables' and 'acpi-doc'
2018-02-15 12:02:42 +01:00
amba
android
ANDROID: binder: synchronize_rcu() when using POLLFREE.
2018-02-16 11:16:38 +01:00
ata
pci-v4.16-changes
2018-02-06 09:59:40 -08:00
atm
atm: idt77252: remove redundant bit-wise or'ing of zero
2018-02-23 12:42:26 -05:00
auxdisplay
base
ACPI updates for v4.16-rc2
2018-02-15 14:50:32 -08:00
bcma
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2018-01-19 22:59:33 -05:00
block
Things have been very quiet on the rbd side, as work continues on the
2018-02-08 11:38:59 -08:00
bluetooth
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
2018-02-15 15:43:49 -05:00
bus
ARM: SoC driver updates for 4.16
2018-02-01 16:35:31 -08:00
cdrom
char
Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2018-02-14 17:02:15 -08:00
clk
MIPS changes for 4.16
2018-02-07 11:22:44 -08:00
clocksource
connector
cpufreq
Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2018-02-14 17:02:15 -08:00
cpuidle
powerpc updates for 4.16
2018-02-02 10:01:04 -08:00
crypto
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
2018-02-22 16:38:10 -08:00
dax
Merge branch 'for-4.16/dax' into libnvdimm-for-next
2018-02-03 00:26:10 -07:00
dca
devfreq
dio
dma
Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
2018-02-02 09:50:51 -08:00
dma-buf
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
edac
Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2018-02-14 17:02:15 -08:00
eisa
EISA: Delete error message for a failed memory allocation in eisa_probe()
2018-01-23 09:04:10 +01:00
extcon
extcon: int3496: process id-pin first so that we start with the right status
2018-02-14 06:37:33 +09:00
firewire
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
firmware
2nd set of arm64 updates for 4.16:
2018-02-08 10:44:25 -08:00
fmc
fpga
fsi
gpio
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
gpu
drm/imx: ipu-v3 fixups and grayscale support
2018-02-23 11:11:57 +10:00
hid
usb: ldusb: add PIDs for new CASSY devices supported by this driver
2018-02-15 18:44:03 +01:00
hsi
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
hv
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
hwmon
Fix bad temperature display on Ryzen/Threadripper
2018-02-15 14:31:28 -08:00
hwspinlock
hwtracing
Char/Misc driver patches for 4.16-rc1
2018-02-01 10:31:17 -08:00
i2c
i2c: designware: Consider SCL GPIO optional
2018-02-22 12:15:35 +01:00
ide
pci-v4.16-changes
2018-02-06 09:59:40 -08:00
idle
iio
First round of IIO fixes for the 4.16 cycle.
2018-02-20 10:03:22 +01:00
infiniband
mlx5-update-2018-02-23 (IB representors)
2018-02-28 09:54:54 -05:00
input
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
iommu
IOMMU Updates for Linux v4.16
2018-02-08 12:03:54 -08:00
ipack
irqchip
irqchip/bcm: Remove hashed address printing
2018-02-16 14:22:16 +00:00
isdn
net: make getname() functions return length rather than use int* parameter
2018-02-12 14:15:04 -05:00
leds
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
lightnvm
macintosh
powerpc/macio: set a proper dma_coherent_mask
2018-02-13 08:58:53 -08:00
mailbox
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
mcb
md
dm: correctly handle chained bios in dec_pending()
2018-02-16 10:46:35 -05:00
media
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
memory
ARM: SoC driver updates for 4.16
2018-02-01 16:35:31 -08:00
memstick
message
scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo()
2018-01-30 21:32:06 -05:00
mfd
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
misc
Char/Misc driver fixes for 4.16-rc3
2018-02-22 12:04:05 -08:00
mmc
mmc: bcm2835: Don't overwrite max frequency unconditionally
2018-02-14 11:30:10 +01:00
mtd
mtd: nand: MTD_NAND_MARVELL should depend on HAS_DMA
2018-02-12 10:57:20 +01:00
mux
Char/Misc driver patches for 4.16-rc1
2018-02-01 10:31:17 -08:00
net
ipvlan: use per device spinlock to protect addrs list updates
2018-02-28 12:20:13 -05:00
nfc
ntb
NTB: ntb_perf: fix cast to restricted __le32
2018-01-28 22:17:24 -05:00
nubus
nubus: Add support for the driver model
2018-01-16 16:47:29 +01:00
nvdimm
Merge branch 'for-4.16/nfit' into libnvdimm-for-next
2018-02-03 00:26:26 -07:00
nvme
nvme-rdma: fix sysfs invoked reset_ctrl error flow
2018-02-14 15:44:22 +02:00
nvmem
of
device property: Constify device_get_match_data()
2018-02-12 10:41:11 +01:00
opp
opp: cpu: Replace GFP_ATOMIC with GFP_KERNEL in dev_pm_opp_init_cpufreq_table
2018-02-12 15:07:46 +05:30
oprofile
parisc
parport
pci
PCI/cxgb4: Extend T3 PCI quirk to T4+ devices
2018-02-16 15:41:53 -05:00
pcmcia
Merge branch 'pcmcia' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia
2018-02-08 11:48:49 -08:00
perf
arm_pmu: acpi: request IRQs up-front
2018-02-20 11:34:54 +00:00
phy
USB/PHY updates for 4.16-rc1
2018-02-01 09:40:49 -08:00
pinctrl
This is the bulk of pin control changes for the v4.16 kernel cycle:
2018-02-02 14:22:53 -08:00
platform
platform/x86: dell-laptop: Removed duplicates in DMI whitelist
2018-02-15 12:18:33 +02:00
pnp
power
power supply and reset changes for the v4.16 series
2018-01-31 12:55:31 -08:00
powercap
powercap: intel_rapl: Fix trailing semicolon
2018-01-17 12:56:24 +01:00
pps
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
ps3
ptp
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
pwm
rapidio
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
ras
mm/memory_failure: Remove unused trapno from memory_failure
2018-01-23 12:17:42 -06:00
regulator
regulator: Fix suspend to idle
2018-01-30 12:25:59 +00:00
remoteproc
remoteproc updates for v4.16
2018-02-05 10:07:40 -08:00
reset
rpmsg
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
rtc
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
s390
virtio: bugfixes
2018-02-15 14:29:27 -08:00
sbus
pci-v4.16-changes
2018-02-06 09:59:40 -08:00
scsi
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2018-02-24 00:04:20 -05:00
sfi
sh
cpufreq: Add and use cpufreq_for_each_{valid_,}entry_idx()
2018-02-08 10:21:39 +01:00
siox
slimbus
sn
soc
net: make getname() functions return length rather than use int* parameter
2018-02-12 14:15:04 -05:00
soundwire
soundwire: Fix a signedness bug
2018-01-22 16:45:26 +01:00
spi
Merge remote-tracking branch 'spi/topic/xilinx' into spi-next
2018-01-26 17:57:34 +00:00
spmi
ssb
Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git
2018-02-01 10:37:39 +02:00
staging
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2018-02-24 00:04:20 -05:00
target
net: make getname() functions return length rather than use int* parameter
2018-02-12 14:15:04 -05:00
tc
tee
thermal
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
2018-02-06 15:04:58 -08:00
thunderbolt
tty
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
uio
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
usb
USB fixes for 4.16-rc3
2018-02-22 12:13:01 -08:00
uwb
vfio
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
vhost
net: make getname() functions return length rather than use int* parameter
2018-02-12 14:15:04 -05:00
video
Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2018-02-14 17:02:15 -08:00
virt
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
virtio
virtio_pci: don't kfree device on register failure
2018-02-01 16:26:45 +02:00
visorbus
vlynq
vme
w1
Documentation updates for 4.16. New stuff includes refcount_t
2018-01-31 19:25:25 -08:00
watchdog
linux-watchdog 4.16-rc1 merge window tag
2018-02-07 11:54:34 -08:00
xen
mm, swap, frontswap: fix THP swap if frontswap enabled
2018-02-21 15:35:43 -08:00
zorro
Kconfig
Char/Misc driver patches for 4.16-rc1
2018-02-01 10:31:17 -08:00
Makefile
pci-v4.16-changes
2018-02-06 09:59:40 -08:00