linux/drivers/net
Guillaume Nault eae0a9ae19 ppp: prevent unregistered channels from connecting to PPP units
[ Upstream commit 77f840e3e5 ]

PPP units don't hold any reference on the channels connected to it.
It is the channel's responsibility to ensure that it disconnects from
its unit before being destroyed.
In practice, this is ensured by ppp_unregister_channel() disconnecting
the channel from the unit before dropping a reference on the channel.

However, it is possible for an unregistered channel to connect to a PPP
unit: register a channel with ppp_register_net_channel(), attach a
/dev/ppp file to it with ioctl(PPPIOCATTCHAN), unregister the channel
with ppp_unregister_channel() and finally connect the /dev/ppp file to
a PPP unit with ioctl(PPPIOCCONNECT).

Once in this situation, the channel is only held by the /dev/ppp file,
which can be released at anytime and free the channel without letting
the parent PPP unit know. Then the ppp structure ends up with dangling
pointers in its ->channels list.

Prevent this scenario by forbidding unregistered channels from
connecting to PPP units. This maintains the code logic by keeping
ppp_unregister_channel() responsible from disconnecting the channel if
necessary and avoids modification on the reference counting mechanism.

This issue seems to predate git history (successfully reproduced on
Linux 2.6.26 and earlier PPP commits are unrelated).

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-11 16:19:46 +01:00
..
appletalk net/appletalk: Fix kernel memory disclosure 2017-12-09 18:42:42 +01:00
arcnet arcnet/com20020: add LEDS_CLASS dependency 2015-11-03 11:29:56 -05:00
bonding bonding: discard lowest hash bit for 802.3ad layer3+4 2017-11-24 08:32:24 +01:00
caif net: caif: check return value of alloc_netdev 2015-11-09 11:31:13 -05:00
can can: flex_can: Correct the checking for frame length in flexcan_start_xmit() 2018-03-03 10:19:44 +01:00
cris
dsa net: dsa: bcm_sf2: Ensure we re-negotiate EEE during after link change 2016-12-10 19:07:23 +01:00
ethernet net: gianfar_ptp: move set_fipers() to spinlock protecting area 2018-03-03 10:19:45 +01:00
fddi
fjes fjes: Fix wrong netdevice feature flags 2017-12-20 10:04:55 +01:00
hamradio NET: mkiss: Fix panic 2017-06-17 06:39:35 +02:00
hippi hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close 2018-02-25 11:03:42 +01:00
hyperv hv_netvsc: use skb_get_hash() instead of a homegrown implementation 2017-03-26 12:13:18 +02:00
ieee802154 fakelb: fix schedule while atomic 2017-03-15 09:57:15 +08:00
ipvlan ipvlan: Add the skb->mark as flow4's member to lookup route 2018-02-25 11:03:40 +01:00
irda irda: vlsi_ir: fix check for DMA mapping errors 2017-12-25 14:22:12 +01:00
phy mdio-sun4i: Fix a memory leak 2018-03-03 10:19:45 +01:00
plip
ppp ppp: prevent unregistered channels from connecting to PPP units 2018-03-11 16:19:46 +01:00
slip ppp, slip: Validate VJ compression slot parameters completely 2015-11-02 16:25:00 -05:00
team team: fix memory leaks 2017-10-08 10:14:18 +02:00
usb USB: cdc_subset: only build when one driver is enabled 2018-02-25 11:03:47 +01:00
vmxnet3 vmxnet3: repair memory leak 2018-01-31 12:06:13 +01:00
wan hdlc_ppp: carrier detect ok, don't turn off negotiation 2018-03-11 16:19:46 +01:00
wimax net: wimax/i2400m: fix NULL-deref at probe 2017-12-20 10:04:54 +01:00
wireless wireless: cw1200: use __maybe_unused to hide pm functions_ 2018-02-25 11:03:50 +01:00
xen-netback xen/netback: set default upper limit of tx/rx queues to 8 2017-11-15 17:13:09 +01:00
dummy.c net: dummy: add more features 2015-10-21 19:36:10 -07:00
eql.c
geneve.c geneve: avoid use-after-free of skb->data 2016-12-10 19:07:24 +01:00
ifb.c
Kconfig vmxnet3: prevent building with 64K pages 2018-02-25 11:03:42 +01:00
LICENSE.SRC
loopback.c net: introduce device min_header_len 2017-02-18 16:39:27 +01:00
macvlan.c macvlan: Only deliver one copy of the frame to the macvlan interface 2017-12-20 10:05:01 +01:00
macvtap.c tun/tap: sanitize TUNSETSNDBUF input 2017-11-18 11:11:05 +01:00
Makefile
mdio.c
mii.c
netconsole.c netconsole: use per-attribute show and store methods 2015-10-13 22:17:51 -07:00
nlmon.c
ntb_netdev.c NTB: Add flow control to the ntb_netdev 2015-09-07 15:17:08 -04:00
rionet.c rapidio/rionet: fix deadlock on SMP 2016-04-12 09:08:58 -07:00
sb1000.c
Space.c
sungem_phy.c
tun.c tun: allow positive return values on dev_get_valid_name() call 2017-11-18 11:11:06 +01: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 virtio_net: fix PAGE_SIZE > 64k 2017-07-05 14:37:19 +02:00
vrf.c vrf: fix bug_on triggered by rx when destroying a vrf 2017-07-21 07:44:55 +02:00
vxlan.c vxlan: do not age static remote mac entries 2017-07-05 14:37:19 +02:00
xen-netfront.c xen-netfront: enable device after manual module load 2018-03-03 10:19:45 +01:00