aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2020-11-25 23:48:40 +0100
committerJakub Kicinski <kuba@kernel.org>2020-12-01 11:26:19 -0800
commitfa69ee5aa48b5b52e8028c2eb486906e9998d081 (patch)
tree3a93e691ed484fd22681f316ca1cb54719a112d9 /net/core
parentnet: sched: remove redundant 'rtnl_held' argument (diff)
downloadlinux-dev-fa69ee5aa48b5b52e8028c2eb486906e9998d081.tar.xz
linux-dev-fa69ee5aa48b5b52e8028c2eb486906e9998d081.zip
net: switch to storing KCOV handle directly in sk_buff
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>
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 ad98265f1dd1..90d3423e6017 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4210,9 +4210,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)
@@ -4230,9 +4227,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;
}