kernel_samsung_a53x/drivers/net
Vasiliy Kovalev bc19c94976 gtp: fix use-after-free and null-ptr-deref in gtp_genl_dump_pdp()
commit 136cfaca22567a03bbb3bf53a43d8cb5748b80ec upstream.

The gtp_net_ops pernet operations structure for the subsystem must be
registered before registering the generic netlink family.

Syzkaller hit 'general protection fault in gtp_genl_dump_pdp' bug:

general protection fault, probably for non-canonical address
0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
CPU: 1 PID: 5826 Comm: gtp Not tainted 6.8.0-rc3-std-def-alt1 #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-alt1 04/01/2014
RIP: 0010:gtp_genl_dump_pdp+0x1be/0x800 [gtp]
Code: c6 89 c6 e8 64 e9 86 df 58 45 85 f6 0f 85 4e 04 00 00 e8 c5 ee 86
      df 48 8b 54 24 18 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80>
      3c 02 00 0f 85 de 05 00 00 48 8b 44 24 18 4c 8b 30 4c 39 f0 74
RSP: 0018:ffff888014107220 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88800fcda588 R14: 0000000000000001 R15: 0000000000000000
FS:  00007f1be4eb05c0(0000) GS:ffff88806ce80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1be4e766cf CR3: 000000000c33e000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
 <TASK>
 ? show_regs+0x90/0xa0
 ? die_addr+0x50/0xd0
 ? exc_general_protection+0x148/0x220
 ? asm_exc_general_protection+0x22/0x30
 ? gtp_genl_dump_pdp+0x1be/0x800 [gtp]
 ? __alloc_skb+0x1dd/0x350
 ? __pfx___alloc_skb+0x10/0x10
 genl_dumpit+0x11d/0x230
 netlink_dump+0x5b9/0xce0
 ? lockdep_hardirqs_on_prepare+0x253/0x430
 ? __pfx_netlink_dump+0x10/0x10
 ? kasan_save_track+0x10/0x40
 ? __kasan_kmalloc+0x9b/0xa0
 ? genl_start+0x675/0x970
 __netlink_dump_start+0x6fc/0x9f0
 genl_family_rcv_msg_dumpit+0x1bb/0x2d0
 ? __pfx_genl_family_rcv_msg_dumpit+0x10/0x10
 ? genl_op_from_small+0x2a/0x440
 ? cap_capable+0x1d0/0x240
 ? __pfx_genl_start+0x10/0x10
 ? __pfx_genl_dumpit+0x10/0x10
 ? __pfx_genl_done+0x10/0x10
 ? security_capable+0x9d/0xe0

Cc: stable@vger.kernel.org
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
Link: https://lore.kernel.org/r/20240214162733.34214-1-kovalev@altlinux.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-18 22:25:37 +01:00
..
appletalk Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2024-11-18 12:11:39 +01:00
bonding bonding: remove print in bond_verify_device_path 2024-11-18 12:13:23 +01:00
caif Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
can can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() 2024-11-18 11:42:49 +01:00
dropdump Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dsa net: dsa: mv88e6xxx: Fix mv88e6352_serdes_get_stats error path 2024-11-18 12:13:14 +01:00
ethernet lan743x: fix for potential NULL pointer dereference with bare card 2024-11-18 22:25:36 +01:00
fddi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fjes fjes: fix memleaks in fjes_hw_setup 2024-11-18 12:13:01 +01:00
hamradio Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hippi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hyperv hv_netvsc: Fix race condition between netvsc_probe and netvsc_remove 2024-11-18 12:13:31 +01:00
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2024-11-18 10:58:29 +01:00
ipa Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ipvlan ipvlan: add ipvlan_route_v6_outbound() helper 2024-11-18 11:43:19 +01:00
mdio Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netdevsim Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pcs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
phy net: phy: micrel: populate .soft_reset for KSZ9131 2024-11-18 12:12:51 +01:00
plip Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ppp ppp_async: limit MRU to 64K 2024-11-18 12:13:25 +01:00
slip Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
team team: Fix use-after-free when an option instance allocation fails 2024-11-18 12:11:57 +01:00
usb asix: Add check for usbnet_get_endpoints 2024-11-18 12:12:07 +01:00
vmxnet3 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vxlan Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wan Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wimax Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wireguard Revert "wireguard: use DEV_STATS_INC()" 2024-11-18 20:09:56 +01:00
wireless iwlwifi: mvm: write queue_sync_state only for sync 2024-11-18 22:25:36 +01:00
xen-netback xen-netback: properly sync TX responses 2024-11-18 12:13:30 +01:00
bareudp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dummy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
eql.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
geneve.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gtp.c gtp: fix use-after-free and null-ptr-deref in gtp_genl_dump_pdp() 2024-11-18 22:25:37 +01:00
ifb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
LICENSE.SRC Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
loopback.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
macsec.c net: macsec: indicate next pn update when offloading 2024-11-08 11:25:46 +01:00
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2024-11-18 11:43:20 +01:00
macvtap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mdio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mii.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
net_failover.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netconsole.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nlmon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ntb_netdev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rionet.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sb1000.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Space.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sungem_phy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
thunderbolt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tun.c tun: prevent negative ifindex 2024-11-08 11:26:10 +01:00
veth.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
virtio_net.c virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings 2024-11-18 12:13:20 +01:00
vrf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vsockmon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xen-netfront.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00