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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210805185750.4522-13-xiyou.wangcong@gmail.com>
Date:   Thu,  5 Aug 2021 11:57:49 -0700
From:   Cong Wang <xiyou.wangcong@...il.com>
To:     netdev@...r.kernel.org
Cc:     Qitao Xu <qitao.xu@...edance.com>,
        Cong Wang <cong.wang@...edance.com>
Subject: [Patch net-next 12/13] ipv6: introduce tracepoint trace_tcp_v6_rcv()

From: Qitao Xu <qitao.xu@...edance.com>

Tracepoint trace_tcp_v6_rcv() is introduced to trace skb
at the entrance of TCPv6 on RX side.

Reviewed-by: Cong Wang <cong.wang@...edance.com>
Signed-off-by: Qitao Xu <qitao.xu@...edance.com>
---
 include/trace/events/tcp.h | 9 +++++++++
 net/core/net-traces.c      | 1 +
 net/ipv6/tcp_ipv6.c        | 3 +++
 3 files changed, 13 insertions(+)

diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
index adf84866dee9..f788ac43c4bf 100644
--- a/include/trace/events/tcp.h
+++ b/include/trace/events/tcp.h
@@ -116,6 +116,15 @@ DEFINE_EVENT(tcp_event_sk_skb, tcp_v4_rcv,
 	TP_ARGS(sk, skb)
 );
 
+#if IS_ENABLED(CONFIG_IPV6)
+DEFINE_EVENT(tcp_event_sk_skb, tcp_v6_rcv,
+
+	TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
+
+	TP_ARGS(sk, skb)
+);
+#endif
+
 /*
  * skb of trace_tcp_send_reset is the skb that caused RST. In case of
  * active reset, skb should be NULL
diff --git a/net/core/net-traces.c b/net/core/net-traces.c
index 83df315708ba..e0840efe479a 100644
--- a/net/core/net-traces.c
+++ b/net/core/net-traces.c
@@ -66,4 +66,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(tcp_bad_csum);
 EXPORT_TRACEPOINT_SYMBOL_GPL(udp_v6_send_skb);
 EXPORT_TRACEPOINT_SYMBOL_GPL(ipv6_rcv);
 EXPORT_TRACEPOINT_SYMBOL_GPL(udpv6_rcv);
+EXPORT_TRACEPOINT_SYMBOL_GPL(tcp_v6_rcv);
 #endif
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 0ce52d46e4f8..eb9586d798b7 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1765,6 +1765,9 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb)
 	bh_unlock_sock(sk);
 	if (skb_to_free)
 		__kfree_skb(skb_to_free);
+	if (!ret)
+		trace_tcp_v6_rcv(sk, skb);
+
 put_and_return:
 	if (refcounted)
 		sock_put(sk);
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ