diff mbox series

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

Message ID 20211019214320.2035704-4-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 5.15-rc6 | expand

Commit Message

Hauke Mehrtens Oct. 19, 2021, 9:42 p.m. UTC
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 <hauke@hauke-m.de>
---
 backport/backport-include/linux/skbuff.h | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

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 */