linux_dsm_epyc7002/drivers
Gao Feng 1a4a5bf52a driver: vrf: Fix one possible use-after-free issue
The current codes only deal with the case that the skb is dropped, it
may meet one use-after-free issue when NF_HOOK returns 0 that means
the skb is stolen by one netfilter rule or hook.

When one netfilter rule or hook stoles the skb and return NF_STOLEN,
it means the skb is taken by the rule, and other modules should not
touch this skb ever. Maybe the skb is queued or freed directly by the
rule.

Now uses the nf_hook instead of NF_HOOK to get the result of netfilter,
and check the return value of nf_hook. Only when its value equals 1, it
means the skb could go ahead. Or reset the skb as NULL.

BTW, because vrf_rcv_finish is empty function, so needn't invoke it
even though nf_hook returns 1. But we need to modify vrf_rcv_finish
to deal with the NF_STOLEN case.

There are two cases when skb is stolen.
1. The skb is stolen and freed directly.
   There is nothing we need to do, and vrf_rcv_finish isn't invoked.
2. The skb is queued and reinjected again.
   The vrf_rcv_finish would be invoked as okfn, so need to free the
   skb in it.

Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-11 12:13:11 -04:00
..
accessibility
acpi IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
amba
android
ata ARM: SoC driver updates 2017-05-09 10:01:15 -07:00
atm
auxdisplay
base IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
bcma
block treewide: convert PF_MEMALLOC manipulations to new helpers 2017-05-08 17:15:15 -07:00
bluetooth Bluetooth: hci_ldisc: Add protocol check to hci_uart_tx_wakeup() 2017-04-30 12:22:14 +02:00
bus
cdrom
char format-security: move static strings to const 2017-05-08 17:15:14 -07:00
clk ARM: 64-bit DT updates 2017-05-09 10:07:33 -07:00
clocksource Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-05-01 16:15:18 -07:00
connector
cpufreq format-security: move static strings to const 2017-05-08 17:15:14 -07:00
cpuidle Merge branches 'pm-cpuidle', 'pm-core', 'pm-domains', 'pm-avs' and 'pm-devfreq' 2017-04-28 23:15:34 +02:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-05-02 15:53:46 -07:00
dax libnvdimm for 4.12 2017-05-05 18:49:20 -07:00
dca
devfreq
dio
dma dmaengine updates for 4.12-rc1 2017-05-09 15:40:28 -07:00
dma-buf
edac EDAC, ghes: Do not enable it by default 2017-04-27 14:15:38 +02:00
eisa
extcon
firewire
firmware ARM: SoC driver updates 2017-05-09 10:01:15 -07:00
fmc
fpga fpga fr br: update supported version numbers 2017-04-26 11:38:56 +02:00
fsi
gpio char/misc patches for 4.12-rc1 2017-05-04 19:15:35 -07:00
gpu format-security: move static strings to const 2017-05-08 17:15:14 -07:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-05-02 19:09:35 -07:00
hsi HSI: ssi_protocol: double free in ssip_pn_xmit() 2017-04-21 17:58:45 +02:00
hv char/misc patches for 4.12-rc1 2017-05-04 19:15:35 -07:00
hwmon hwmon: (twl4030-madc) drop driver 2017-04-30 11:45:31 -07:00
hwspinlock
hwtracing drivers/hwtracing/intel_th/msu.c: use set_memory.h header 2017-05-08 17:15:14 -07:00
i2c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2017-05-03 12:38:20 -07:00
ide ide: don't call memcpy with the same source and destination 2017-05-08 17:36:39 -04:00
idle
iio Staging/IIO patches for 4.12-rc1 2017-05-05 18:16:23 -07:00
infiniband IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
input char/misc patches for 4.12-rc1 2017-05-04 19:15:35 -07:00
iommu IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
ipack
irqchip irqchip/mbigen: Fix return value check in mbigen_device_probe() 2017-04-30 11:21:16 +02:00
isdn
leds scripts/spelling.txt: add "memory" pattern and fix typos 2017-05-08 17:15:13 -07:00
lguest
lightnvm lightnvm: fix bad back free on error path 2017-05-04 07:53:04 -06:00
macintosh DeviceTree for 4.12: 2017-05-05 19:33:07 -07:00
mailbox mailbox: handle empty message in tx_tick 2017-04-27 16:20:04 +05:30
mcb
md mm, vmalloc: use __GFP_HIGHMEM implicitly 2017-05-08 17:15:13 -07:00
media IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
memory - New Drivers 2017-05-03 12:16:25 -07:00
memstick
message scsi: mpt: Move scsi_remove_host() out of mptscsih_remove_host() 2017-04-24 18:21:17 -04:00
mfd mfd: axp20x: Support AXP803 variant 2017-04-27 11:54:49 +01:00
misc pci-v4.12-changes 2017-05-08 19:03:25 -07:00
mmc MMC core: 2017-05-02 17:34:32 -07:00
mtd mtd: nand: nandsim: convert to memalloc_noreclaim_*() 2017-05-08 17:15:15 -07:00
net driver: vrf: Fix one possible use-after-free issue 2017-05-11 12:13:11 -04:00
nfc
ntb
nubus
nvdimm treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
nvme pci-v4.12-changes 2017-05-08 19:03:25 -07:00
nvmem ARM: SoC driver updates 2017-05-09 10:01:15 -07:00
of IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
oprofile
parisc
parport
pci IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
pcmcia
perf
phy
pinctrl Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-05-02 19:09:35 -07:00
platform char/misc patches for 4.12-rc1 2017-05-04 19:15:35 -07:00
pnp
power ACPI updates for v4.12-rc1 2017-05-01 14:13:28 -07:00
powercap
pps
ps3
ptp Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-05-01 16:15:18 -07:00
pwm
rapidio char/misc patches for 4.12-rc1 2017-05-04 19:15:35 -07:00
ras
regulator Merge remote-tracking branch 'regulator/topic/vctrl' into regulator-next 2017-04-30 22:17:44 +09:00
remoteproc
reset ARM: SoC driver updates 2017-05-09 10:01:15 -07:00
rpmsg
rtc
s390 * ARM: HYP mode stub supports kexec/kdump on 32-bit; improved PMU 2017-05-08 12:37:56 -07:00
sbus
scsi treewide: convert PF_MEMALLOC manipulations to new helpers 2017-05-08 17:15:15 -07:00
sfi
sh
sn
soc IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
spi Merge remote-tracking branches 'spi/topic/ti-qspi' and 'spi/topic/xlp' into spi-next 2017-04-26 15:58:22 +01:00
spmi
ssb
staging drivers/staging/ccree/ssi_hash.c: fix build with gcc-4.4.4 2017-05-08 17:15:16 -07:00
target Merge branch 'for-4.12/block' of git://git.kernel.dk/linux-block 2017-05-01 10:39:57 -07:00
tc
thermal - New Drivers 2017-05-03 12:16:25 -07:00
thunderbolt
tty TTY/Serial patches for 4.12-rc1 2017-05-08 18:49:23 -07:00
uio
usb DeviceTree for 4.12: 2017-05-05 19:33:07 -07:00
uwb
vfio powerpc updates for 4.12 part 1. 2017-05-05 11:36:44 -07:00
vhost mm: support __GFP_REPEAT in kvmalloc_node for >32kB 2017-05-08 17:15:12 -07:00
video drivers/video/fbdev/vermilion/vermilion.c: use set_memory.h header 2017-05-08 17:15:14 -07:00
virt drivers/virt/fsl_hypervisor.c: use get_user_pages_unlocked() 2017-05-08 17:15:10 -07:00
virtio
vlynq
vme
w1
watchdog drivers/watchdog/hpwdt.c: use set_memory.h header 2017-05-08 17:15:14 -07:00
xen Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-05-09 09:12:53 -07:00
zorro
Kconfig
Makefile pci-v4.12-changes 2017-05-08 19:03:25 -07:00