]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: dlink: use dev_kfree_skb_any instead of dev_kfree_skb
authorYeounsu Moon <yyyynoom@gmail.com>
Sun, 19 Oct 2025 07:55:40 +0000 (16:55 +0900)
committerJakub Kicinski <kuba@kernel.org>
Wed, 22 Oct 2025 01:38:38 +0000 (18:38 -0700)
commit5523508258d390fd55b25c1c0f99c092f23a39e9
treec97c317560115a378eaa82081cdd64516b649f8f
parent2653e9c5dda5a320310aae8f0abba6fc1be40eec
net: dlink: use dev_kfree_skb_any instead of dev_kfree_skb

Replace `dev_kfree_skb()` with `dev_kfree_skb_any()` in `start_xmit()`
which can be called from netpoll (hard IRQ) and from other contexts.

Also, `np->link_status` can be changed at any time by interrupt handler.

  <idle>-0       [011] dNh4.  4541.754603: start_xmit <-netpoll_start_xmit
  <idle>-0       [011] dNh4.  4541.754622: <stack trace>
 => [FTRACE TRAMPOLINE]
 => start_xmit
 => netpoll_start_xmit
 => netpoll_send_skb
 => write_msg
 => console_flush_all
 => console_unlock
 => vprintk_emit
 => _printk
 => rio_interrupt
 => __handle_irq_event_percpu
 => handle_irq_event
 => handle_fasteoi_irq
 => __common_interrupt
 => common_interrupt
 => asm_common_interrupt
 => mwait_idle
 => default_idle_call
 => do_idle
 => cpu_startup_entry
 => start_secondary
 => common_startup_64

This issue can occur when the link state changes from off to on
(e.g., plugging or unplugging the LAN cable) while transmitting a
packet. If the skb has a destructor, a warning message may be
printed in this situation.

-> consume_skb (dev_kfree_skb())
  -> __kfree_skb()
    -> skb_release_all()
      -> skb_release_head_state(skb)
 if (skb->destructor) {
         DEBUG_NET_WARN_ON_ONCE(in_hardirq());
 skb->destructor(skb);
 }

Found by inspection.

Signed-off-by: Yeounsu Moon <yyyynoom@gmail.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Tested-on: D-Link DGE-550T Rev-A3
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251019075540.55697-1-yyyynoom@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/dlink/dl2k.c