https://github.com/torvalds/linux
Revision 3fb07daff8e99243366a081e5129560734de4ada authored by Eric Dumazet on 25 May 2017, 21:27:35 UTC, committed by David S. Miller on 26 May 2017, 18:57:07 UTC
Andrey Konovalov reported crashes in ipv4_mtu()

I could reproduce the issue with KASAN kernels, between
10.246.7.151 and 10.246.7.152 :

1) 20 concurrent netperf -t TCP_RR -H 10.246.7.152 -l 1000 &

2) At the same time run following loop :
while :
do
 ip ro add 10.246.7.152 dev eth0 src 10.246.7.151 mtu 1500
 ip ro del 10.246.7.152 dev eth0 src 10.246.7.151 mtu 1500
done

Cong Wang attempted to add back rt->fi in commit
82486aa6f1b9 ("ipv4: restore rt->fi for reference counting")
but this proved to add some issues that were complex to solve.

Instead, I suggested to add a refcount to the metrics themselves,
being a standalone object (in particular, no reference to other objects)

I tried to make this patch as small as possible to ease its backport,
instead of being super clean. Note that we believe that only ipv4 dst
need to take care of the metric refcount. But if this is wrong,
this patch adds the basic infrastructure to extend this to other
families.

Many thanks to Julian Anastasov for reviewing this patch, and Cong Wang
for his efforts on this problem.

Fixes: 2860583fe840 ("ipv4: Kill rt->fi")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 82533ad
History
Tip revision: 3fb07daff8e99243366a081e5129560734de4ada authored by Eric Dumazet on 25 May 2017, 21:27:35 UTC
ipv4: add reference counting to metrics
Tip revision: 3fb07da
File Mode Size
ABI
DocBook
EDID
PCI
RCU
accounting
acpi
admin-guide
aoe
arm
arm64
auxdisplay
backlight
blackfin
block
blockdev
bus-devices
cdrom
cgroup-v1
cma
connector
console
core-api
cpu-freq
cpuidle
cris
crypto
dev-tools
device-mapper
devicetree
dmaengine
doc-guide
driver-api
driver-model
early-userspace
extcon
fault-injection
fb
features
filesystems
firmware_class
fmc
fpga
frv
gpio
gpu
hid
hwmon
i2c
ia64
ide
iio
infiniband
input
ioctl
isdn
kbuild
kdump
laptops
leds
lightnvm
livepatch
locking
m68k
md
media
memory-devices
metag
mic
mips
misc-devices
mmc
mn10300
mtd
namespaces
netlabel
networking
nfc
nios2
nvdimm
nvmem
parisc
pcmcia
perf
phy
platform
power
powerpc
pps
prctl
process
pti
ptp
rapidio
s390
scheduler
scsi
security
serial
sh
sound
sparc
sphinx
sphinx-static
spi
sysctl
target
thermal
timers
trace
translations
usb
userspace-api
virtual
vm
w1
watchdog
wimax
x86
xtensa
.gitignore -rw-r--r-- 13 bytes
00-INDEX -rw-r--r-- 15.1 KB
Changes l--------- 19 bytes
CodingStyle -rw-r--r-- 48 bytes
DMA-API-HOWTO.txt -rw-r--r-- 34.6 KB
DMA-API.txt -rw-r--r-- 27.8 KB
DMA-ISA-LPC.txt -rw-r--r-- 5.2 KB
DMA-attributes.txt -rw-r--r-- 6.9 KB
IPMI.txt -rw-r--r-- 29.4 KB
IRQ-affinity.txt -rw-r--r-- 2.5 KB
IRQ-domain.txt -rw-r--r-- 10.6 KB
IRQ.txt -rw-r--r-- 962 bytes
Intel-IOMMU.txt -rw-r--r-- 3.8 KB
Makefile -rw-r--r-- 12 bytes
Makefile.sphinx -rw-r--r-- 4.4 KB
SAK.txt -rw-r--r-- 2.8 KB
SM501.txt -rw-r--r-- 2.8 KB
SubmittingPatches -rw-r--r-- 54 bytes
bcache.txt -rw-r--r-- 23.4 KB
bt8xxgpio.txt -rw-r--r-- 4.3 KB
btmrvl.txt -rw-r--r-- 2.9 KB
bus-virt-phys-mapping.txt -rw-r--r-- 7.9 KB
cachetlb.txt -rw-r--r-- 17.1 KB
cgroup-v2.txt -rw-r--r-- 59.5 KB
circular-buffers.txt -rw-r--r-- 8.4 KB
clk.txt -rw-r--r-- 10.4 KB
conf.py -rw-r--r-- 17.1 KB
cpu-load.txt -rw-r--r-- 3.0 KB
cputopology.txt -rw-r--r-- 5.3 KB
crc32.txt -rw-r--r-- 8.5 KB
dcdbas.txt -rw-r--r-- 3.6 KB
debugging-modules.txt -rw-r--r-- 954 bytes
debugging-via-ohci1394.txt -rw-r--r-- 7.4 KB
dell_rbu.txt -rw-r--r-- 4.9 KB
digsig.txt -rw-r--r-- 2.8 KB
docutils.conf -rw-r--r-- 158 bytes
dontdiff -rw-r--r-- 2.5 KB
efi-stub.txt -rw-r--r-- 3.2 KB
eisa.txt -rw-r--r-- 7.1 KB
flexible-arrays.txt -rw-r--r-- 5.5 KB
futex-requeue-pi.txt -rw-r--r-- 5.0 KB
gcc-plugins.txt -rw-r--r-- 2.9 KB
highuid.txt -rw-r--r-- 2.4 KB
hw_random.txt -rw-r--r-- 3.5 KB
hwspinlock.txt -rw-r--r-- 12.7 KB
index.rst -rw-r--r-- 2.5 KB
intel_txt.txt -rw-r--r-- 10.2 KB
io-mapping.txt -rw-r--r-- 3.2 KB
io_ordering.txt -rw-r--r-- 1.9 KB
iostats.txt -rw-r--r-- 8.0 KB
irqflags-tracing.txt -rw-r--r-- 2.3 KB
isa.txt -rw-r--r-- 5.2 KB
isapnp.txt -rw-r--r-- 433 bytes
kernel-doc-nano-HOWTO.txt -rw-r--r-- 11.8 KB
kernel-per-CPU-kthreads.txt -rw-r--r-- 13.2 KB
kobject.txt -rw-r--r-- 18.0 KB
kprobes.txt -rw-r--r-- 30.8 KB
kref.txt -rw-r--r-- 8.4 KB
kselftest.txt -rw-r--r-- 3.2 KB
ldm.txt -rw-r--r-- 3.8 KB
lockup-watchdogs.txt -rw-r--r-- 4.1 KB
logo.gif -rw-r--r-- 16.0 KB
logo.txt -rw-r--r-- 563 bytes
lzo.txt -rw-r--r-- 7.8 KB
mailbox.txt -rw-r--r-- 4.1 KB
memory-barriers.txt -rw-r--r-- 115.9 KB
memory-hotplug.txt -rw-r--r-- 18.0 KB
men-chameleon-bus.txt -rw-r--r-- 6.1 KB
nommu-mmap.txt -rw-r--r-- 12.7 KB
ntb.txt -rw-r--r-- 6.3 KB
numastat.txt -rw-r--r-- 836 bytes
padata.txt -rw-r--r-- 7.3 KB
parport-lowlevel.txt -rw-r--r-- 32.2 KB
percpu-rw-semaphore.txt -rw-r--r-- 1.1 KB
phy.txt -rw-r--r-- 7.5 KB
pi-futex.txt -rw-r--r-- 5.7 KB
pinctrl.txt -rw-r--r-- 50.4 KB
pnp.txt -rw-r--r-- 6.8 KB
preempt-locking.txt -rw-r--r-- 5.2 KB
printk-formats.txt -rw-r--r-- 10.3 KB
pwm.txt -rw-r--r-- 6.1 KB
rbtree.txt -rw-r--r-- 13.3 KB
remoteproc.txt -rw-r--r-- 12.7 KB
rfkill.txt -rw-r--r-- 5.0 KB
robust-futex-ABI.txt -rw-r--r-- 8.7 KB
robust-futexes.txt -rw-r--r-- 9.4 KB
rpmsg.txt -rw-r--r-- 13.3 KB
rtc.txt -rw-r--r-- 10.3 KB
sgi-ioc4.txt -rw-r--r-- 2.0 KB
siphash.txt -rw-r--r-- 6.1 KB
smsc_ece1099.txt -rw-r--r-- 2.4 KB
static-keys.txt -rw-r--r-- 11.8 KB
svga.txt -rw-r--r-- 14.1 KB
switchtec.txt -rw-r--r-- 3.1 KB
sync_file.txt -rw-r--r-- 3.1 KB
tee.txt -rw-r--r-- 5.1 KB
this_cpu_ops.txt -rw-r--r-- 11.1 KB
unaligned-memory-access.txt -rw-r--r-- 10.4 KB
vfio-mediated-device.txt -rw-r--r-- 14.1 KB
vfio.txt -rw-r--r-- 21.3 KB
video-output.txt -rw-r--r-- 1.1 KB
xillybus.txt -rw-r--r-- 17.7 KB
xz.txt -rw-r--r-- 5.7 KB
zorro.txt -rw-r--r-- 2.9 KB

back to top