summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2020-11-26 01:48:40 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-14 12:16:10 +0300
commit67349025f00d0749e36386cfcfc32c2887f47fdb (patch)
tree775d89cdfca1f00f0b03218f68a559c3a1f4293c /net/core
parent3d5f83a62e8235d235534b3dc6f197d8a822c269 (diff)
downloadlinux-67349025f00d0749e36386cfcfc32c2887f47fdb.tar.xz
net: switch to storing KCOV handle directly in sk_buff
[ Upstream commit fa69ee5aa48b5b52e8028c2eb486906e9998d081 ] It turns out that usage of skb extensions can cause memory leaks. Ido Schimmel reported: "[...] there are instances that blindly overwrite 'skb->extensions' by invoking skb_copy_header() after __alloc_skb()." Therefore, give up on using skb extensions for KCOV handle, and instead directly store kcov_handle in sk_buff. Fixes: 6370cc3bbd8a ("net: add kcov handle to skb extensions") Fixes: 85ce50d337d1 ("net: kcov: don't select SKB_EXTENSIONS when there is no NET") Fixes: 97f53a08cba1 ("net: linux/skbuff.h: combine SKB_EXTENSIONS + KCOV handling") Link: https://lore.kernel.org/linux-wireless/20201121160941.GA485907@shredder.lan/ Reported-by: Ido Schimmel <idosch@idosch.org> Signed-off-by: Marco Elver <elver@google.com> Link: https://lore.kernel.org/r/20201125224840.2014773-1-elver@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: db0b124f02ba ("igc: Enhance Qbv scheduling by using first flag bit") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 06169889b0ca..176bcbb07aab 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4258,9 +4258,6 @@ static const u8 skb_ext_type_len[] = {
#if IS_ENABLED(CONFIG_MPTCP)
[SKB_EXT_MPTCP] = SKB_EXT_CHUNKSIZEOF(struct mptcp_ext),
#endif
-#if IS_ENABLED(CONFIG_KCOV)
- [SKB_EXT_KCOV_HANDLE] = SKB_EXT_CHUNKSIZEOF(u64),
-#endif
};
static __always_inline unsigned int skb_ext_total_length(void)
@@ -4278,9 +4275,6 @@ static __always_inline unsigned int skb_ext_total_length(void)
#if IS_ENABLED(CONFIG_MPTCP)
skb_ext_type_len[SKB_EXT_MPTCP] +
#endif
-#if IS_ENABLED(CONFIG_KCOV)
- skb_ext_type_len[SKB_EXT_KCOV_HANDLE] +
-#endif
0;
}