1
0
Fork 0
alistair23-linux/drivers/net
Jouni Hogander 3b5a39979d slip: Fix memory leak in slip_open error path
Driver/net/can/slcan.c is derived from slip.c. Memory leak was detected
by Syzkaller in slcan. Same issue exists in slip.c and this patch is
addressing the leak in slip.c.

Here is the slcan memory leak trace reported by Syzkaller:

BUG: memory leak unreferenced object 0xffff888067f65500 (size 4096):
  comm "syz-executor043", pid 454, jiffies 4294759719 (age 11.930s)
  hex dump (first 32 bytes):
    73 6c 63 61 6e 30 00 00 00 00 00 00 00 00 00 00 slcan0..........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  backtrace:
    [<00000000a06eec0d>] __kmalloc+0x18b/0x2c0
    [<0000000083306e66>] kvmalloc_node+0x3a/0xc0
    [<000000006ac27f87>] alloc_netdev_mqs+0x17a/0x1080
    [<0000000061a996c9>] slcan_open+0x3ae/0x9a0
    [<000000001226f0f9>] tty_ldisc_open.isra.1+0x76/0xc0
    [<0000000019289631>] tty_set_ldisc+0x28c/0x5f0
    [<000000004de5a617>] tty_ioctl+0x48d/0x1590
    [<00000000daef496f>] do_vfs_ioctl+0x1c7/0x1510
    [<0000000059068dbc>] ksys_ioctl+0x99/0xb0
    [<000000009a6eb334>] __x64_sys_ioctl+0x78/0xb0
    [<0000000053d0332e>] do_syscall_64+0x16f/0x580
    [<0000000021b83b99>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
    [<000000008ea75434>] 0xfffffffffffffff

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Jouni Hogander <jouni.hogander@unikie.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-11-13 12:06:27 -08:00
..
appletalk
arcnet drivers: net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
bonding bonding: fix state transition issue in link monitoring 2019-11-05 17:40:16 -08:00
caif caif: no need to check return value of debugfs_create functions 2019-08-11 21:31:25 -07:00
can can: mcp251x: mcp251x_restart_work_handler(): Fix potential force_quit race condition 2019-11-05 12:44:22 +01:00
dsa net: dsa: bcm_sf2: Fix driver removal 2019-11-05 17:54:59 -08:00
ethernet dpaa2-eth: free already allocated channels on probe defer 2019-11-12 19:49:27 -08:00
fddi
fjes fjes: Handle workqueue allocation failure 2019-10-29 10:33:10 -07:00
hamradio net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
hippi
hyperv hv_netvsc: Fix error handling in netvsc_attach() 2019-10-30 18:17:36 -07:00
ieee802154 Merge tag 'ieee802154-for-davem-2019-09-28' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan 2019-09-30 17:14:45 -07:00
ipvlan net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
netdevsim devlink: disallow reload operation during device cleanup 2019-11-09 19:38:36 -08:00
phy mdio_bus: Fix PTR_ERR applied after initialization to constant 2019-11-11 22:00:53 -08:00
plip
ppp net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
slip slip: Fix memory leak in slip_open error path 2019-11-13 12:06:27 -08:00
team team: fix nested locking lockdep warning 2019-10-24 14:53:48 -07:00
usb net: usb: qmi_wwan: add support for Foxconn T77W968 LTE modules 2019-11-13 11:58:20 -08:00
vmxnet3 net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
wan net/wan: dscc4: remove broken dscc4 driver 2019-09-16 09:14:41 +02:00
wimax wimax: i2400: Fix memory leak in i2400m_op_rfkill_sw_toggle 2019-10-29 16:20:25 -07:00
wireless wireless-drivers fixes for 5.4 2019-11-01 10:36:46 -07:00
xen-netback xen/netback: fix error path of xenvif_connect_data() 2019-10-19 11:43:29 -07:00
Kconfig drivers: net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
geneve.c Convert usage of IN_MULTICAST to ipv4_is_multicast 2019-09-05 09:38:32 +02:00
gtp.c
ifb.c
loopback.c
macsec.c net: remove unnecessary variables and callback 2019-10-24 14:53:49 -07:00
macvlan.c net: remove unnecessary variables and callback 2019-10-24 14:53:49 -07:00
macvtap.c
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c net: tap: clean up an indentation issue 2019-09-27 20:58:35 +02:00
thunderbolt.c net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
tun.c tun: remove possible false sharing in tun_flow_update() 2019-10-09 21:29:33 -07:00
veth.c
virtio_net.c netfilter: drop bridge nf reset from nf_reset 2019-10-01 18:42:15 +02:00
vrf.c net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
vsockmon.c
vxlan.c vxlan: fix unexpected failure of vxlan_changelink() 2019-10-30 11:52:47 -07:00
xen-netfront.c xen-netfront: do not use ~0U as error return value for xennet_fill_frags() 2019-10-01 21:49:51 -04:00