linux-sg2042/drivers/net
Peter Hurley 401879c57f net: irda: Fix use-after-free in irtty_open()
The N_IRDA line discipline may access the previous line discipline's closed
and already-fre private data on open [1].

The tty->disc_data field _never_ refers to valid data on entry to the
line discipline's open() method. Rather, the ldisc is expected to
initialize that field for its own use for the lifetime of the instance
(ie. from open() to close() only).

[1]
    ==================================================================
    BUG: KASAN: use-after-free in irtty_open+0x422/0x550 at addr ffff8800331dd068
    Read of size 4 by task a.out/13960
    =============================================================================
    BUG kmalloc-512 (Tainted: G    B          ): kasan: bad access detected
    -----------------------------------------------------------------------------
    ...
    Call Trace:
     [<ffffffff815fa2ae>] __asan_report_load4_noabort+0x3e/0x40 mm/kasan/report.c:279
     [<ffffffff836938a2>] irtty_open+0x422/0x550 drivers/net/irda/irtty-sir.c:436
     [<ffffffff829f1b80>] tty_ldisc_open.isra.2+0x60/0xa0 drivers/tty/tty_ldisc.c:447
     [<ffffffff829f21c0>] tty_set_ldisc+0x1a0/0x940 drivers/tty/tty_ldisc.c:567
     [<     inline     >] tiocsetd drivers/tty/tty_io.c:2650
     [<ffffffff829da49e>] tty_ioctl+0xace/0x1fd0 drivers/tty/tty_io.c:2883
     [<     inline     >] vfs_ioctl fs/ioctl.c:43
     [<ffffffff816708ac>] do_vfs_ioctl+0x57c/0xe60 fs/ioctl.c:607
     [<     inline     >] SYSC_ioctl fs/ioctl.c:622
     [<ffffffff81671204>] SyS_ioctl+0x74/0x80 fs/ioctl.c:613
     [<ffffffff852a7876>] entry_SYSCALL_64_fastpath+0x16/0x7a

Reported-and-tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06 23:28:31 -08:00
..
appletalk
arcnet arcnet/com20020: add LEDS_CLASS dependency 2015-11-03 11:29:56 -05:00
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-11 23:55:43 -05:00
caif net: caif: check return value of alloc_netdev 2015-11-09 11:31:13 -05:00
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-12-03 21:09:12 -05:00
cris
dsa dsa: mv88e6xxx: Add Second back of statistics 2015-12-23 22:17:00 -05:00
ethernet Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
fddi
fjes fjes: fix inconsistent indenting 2015-11-15 17:09:23 -05:00
hamradio mkiss: fix scribble on freed memory 2016-01-06 15:06:27 -05:00
hippi
hyperv hv_netvsc: Fix race condition on Multi-Send Data field 2015-12-14 00:02:06 -05:00
ieee802154 ieee802154: cc2520: Check CRC & add promiscuous 2016-01-03 09:17:42 +01:00
ipvlan net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK 2015-12-15 16:50:08 -05:00
irda net: irda: Fix use-after-free in irtty_open() 2016-02-06 23:28:31 -08:00
phy net: phy: at803x: Add the interrupt register bit definitions 2016-01-17 19:16:47 -05:00
plip net: plip: use new parport device model 2016-01-09 21:02:05 -05:00
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-12-17 22:08:28 -05:00
slip ppp, slip: Validate VJ compression slot parameters completely 2015-11-02 16:25:00 -05:00
team team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid 2016-01-18 11:52:38 -05:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-11 23:55:43 -05:00
vmxnet3 Driver: Vmxnet3: Fix regression caused by 5738a09 2016-01-06 16:20:13 -05:00
wan x25_asy: Free x25_asy on x25_asy_open() failure. 2016-01-13 11:45:39 -05:00
wimax
wireless Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-01-20 09:45:43 -08:00
xen-netback xen-netback: free queues after freeing the net device 2016-01-15 15:13:19 -05:00
Kconfig
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
geneve.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-11 23:55:43 -05:00
ifb.c
loopback.c sctp: Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC 2015-12-15 16:49:58 -05:00
macvlan.c net: Eliminate NETIF_F_GEN_CSUM and NETIF_F_V[46]_CSUM 2015-12-15 16:50:20 -05:00
macvtap.c net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK 2015-12-15 16:50:08 -05:00
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tun.c tun: honor IFF_UP in tun_get_user() 2015-12-17 15:25:57 -05:00
veth.c veth: don’t modify ip_summed; doing so treats packets with bad checksums as good. 2015-12-22 15:15:34 -05:00
virtio_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-12-17 22:08:28 -05:00
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-06 22:54:18 -05:00
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-11 23:55:43 -05:00
xen-netfront.c xen: features for 4.4-rc0 2015-11-04 17:32:42 -08:00