android_kernel_oneplus_msm8998/drivers
Ido Schimmel 7e7a271035 team: Free BPF filter when unregistering netdev
[ Upstream commit 692c31bd4054212312396b1d303bffab2c5b93a7 ]

When team is used in loadbalance mode a BPF filter can be used to
provide a hash which will determine the Tx port.

When the netdev is later unregistered the filter is not freed which
results in memory leaks [1].

Fix by freeing the program and the corresponding filter when
unregistering the netdev.

[1]
unreferenced object 0xffff8881dbc47cc8 (size 16):
  comm "teamd", pid 3068, jiffies 4294997779 (age 438.247s)
  hex dump (first 16 bytes):
    a3 00 6b 6b 6b 6b 6b 6b 88 a5 82 e1 81 88 ff ff  ..kkkkkk........
  backtrace:
    [<000000008a3b47e3>] team_nl_cmd_options_set+0x88f/0x11b0
    [<00000000c4f4f27e>] genl_family_rcv_msg+0x78f/0x1080
    [<00000000610ef838>] genl_rcv_msg+0xca/0x170
    [<00000000a281df93>] netlink_rcv_skb+0x132/0x380
    [<000000004d9448a2>] genl_rcv+0x29/0x40
    [<000000000321b2f4>] netlink_unicast+0x4c0/0x690
    [<000000008c25dffb>] netlink_sendmsg+0x929/0xe10
    [<00000000068298c5>] sock_sendmsg+0xc8/0x110
    [<0000000082a61ff0>] ___sys_sendmsg+0x77a/0x8f0
    [<00000000663ae29d>] __sys_sendmsg+0xf7/0x250
    [<0000000027c5f11a>] do_syscall_64+0x14d/0x610
    [<000000006cfbc8d3>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
    [<00000000e23197e2>] 0xffffffffffffffff
unreferenced object 0xffff8881e182a588 (size 2048):
  comm "teamd", pid 3068, jiffies 4294997780 (age 438.247s)
  hex dump (first 32 bytes):
    20 00 00 00 02 00 00 00 30 00 00 00 28 f0 ff ff   .......0...(...
    07 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00  ........(.......
  backtrace:
    [<000000002daf01fb>] lb_bpf_func_set+0x45c/0x6d0
    [<000000008a3b47e3>] team_nl_cmd_options_set+0x88f/0x11b0
    [<00000000c4f4f27e>] genl_family_rcv_msg+0x78f/0x1080
    [<00000000610ef838>] genl_rcv_msg+0xca/0x170
    [<00000000a281df93>] netlink_rcv_skb+0x132/0x380
    [<000000004d9448a2>] genl_rcv+0x29/0x40
    [<000000000321b2f4>] netlink_unicast+0x4c0/0x690
    [<000000008c25dffb>] netlink_sendmsg+0x929/0xe10
    [<00000000068298c5>] sock_sendmsg+0xc8/0x110
    [<0000000082a61ff0>] ___sys_sendmsg+0x77a/0x8f0
    [<00000000663ae29d>] __sys_sendmsg+0xf7/0x250
    [<0000000027c5f11a>] do_syscall_64+0x14d/0x610
    [<000000006cfbc8d3>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
    [<00000000e23197e2>] 0xffffffffffffffff

Fixes: 01d7f30a9f ("team: add loadbalance mode")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Amit Cohen <amitc@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-23 08:44:22 +01:00
..
accessibility
acpi ACPI: power: Skip duplicate power resource references in _PRx 2019-01-16 22:16:12 +01:00
amba ARM: amba: Don't read past the end of sysfs "driver_override" buffer 2018-05-02 07:53:42 -07:00
android binder: add missing binder_unlock() 2018-02-28 10:17:23 +01:00
ata sata_rcar: fix deferred probing 2019-02-20 10:13:08 +01:00
atm atm: he: fix sign-extension overflow on large shift 2019-03-23 08:44:16 +01:00
auxdisplay
base drivers: core: Remove glue dirs from sysfs earlier 2019-02-06 19:43:08 +01:00
bcma
block block/swim3: Fix -EBUSY error when re-opening device after unmount 2019-02-20 10:13:13 +01:00
bluetooth Revert "Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV" 2018-11-27 16:08:01 +01:00
bus bus: brcmstb_gisb: correct support for 64-bit address output 2018-04-13 19:50:05 +02:00
cdrom gdrom: fix a memory leak bug 2019-02-20 10:13:13 +01:00
char char/mwave: fix potential Spectre v1 vulnerability 2019-02-06 19:43:04 +01:00
clk clk: imx6sl: ensure MMDC CH0 handshake is bypassed 2019-02-20 10:13:08 +01:00
clocksource clockevents/drivers/i8253: Add support for PIT shutdown quirk 2018-11-21 09:27:42 +01:00
connector
cpufreq cpufreq: Use struct kobj_attribute instead of struct global_attr 2019-03-23 08:44:21 +01:00
cpuidle cpuidle: big.LITTLE: fix refcount leak 2019-02-20 10:13:09 +01:00
crypto crypto: ux500 - Use proper enum in hash_set_dma_transfer 2019-02-20 10:13:12 +01:00
dca
devfreq PM / devfreq: tegra: fix error return code in tegra_devfreq_probe() 2018-11-10 07:41:40 -08:00
dio
dma dmaengine: imx-dma: fix wrong callback invoke 2019-02-20 10:13:16 +01:00
dma-buf
edac EDAC, i7core: Fix memleaks and use-after-free on probe and remove 2018-10-10 08:52:06 +02:00
eisa
extcon extcon: palmas: Check the parent instance to prevent the NULL 2017-11-21 09:21:18 +01:00
firewire firewire-ohci: work around oversized DMA reads on JMicron controllers 2018-05-30 07:48:52 +02:00
firmware x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls 2019-02-20 10:13:23 +01:00
fmc
fpga
gpio gpio: max7301: fix driver for use with CONFIG_VMAP_STACK 2019-01-13 10:05:27 +01:00
gpu drm/msm: Unblock writer if reader closes file 2019-03-23 08:44:18 +01:00
hid HID: debug: fix the ring buffer implementation 2019-02-20 10:13:19 +01:00
hsi HSI: ssi_protocol: double free in ssip_pn_xmit() 2018-03-24 10:58:42 +01:00
hv Drivers: hv: vmbus: Return -EINVAL for the sys files for unopened channels 2019-01-13 10:05:27 +01:00
hwmon hwmon: (lm80) Fix missing unlock on error in set_fan_div() 2019-02-23 09:05:13 +01:00
hwspinlock
hwtracing intel_th: msu: Fix an off-by-one in attribute store 2019-01-13 10:05:33 +01:00
i2c i2c-axxia: check for error conditions first 2019-02-20 10:13:09 +01:00
ide ide: pmac: add of_node_put() 2018-12-21 14:09:52 +01:00
idle idle: i7300: add PCI dependency 2018-02-25 11:03:51 +01:00
iio iio: adc: at91: fix wrong channel number in triggered buffer mode 2018-11-21 09:27:35 +01:00
infiniband RDMA/srp: Rework SCSI device reset handling 2019-03-23 08:44:17 +01:00
input Input: elantech - enable 3rd button support on Fujitsu CELSIUS H780 2019-02-20 10:13:22 +01:00
iommu iommu/arm-smmu-v3: Use explicit mb() when moving cons pointer 2019-02-20 10:13:08 +01:00
ipack
irqchip irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size 2019-02-06 19:43:05 +01:00
isdn isdn: isdn_tty: fix build warning of strncpy 2019-03-23 08:44:22 +01:00
leds leds: lp5523: fix a missing check of return value of lp55xx_read 2019-03-23 08:44:17 +01:00
lguest
lightnvm
macintosh macintosh/via-pmu: Add missing mmio accessors 2018-09-19 22:48:57 +02:00
mailbox
mcb
md dm thin: fix bug where bio that overwrites thin block ignores FUA 2019-02-20 10:13:23 +01:00
media media: DaVinci-VPBE: fix error handling in vpbe_initialize() 2019-02-20 10:13:07 +01:00
memory memory: tegra: Apply interrupts mask per SoC 2018-08-06 16:24:38 +02:00
memstick memstick: Prevent memstick host from getting runtime suspended during card detection 2019-02-20 10:13:09 +01:00
message scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo() 2018-05-30 07:48:58 +02:00
mfd mfd: mc13xxx: Fix a missing check of a register-read failure 2019-03-23 08:44:16 +01:00
misc misc: vexpress: Off by one in vexpress_syscfg_exec() 2019-02-20 10:13:18 +01:00
mmc mmc: spi: Fix card detection during probe 2019-03-23 08:44:21 +01:00
mtd mtd: rawnand: gpmi: fix MX28 bus master lockup problem 2019-02-20 10:13:17 +01:00
net team: Free BPF filter when unregistering netdev 2019-03-23 08:44:22 +01:00
nfc NFC: nxp-nci: Include unaligned.h instead of access_ok.h 2019-02-20 10:13:20 +01:00
ntb ntb_transport: Fix bug with max_mw_size parameter 2018-05-30 07:48:55 +02:00
nubus
nvdimm libnvdimm: Hold reference on parent while scheduling async init 2018-11-21 09:27:34 +01:00
nvme nvme-pci: initialize queue memory before interrupts 2018-07-11 16:03:47 +02:00
nvmem
of of: add helper to lookup compatible child node 2018-12-01 09:46:35 +01:00
oprofile
parisc parisc/pci: Switch LBA PCI bus from Hard Fail to Soft Fail mode 2018-05-30 07:49:10 +02:00
parport parport: sunbpp: fix error return code 2018-09-26 08:35:09 +02:00
pci PCI: altera: Move retrain from fixup to altera_pcie_host_init() 2019-01-16 22:16:11 +01:00
pcmcia pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges 2018-11-21 09:27:30 +01:00
perf drivers/perf: arm_pmu: handle no platform_device 2018-03-22 09:23:26 +01:00
phy phy: work around 'phys' references to usb-nop-xceiv devices 2018-01-23 19:50:16 +01:00
pinctrl pinctrl: msm: fix gpio-hog related boot issues 2019-02-20 10:13:24 +01:00
platform platform/x86: asus-nb-wmi: Drop mapping of 0x33 and 0x34 scan codes 2019-02-06 19:43:07 +01:00
pnp
power power: supply: olpc_battery: correct the temperature units 2019-01-13 10:05:34 +01:00
powercap PowerCap: Fix an error code in powercap_register_zone() 2018-04-13 19:50:05 +02:00
pps
ps3
ptp ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl 2019-02-20 10:13:05 +01:00
pwm pwm: tiehrpwm: Fix disabling of output of PWMs 2018-09-09 20:04:35 +02:00
rapidio
ras
regulator regulator: pfuze100: add .is_enable() for pfuze100_swb_regulator_ops 2018-08-06 16:24:35 +02:00
remoteproc
reset
rpmsg
rtc rtc: snvs: Add timeouts to avoid kernel lockups 2018-12-21 14:09:53 +01:00
s390 s390/smp: fix CPU hotplug deadlock with CPU rescan 2019-02-06 19:43:03 +01:00
sbus drivers/sbus/char: add of_node_put() 2018-12-21 14:09:52 +01:00
scsi scsi: csiostor: fix NULL pointer dereference in csio_vport_set_state() 2019-03-23 08:44:19 +01:00
sfi
sh
sn
soc soc/tegra: Don't leak device tree node reference 2019-02-20 10:13:06 +01:00
spi spi: bcm2835: Unbreak the build of esoteric configs 2019-01-13 10:05:31 +01:00
spmi
ssb ssb: mark ssb_bus_register as __maybe_unused 2018-02-25 11:03:44 +01:00
staging staging: lustre: fix buffer overflow of string buffer 2019-03-23 08:44:22 +01:00
target scsi: target: use consistent left-aligned ASCII INQUIRY data 2019-01-26 09:42:53 +01:00
tc TC: Set DMA masks for devices 2018-11-21 09:27:36 +01:00
thermal thermal: int340x_thermal: Fix a NULL vs IS_ERR() check 2019-03-23 08:44:19 +01:00
thunderbolt thunderbolt: Resume control channel after hibernation image is created 2018-04-24 09:32:07 +02:00
tty serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling 2019-03-23 08:44:19 +01:00
uio uio: Fix an Oops on load 2018-11-27 16:08:02 +01:00
usb USB: serial: ftdi_sio: add ID for Hjelmslund Electronics USB485 2019-03-23 08:44:21 +01:00
uwb uwb: hwa-rc: fix memory leak at probe 2018-10-10 08:52:04 +02:00
vfio vfio/pci: Virtualize Maximum Read Request Size 2018-04-24 09:32:09 +02:00
vhost vhost: make sure used idx is seen before log in vhost_add_used_n() 2019-01-13 10:05:28 +01:00
video fbdev: fbcon: Fix unregister crash when more than one framebuffer 2019-02-20 10:13:12 +01:00
virt mm: replace get_user_pages() write/force parameters with gup_flags 2018-12-17 21:55:16 +01:00
virtio virtio_balloon: fix another race between migration and ballooning 2018-08-06 16:24:42 +02:00
vlynq
vme
w1 w1: omap-hdq: fix missing bus unregister at removal 2018-11-21 09:27:35 +01:00
watchdog watchdog: f71808e_wdt: Fix magic close handling 2018-05-30 07:49:03 +02:00
xen xen: xlate_mmu: add missing header to fix 'W=1' warning 2018-12-17 21:55:11 +01:00
zorro zorro: Set up z->dev.dma_mask for the DMA API 2018-05-30 07:49:11 +02:00
Kconfig
Makefile usb: build drivers/usb/common/ when USB_SUPPORT is set 2018-02-25 11:03:38 +01:00