android_kernel_motorola_sm6375/drivers/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jiayuan Chen d685096c81 ppp: Fix KMSAN uninit-value warning with bpf
[ Upstream commit 4c2d14c40a68678d885eab4008a0129646805bae ]

Syzbot caught an "KMSAN: uninit-value" warning [1], which is caused by the
ppp driver not initializing a 2-byte header when using socket filter.

The following code can generate a PPP filter BPF program:
'''
struct bpf_program fp;
pcap_t *handle;
handle = pcap_open_dead(DLT_PPP_PPPD, 65535);
pcap_compile(handle, &fp, "ip and outbound", 0, 0);
bpf_dump(&fp, 1);
'''
Its output is:
'''
(000) ldh [2]
(001) jeq #0x21 jt 2 jf 5
(002) ldb [0]
(003) jeq #0x1 jt 4 jf 5
(004) ret #65535
(005) ret #0
'''
Wen can find similar code at the following link:
https://github.com/ppp-project/ppp/blob/master/pppd/options.c#L1680
The maintainer of this code repository is also the original maintainer
of the ppp driver.

As you can see the BPF program skips 2 bytes of data and then reads the
'Protocol' field to determine if it's an IP packet. Then it read the first
byte of the first 2 bytes to determine the direction.

The issue is that only the first byte indicating direction is initialized
in current ppp driver code while the second byte is not initialized.

For normal BPF programs generated by libpcap, uninitialized data won't be
used, so it's not a problem. However, for carefully crafted BPF programs,
such as those generated by syzkaller [2], which start reading from offset
0, the uninitialized data will be used and caught by KMSAN.

[1] https://syzkaller.appspot.com/bug?extid=853242d9c9917165d791
[2] https://syzkaller.appspot.com/text?tag=ReproC&x=11994913980000

Cc: Paul Mackerras <[email protected]>
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: [email protected]
Closes: https://lore.kernel.org/bpf/[email protected]/
Signed-off-by: Jiayuan Chen <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2025-03-13 12:43:30 +01:00
..
appletalk
arcnet
bonding net: bonding: correctly annotate RCU in bond_should_notify_peers() 2024-08-19 05:33:41 +02:00
caif caif_virtio: fix wrong pointer check in cfv_probe() 2025-03-13 12:43:29 +01:00
can can: c_can: fix unbalanced runtime PM disable in error path 2025-03-13 12:43:16 +01:00
dsa net: dsa: vsc73xx: fix possible subblocks range of CAPT block 2024-09-12 11:03:53 +02:00
ethernet be2net: fix sleeping while atomic bugs in be_ndo_bridge_getlink 2025-03-13 12:43:30 +01:00
fddi
fjes
hamradio
hippi
hyperv hv_netvsc: Fix VF namespace also in synthetic NIC NETDEV_REGISTER event 2024-11-08 16:20:51 +01:00
ieee802154 ieee802154: ca8210: Add missing check for kfifo_alloc() in ca8210_probe() 2025-02-01 18:18:44 +01:00
ipvlan ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound 2024-06-16 13:28:48 +02:00
netdevsim
phy net: phy: vitesse: repair vsc73xx autonegotiation 2024-11-08 16:20:24 +01:00
plip
ppp ppp: Fix KMSAN uninit-value warning with bpf 2025-03-13 12:43:30 +01:00
slip slip: make slhc_remember() more robust against malicious packets 2024-11-08 16:20:46 +01:00
team team: better TEAM_OPTION_TYPE_STRING validation 2025-03-13 12:43:12 +01:00
usb usbnet: gl620a: fix endpoint checking in genelink_bind() 2025-03-13 12:43:25 +01:00
vmxnet3
wan
wimax
wireless wifi: iwlwifi: limit printed string from FW file 2025-03-13 12:43:28 +01:00
xen-netback net/xen-netback: prevent UAF in xenvif_flush_hash() 2025-02-01 18:18:53 +01:00
dummy.c
eql.c
geneve.c geneve: Suppress list corruption splat in geneve_destroy_tunnels(). 2025-03-13 12:43:22 +01:00
gtp.c gtp: Suppress list corruption splat in gtp_net_exit_batch_rtnl(). 2025-03-13 12:43:22 +01:00
ifb.c
Kconfig drivers: net: Fix Kconfig indentation, continued 2024-11-08 16:20:35 +01:00
LICENSE.SRC
loopback.c net: loopback: Avoid sending IP packets without an Ethernet header 2025-03-13 12:43:24 +01:00
macsec.c macsec: don't increment counters for an unrelated SA 2024-11-08 16:20:49 +01:00
macvlan.c
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c net: netconsole: Disable target before netpoll cleanup 2024-08-19 05:33:35 +02:00
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c tap: add missing verification for short frame 2024-07-27 10:38:33 +02:00
thunderbolt.c
tun.c tun: revert fix group permission check 2025-03-13 12:43:06 +01:00
veth.c
virtio_net.c virtio_net: Fix napi_skb_cache_put warning 2024-09-12 11:03:50 +02:00
vrf.c
vsockmon.c
vxlan.c vxlan: Fix regression when dropping packets due to invalid src addresses 2024-07-05 09:08:11 +02:00
xen-netfront.c xen/netfront: fix crash when removing device 2024-12-19 18:05:05 +01:00