hulk inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9HVTH CVE: CVE-2024-26921
--------------------------------
Fix KABI break when backport commit 7f678def99d2 ("skb_expand_head() adjust skb->truesize incorrectly") by moving is_skb_wmem() into a private .h file.
Fixes: 7f678def99d2 ("skb_expand_head() adjust skb->truesize incorrectly") Signed-off-by: Ziyang Xuan william.xuanziyang@huawei.com --- include/net/tcp.h | 2 +- net/core/sock_destructor.h => include/net/tcp_ext.h | 10 ++++++---- net/core/skbuff.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) rename net/core/sock_destructor.h => include/net/tcp_ext.h (72%)
diff --git a/include/net/tcp.h b/include/net/tcp.h index b69f1790b45e..bb7422b87ceb 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -40,6 +40,7 @@ #include <net/inet_ecn.h> #include <net/dst.h> #include <net/mptcp.h> +#include <net/tcp_ext.h>
#include <linux/seq_file.h> #include <linux/memcontrol.h> @@ -331,7 +332,6 @@ int tcp_send_mss(struct sock *sk, int *size_goal, int flags); void tcp_push(struct sock *sk, int flags, int mss_now, int nonagle, int size_goal); void tcp_release_cb(struct sock *sk); -void tcp_wfree(struct sk_buff *skb); void tcp_write_timer_handler(struct sock *sk); void tcp_delack_timer_handler(struct sock *sk); int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); diff --git a/net/core/sock_destructor.h b/include/net/tcp_ext.h similarity index 72% rename from net/core/sock_destructor.h rename to include/net/tcp_ext.h index 2f396e6bfba5..733534808c4c 100644 --- a/net/core/sock_destructor.h +++ b/include/net/tcp_ext.h @@ -1,7 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef _NET_CORE_SOCK_DESTRUCTOR_H -#define _NET_CORE_SOCK_DESTRUCTOR_H -#include <net/tcp.h> + +#ifndef _TCP_EXT_H +#define _TCP_EXT_H + +void tcp_wfree(struct sk_buff *skb);
static inline bool is_skb_wmem(const struct sk_buff *skb) { @@ -9,4 +11,4 @@ static inline bool is_skb_wmem(const struct sk_buff *skb) skb->destructor == __sock_wfree || (IS_ENABLED(CONFIG_INET) && skb->destructor == tcp_wfree); } -#endif +#endif /* _TCP_EXT_H */ diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 6ac8c6f3a744..b290db716392 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -70,6 +70,7 @@ #include <net/mpls.h> #include <net/mptcp.h> #include <net/page_pool.h> +#include <net/tcp_ext.h>
#include <linux/uaccess.h> #include <trace/events/skb.h> @@ -79,7 +80,6 @@ #include <linux/indirect_call_wrapper.h>
#include "datagram.h" -#include "sock_destructor.h"
struct kmem_cache *skbuff_head_cache __ro_after_init; static struct kmem_cache *skbuff_fclone_cache __ro_after_init;