linux/drivers/net/ethernet/qualcomm
Xiang Mei a66734a1c5 net: qualcomm: rmnet: restore skb->dev on deaggregated frames
rmnet_map_deaggregate() allocates each sub-frame with alloc_skb() and
leaves skb->dev NULL. __rmnet_map_ingress_handler() assigns
skb->dev = ep->egress_dev only on the data path, but a MAP command frame
is dispatched to rmnet_map_command() before that, so rmnet_map_send_ack()
runs netif_tx_lock(skb->dev) on a NULL device. An unprivileged user
reaches this by unsharing a user+net namespace, creating an rmnet link
over a tap device with INGRESS_DEAGGREGATION and INGRESS_MAP_COMMANDS,
and writing an aggregated frame carrying a flow-control command to the
tap fd.

Restore the assignment dropped by 378e25357a, so every skb leaving
rmnet_map_deaggregate() has a valid device.

  BUG: KASAN: null-ptr-deref in _raw_spin_lock (kernel/locking/spinlock.c:158)
  Write of size 4 at addr 00000000000004b4 by task exploit/144
  Call Trace:
   _raw_spin_lock (kernel/locking/spinlock.c:158)
   netif_tx_lock (net/sched/sch_generic.c:497)
   rmnet_map_command (drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c:67)
   rmnet_rx_handler (drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:125)
   __netif_receive_skb_core.constprop.0 (net/core/dev.c:6103)
   ...
   __netif_receive_skb_one_core (net/core/dev.c:6214)
   netif_receive_skb (net/core/dev.c:6474)
   tun_get_user (drivers/net/tun.c:1966)
   tun_chr_write_iter (drivers/net/tun.c:2012)
   vfs_write (fs/read_write.c:687)
   ksys_write (fs/read_write.c:739)
   do_syscall_64 (arch/x86/entry/syscall_64.c:94)
   entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
  Kernel panic - not syncing: Fatal exception in interrupt

Fixes: 378e25357a ("net: qualcomm: rmnet: Remove unnecessary device assignment")
Reported-by: co+4638111fe2a12980@bugs.sh
Closes: https://lore.kernel.org/netdev/ijg79FFMfIvKJbivdJEKvTO90Q9dTvyBkJck@bugs.sh/T/#u
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Reviewed-by: Subash Abhinov Kasiviswanathan <subash.a.kasiviswanathan@oss.qualcomm.com>
Link: https://patch.msgid.link/20260820195240.1631458-1-xmei5@asu.edu
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-24 11:42:16 -07:00
..
emac net: Fix typos 2025-07-25 10:29:07 -07:00
ppe net: ethernet: qualcomm: remove unneeded 'fast_io' parameter in regmap_config 2026-07-11 13:03:00 +02:00
rmnet net: qualcomm: rmnet: restore skb->dev on deaggregated frames 2026-08-24 11:42:16 -07:00
Kconfig net: Unify user-visible "Qualcomm" name 2026-04-29 16:38:54 -07:00
Makefile net: ethernet: qualcomm: Add PPE driver for IPQ9574 SoC 2025-08-21 12:38:41 +02:00
qca_7k_common.c qca_7k: Replace old mail address 2024-01-31 13:38:51 +00:00
qca_7k_common.h qca_7k: Replace BSD boilerplate with SPDX 2024-01-31 13:38:51 +00:00
qca_7k.c qca_7k: Replace BSD boilerplate with SPDX 2024-01-31 13:38:51 +00:00
qca_7k.h qca_7k: Replace BSD boilerplate with SPDX 2024-01-31 13:38:51 +00:00
qca_debug.c qca_spi: Improve reset mechanism 2024-10-09 18:00:27 -07:00
qca_debug.h qca_7k: Replace BSD boilerplate with SPDX 2024-01-31 13:38:51 +00:00
qca_spi.c qca_spi: Make driver probing reliable 2024-12-09 18:26:48 -08:00
qca_spi.h qca_spi: Fix clock speed for multiple QCA7000 2024-12-09 18:26:48 -08:00
qca_uart.c net: qualcomm: qca_uart: report the consumed byte on RX skb allocation failure 2026-04-03 15:32:56 -07:00