Commit 87b23cd4 authored by Yunsheng Lin's avatar Yunsheng Lin Committed by Zheng Zengkai
Browse files

sock: remove one redundant SKB_FRAG_PAGE_ORDER macro

mainline inclusion
from mainline-v5.15-rc1
commit 723783d0
category: bugfix
bugzilla: 186409, https://gitee.com/openeuler/kernel/issues/I4YXSX


CVE: CVE-2022-0886

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

Both SKB_FRAG_PAGE_ORDER are defined to the same value in
net/core/sock.c and drivers/vhost/net.c.

Move the SKB_FRAG_PAGE_ORDER definition to net/core/sock.h,
as both net/core/sock.c and drivers/vhost/net.c include it,
and it seems a reasonable file to put the macro.

Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarXu Jia <xujia39@huawei.com>
Reviewed-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 4aea3bc5
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -651,8 +651,6 @@ static bool tx_can_batch(struct vhost_virtqueue *vq, size_t total_len)
	       !vhost_vq_avail_empty(vq->dev, vq);
}

#define SKB_FRAG_PAGE_ORDER     get_order(32768)

static bool vhost_net_page_frag_refill(struct vhost_net *net, unsigned int sz,
				       struct page_frag *pfrag, gfp_t gfp)
{
+1 −0
Original line number Diff line number Diff line
@@ -2693,6 +2693,7 @@ extern int sysctl_optmem_max;
extern __u32 sysctl_wmem_default;
extern __u32 sysctl_rmem_default;

#define SKB_FRAG_PAGE_ORDER	get_order(32768)
DECLARE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);

static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto)
+0 −1
Original line number Diff line number Diff line
@@ -2445,7 +2445,6 @@ static void sk_leave_memory_pressure(struct sock *sk)
	}
}

#define SKB_FRAG_PAGE_ORDER	get_order(32768)
DEFINE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);

/**