linux_dsm_epyc7002/drivers
Takeshi Misawa 4c247de564 ppp: Fix memory leak in ppp_write
When ppp is closing, __ppp_xmit_process() failed to enqueue skb
and skb allocated in ppp_write() is leaked.

syzbot reported :
BUG: memory leak
unreferenced object 0xffff88812a17bc00 (size 224):
  comm "syz-executor673", pid 6952, jiffies 4294942888 (age 13.040s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000d110fff9>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
    [<00000000d110fff9>] slab_post_alloc_hook mm/slab.h:522 [inline]
    [<00000000d110fff9>] slab_alloc_node mm/slab.c:3262 [inline]
    [<00000000d110fff9>] kmem_cache_alloc_node+0x163/0x2f0 mm/slab.c:3574
    [<000000002d616113>] __alloc_skb+0x6e/0x210 net/core/skbuff.c:197
    [<000000000167fc45>] alloc_skb include/linux/skbuff.h:1055 [inline]
    [<000000000167fc45>] ppp_write+0x48/0x120 drivers/net/ppp/ppp_generic.c:502
    [<000000009ab42c0b>] __vfs_write+0x43/0xa0 fs/read_write.c:494
    [<00000000086b2e22>] vfs_write fs/read_write.c:558 [inline]
    [<00000000086b2e22>] vfs_write+0xee/0x210 fs/read_write.c:542
    [<00000000a2b70ef9>] ksys_write+0x7c/0x130 fs/read_write.c:611
    [<00000000ce5e0fdd>] __do_sys_write fs/read_write.c:623 [inline]
    [<00000000ce5e0fdd>] __se_sys_write fs/read_write.c:620 [inline]
    [<00000000ce5e0fdd>] __x64_sys_write+0x1e/0x30 fs/read_write.c:620
    [<00000000d9d7b370>] do_syscall_64+0x76/0x1a0 arch/x86/entry/common.c:296
    [<0000000006e6d506>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fix this by freeing skb, if ppp is closing.

Fixes: 6d066734e9 ("ppp: avoid loop in xmit recursion detection code")
Reported-and-tested-by: syzbot+d9c8bf24e56416d7ce2c@syzkaller.appspotmail.com
Signed-off-by: Takeshi Misawa <jeliantsurux@gmail.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Tested-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-25 13:45:03 +02:00
..
accessibility
acpi Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
amba
android binder: Add binder_proc logging to binderfs 2019-09-04 13:31:26 +02:00
ata for-5.4/libata-2019-09-15 2019-09-17 16:54:40 -07:00
atm
auxdisplay It's a somewhat calmer cycle for docs this time, as the churn of the mass 2019-09-17 16:22:26 -07:00
base USB changes for 5.4-rc1 2019-09-18 10:33:46 -07:00
bcma bcma: make arrays pwr_info_offset and sprom_sizes static const, shrinks object size 2019-09-13 16:44:49 +03:00
block for-5.4/block-2019-09-16 2019-09-17 16:57:47 -07:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-09-15 14:17:27 +02:00
bus ARM: SoC driver updates for v5.4 2019-09-16 15:52:38 -07:00
cdrom
char Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-09-18 12:11:14 -07:00
clk Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
clocksource Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-17 12:35:15 -07:00
connector
counter
cpufreq Power management updates for 5.4-rc1 2019-09-17 19:15:14 -07:00
cpuidle Power management updates for 5.4-rc1 2019-09-17 19:15:14 -07:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2019-09-18 12:34:53 -07:00
dax
dca
devfreq
dio
dma dmaengine updates for v5.4-rc1 2019-09-17 19:04:40 -07:00
dma-buf
edac Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-16 18:47:53 -07:00
eisa
extcon
firewire
firmware Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
fpga Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
fsi fsi: scom: Don't abort operations for minor errors 2019-08-28 22:59:18 +02:00
gnss
gpio ARM: SoC driver updates for v5.4 2019-09-16 15:52:38 -07:00
gpu LED updates for 5.4-rc1 2019-09-17 18:40:42 -07:00
greybus
hid Bluetooth: hidp: Fix assumptions on the return value of hidp_send_message 2019-09-06 15:55:40 +02:00
hsi
hv Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-17 12:35:15 -07:00
hwmon Driver core patches for 5.4-rc1 2019-09-18 10:04:39 -07:00
hwspinlock
hwtracing Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
i2c Driver core patches for 5.4-rc1 2019-09-18 10:04:39 -07:00
i3c
ide
idle
iio Staging/IIO driver patches for 5.4-rc1 2019-09-18 11:05:34 -07:00
infiniband ipv4: Revert removal of rt_uses_gateway 2019-09-20 18:23:33 -07:00
input media updates for v5.4-rc1 2019-09-17 17:55:23 -07:00
interconnect
iommu LED updates for 5.4-rc1 2019-09-17 18:40:42 -07:00
ipack
irqchip Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-17 11:42:15 -07:00
isdn mISDN: enforce CAP_NET_RAW for raw sockets 2019-09-24 16:37:18 +02:00
leds leds: lm3532: Fix optional led-max-microamp prop error handling 2019-09-12 20:45:52 +02:00
lightnvm lightnvm: print error when target is not found 2019-09-05 13:17:01 -06:00
macintosh
mailbox
mcb
md for-5.4/block-2019-09-16 2019-09-17 16:57:47 -07:00
media media updates for v5.4-rc1 2019-09-17 17:55:23 -07:00
memory iommu/mediatek: Clean up struct mtk_smi_iommu 2019-08-30 15:57:27 +02:00
memstick ms_block: fix spelling mistake "randomally" -> "randomly" 2019-09-11 16:11:01 +02:00
message
mfd USB changes for 5.4-rc1 2019-09-18 10:33:46 -07:00
misc Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
mmc Merge branch 'fixes' into next 2019-09-13 13:57:37 +02:00
mtd Merge branch 'work.mount-base' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-09-18 13:15:58 -07:00
mux
net ppp: Fix memory leak in ppp_write 2019-09-25 13:45:03 +02:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-09-15 14:17:27 +02:00
ntb
nubus
nvdimm libnvdimm/pfn: Fix namespace creation on misaligned addresses 2019-08-28 10:33:13 -07:00
nvme for-5.4/block-2019-09-16 2019-09-17 16:57:47 -07:00
nvmem Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
of LED updates for 5.4-rc1 2019-09-17 18:40:42 -07:00
opp
oprofile
parisc parisc: Disable HP HSC-PCI Cards to prevent kernel crash 2019-09-08 15:43:04 +02:00
parport Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
pci Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2019-09-18 12:34:53 -07:00
pcmcia pcmcia/i82092: Refactored dprintk macro for dev_dbg(). 2019-09-04 13:47:32 +02:00
perf Merge branches 'for-next/52-bit-kva', 'for-next/cpu-topology', 'for-next/error-injection', 'for-next/perf', 'for-next/psci-cpuidle', 'for-next/rng', 'for-next/smpboot', 'for-next/tbi' and 'for-next/tlbi' into for-next/core 2019-08-30 12:46:12 +01:00
phy
pinctrl This is the bulk of changes in the GPIO subsystem for the 2019-09-16 14:06:50 -07:00
platform Driver core patches for 5.4-rc1 2019-09-18 10:04:39 -07:00
pnp
power
powercap Power management updates for 5.4-rc1 2019-09-17 19:15:14 -07:00
pps
ps3
ptp PTP: introduce new versions of IOCTLs 2019-09-13 15:57:02 +02:00
pwm
rapidio
ras
regulator LED updates for 5.4-rc1 2019-09-17 18:40:42 -07:00
remoteproc
reset
rpmsg
rtc LED updates for 5.4-rc1 2019-09-17 18:40:42 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2019-09-18 12:34:53 -07:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2019-09-18 12:34:53 -07:00
sfi
sh
siox
slimbus
soc ARM: SoC driver updates for v5.4 2019-09-16 15:52:38 -07:00
soundwire
spi LED updates for 5.4-rc1 2019-09-17 18:40:42 -07:00
spmi
ssb ssb: make array pwr_info_offset static const, makes object smaller 2019-09-13 17:23:18 +03:00
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2019-09-18 12:34:53 -07:00
target
tc
tee
thermal Merge branch 'pm-cpufreq' 2019-09-17 09:44:29 +02:00
thunderbolt
tty TTY/Serial driver changes for 5.4-rc1 2019-09-18 10:50:47 -07:00
uio Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
usb USB changes for 5.4-rc1 2019-09-18 10:33:46 -07:00
vfio
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-09-15 14:17:27 +02:00
video Driver core patches for 5.4-rc1 2019-09-18 10:04:39 -07:00
virt
virtio virtio_ring: fix unmap of indirect descriptors 2019-09-09 10:43:15 -04:00
visorbus
vlynq
vme
w1 w1: add DS2501, DS2502, DS2505 EPROM device driver 2019-09-04 14:34:31 +02:00
watchdog ARM: SoC platform updates for v5.4 2019-09-16 15:48:14 -07:00
xen swiotlb: Split size parameter to map/unmap APIs 2019-09-11 12:34:29 +02:00
zorro
Kconfig Staging/IIO driver patches for 5.4-rc1 2019-09-18 11:05:34 -07:00
Makefile Staging/IIO driver patches for 5.4-rc1 2019-09-18 11:05:34 -07:00