lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220208035510.1200-1-dongli.zhang@oracle.com>
Date:   Mon,  7 Feb 2022 19:55:08 -0800
From:   Dongli Zhang <dongli.zhang@...cle.com>
To:     netdev@...r.kernel.org, bpf@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        rostedt@...dmis.org, mingo@...hat.com, ast@...nel.org,
        daniel@...earbox.net, andrii@...nel.org, imagedong@...cent.com,
        joao.m.martins@...cle.com, joe.jin@...cle.com, dsahern@...il.com,
        edumazet@...gle.com
Subject: [PATCH 0/2] tun/tap: use kfree_skb_reason() to trace dropped skb

The commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()") has
introduced the kfree_skb_reason() to help track the reason. This is to
use kfree_skb_reason() to trace the dropped skb for those two drivers. The
tun and tap are commonly used as virtio-net/vhost-net backend.

This is the 'stacktrace' example for tap when the skb is dropped because
the ptr ring between tap and vhost-net is full.

    kworker/13:0-9759    [013] ..s1.  1439.053393: kfree_skb: skbaddr=000000004109db76 protocol=2054 location=00000000db8dd81c reason: PTR_FULL
    kworker/13:0-9759    [013] ..s2.  1439.053431: <stack trace>
 => trace_event_raw_event_kfree_skb
 => kfree_skb_reason.part.0
 => tap_handle_frame
 => __netif_receive_skb_core
 => __netif_receive_skb_one_core
 => process_backlog
 => __napi_poll
 => net_rx_action
 => __do_softirq
 => do_softirq.part.0
 => netif_rx_ni
 => macvlan_broadcast
 => macvlan_process_broadcast
 => process_one_work
 => worker_thread
 => kthread
 => ret_from_fork

 
This is the 'stacktrace' example for tun when the skb is dropped because
the ptr ring between run and vhost-net is full.

           <idle>-0       [000] b.s2.   499.675592: kfree_skb: skbaddr=00000000ff79867d protocol=2054 location=00000000635128db reason: PTR_FULL
          <idle>-0       [000] b.s3.   499.675612: <stack trace>
 => trace_event_raw_event_kfree_skb
 => kfree_skb_reason.part.0
 => tun_net_xmit
 => dev_hard_start_xmit
 => sch_direct_xmit
 => __dev_queue_xmit
 => br_dev_queue_push_xmit
 => br_handle_frame_finish
 => br_handle_frame
 => __netif_receive_skb_core
 => __netif_receive_skb_list_core
 => netif_receive_skb_list_internal
 => napi_complete_done
 => ixgbe_poll
 => __napi_poll
 => net_rx_action
 => __do_softirq
 => __irq_exit_rcu
 => common_interrupt
 => asm_common_interrupt
 => cpuidle_enter_state
 => cpuidle_enter
 => do_idle
 => cpu_startup_entry
 => start_kernel
 => secondary_startup_64_no_verify



 drivers/net/tap.c          | 30 ++++++++++++++++++++++--------
 drivers/net/tun.c          | 33 +++++++++++++++++++++++++--------
 include/linux/skbuff.h     | 11 +++++++++++
 include/trace/events/skb.h | 11 +++++++++++
 4 files changed, 69 insertions(+), 16 deletions(-)


Thank you very much!

Dongli Zhang


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ