[PATCH 03/47] backports: Add empty implementation for skb_get_kcov_handle()

Hauke Mehrtens <[email protected]>
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
In kernel >= 5.11 skb_get_kcov_handle() returns skb->kcov_handle when
CONFIG_KCOV is set and otherwise 0. It should even be fine when
CONFIG_KCOV is set on older kernels to return 0 here, kcov will not work
as good as on recent kernels, but it should work ok.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
 backport/backport-include/linux/skbuff.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 6b02c857..1fd25fcd 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -122,4 +122,12 @@ static inline __u32 skb_queue_len_lockless(const struct sk_buff_head *list_)
 }
 #endif /* < 5.6.0 */
 
+#if LINUX_VERSION_IS_LESS(5,11,0)
+#define skb_get_kcov_handle LINUX_BACKPORT(skb_get_kcov_handle)
+static inline u64 skb_get_kcov_handle(struct sk_buff *skb)
+{
+	return 0;
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
-- 
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.