android_kernel_motorola_sm6375/drivers/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Pali Rohár eeb4742501 ppp: Fix generating ppp unit id when ifname is not specified
commit 3125f26c514826077f2a4490b75e9b1c7a644c42 upstream.

When registering new ppp interface via PPPIOCNEWUNIT ioctl then kernel has
to choose interface name as this ioctl API does not support specifying it.

Kernel in this case register new interface with name "ppp<id>" where <id>
is the ppp unit id, which can be obtained via PPPIOCGUNIT ioctl. This
applies also in the case when registering new ppp interface via rtnl
without supplying IFLA_IFNAME.

PPPIOCNEWUNIT ioctl allows to specify own ppp unit id which will kernel
assign to ppp interface, in case this ppp id is not already used by other
ppp interface.

In case user does not specify ppp unit id then kernel choose the first free
ppp unit id. This applies also for case when creating ppp interface via
rtnl method as it does not provide a way for specifying own ppp unit id.

If some network interface (does not have to be ppp) has name "ppp<id>"
with this first free ppp id then PPPIOCNEWUNIT ioctl or rtnl call fails.

And registering new ppp interface is not possible anymore, until interface
which holds conflicting name is renamed. Or when using rtnl method with
custom interface name in IFLA_IFNAME.

As list of allocated / used ppp unit ids is not possible to retrieve from
kernel to userspace, userspace has no idea what happens nor which interface
is doing this conflict.

So change the algorithm how ppp unit id is generated. And choose the first
number which is not neither used as ppp unit id nor in some network
interface with pattern "ppp<id>".

This issue can be simply reproduced by following pppd call when there is no
ppp interface registered and also no interface with name pattern "ppp<id>":

    pppd ifname ppp1 +ipv6 noip noauth nolock local nodetach pty "pppd +ipv6 noip noauth nolock local nodetach notty"

Or by creating the one ppp interface (which gets assigned ppp unit id 0),
renaming it to "ppp1" and then trying to create a new ppp interface (which
will always fails as next free ppp unit id is 1, but network interface with
name "ppp1" exists).

This patch fixes above described issue by generating new and new ppp unit
id until some non-conflicting id with network interfaces is generated.

Signed-off-by: Pali Rohár <[email protected]>
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-08-15 13:08:04 +02:00
..
appletalk net: appletalk: cops: Fix data race in cops_probe1 2021-06-16 11:59:36 +02:00
arcnet
bonding bonding: init notify_work earlier to avoid uninitialized use 2021-06-16 11:59:34 +02:00
caif net: caif: fix memory leak in ldisc_open 2021-06-30 08:47:47 -04:00
can can: hi311x: fix a signedness bug in hi3110_cmd() 2021-08-04 12:27:40 +02:00
dsa net: dsa: sja1105: invalidate dynamic FDB entries learned concurrently with statically added ones 2021-08-12 13:20:56 +02:00
ethernet net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset 2021-08-12 13:21:05 +02:00
fddi net: fddi: fix UAF in fza_probe 2021-07-25 14:35:15 +02:00
fjes fjes: check return value after calling platform_get_resource() 2021-07-19 08:53:10 +02:00
hamradio net: hamradio: fix memory leak in mkiss_close 2021-06-23 14:41:26 +02:00
hippi
hyperv
ieee802154 ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl() 2021-07-14 16:53:32 +02:00
ipvlan
netdevsim netdevsim: init u64 stats for 32bit hardware 2021-03-17 17:03:35 +01:00
phy net: phy: micrel: Fix detection of ksz87xx switch 2021-08-12 13:20:57 +02:00
plip
ppp ppp: Fix generating ppp unit id when ifname is not specified 2021-08-15 13:08:04 +02:00
slip
team team: protect features update by RCU to avoid deadlock 2021-02-03 23:26:02 +01:00
usb net: pegasus: fix uninit-value in get_interrupt_interval 2021-08-12 13:20:58 +02:00
vmxnet3
wan net: lapbether: Prevent racing when checking whether the netif is running 2021-05-14 09:44:26 +02:00
wimax staging: wimax/i2400m: fix byte-order issue 2021-05-11 14:04:05 +02:00
wireless virt_wifi: fix error on connect 2021-08-12 13:21:05 +02:00
xen-netback xen-netback: Check for hotplug-status existence before watching 2021-04-28 13:19:15 +02:00
dummy.c
eql.c
geneve.c net: geneve: modify IP header check in geneve6_xmit_skb and geneve_xmit_skb 2021-05-14 09:44:31 +02:00
gtp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-03-04 10:26:53 +01:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: fix dev_ifsioc_locked() race condition 2021-03-07 12:20:43 +01:00
thunderbolt.c
tun.c net: tun: set tun->dev->addr_len during TUNSETLINK processing 2021-04-14 08:24:18 +02:00
veth.c veth: Store queue_mapping independently of XDP prog presence 2021-03-30 14:35:24 +02:00
virtio_net.c virtio_net: move tx vq operation under tx queue lock 2021-07-20 16:10:50 +02:00
vrf.c vrf: do not push non-ND strict packets with a source LLA through packet taps again 2021-07-14 16:53:31 +02:00
vsockmon.c
vxlan.c vxlan: add missing rcu_read_lock() in neigh_reduce() 2021-07-14 16:53:31 +02:00
xen-netfront.c