Commit 95174e8d authored by Ziyang Xuan's avatar Ziyang Xuan
Browse files

net: Fix KABI break for introducing is_skb_wmem()

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9HVTH


CVE: CVE-2024-26921

--------------------------------

Fix KABI break when backport commit 7f678def ("skb_expand_head()
adjust skb->truesize incorrectly") by moving is_skb_wmem() into a
private .h file.

Fixes: 7f678def ("skb_expand_head() adjust skb->truesize incorrectly")
Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
parent d0631637
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+6 −4
Original line number Diff line number Diff line
/* 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 */
+1 −1
Original line number Diff line number Diff line
@@ -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;