提交 53a0f804 编写于 作者: P Pablo Neira Ayuso 提交者: Zheng Zengkai

netfilter: nft_compat: use nfnetlink_unicast()

mainline inclusion
from mainline-v5.15-rc1
commit 241d1af4
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I58CKN
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=241d1af4c11a75d4c17ecc0193a6ab60553efbfc

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

Use nfnetlink_unicast() which already translates EAGAIN to ENOBUFS,
since EAGAIN is reserved to report missing module dependencies to the
nfnetlink core.

e0241ae6 ("netfilter: use nfnetlink_unicast() forgot to update
this spot.
Reported-by: NYajun Deng <yajun.deng@linux.dev>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NXu Jia <xujia39@huawei.com>
Reviewed-by: NYue Haibing <yuehaibing@huawei.com>
Reviewed-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 cb807f1a
...@@ -687,14 +687,12 @@ static int nfnl_compat_get_rcu(struct net *net, struct sock *nfnl, ...@@ -687,14 +687,12 @@ static int nfnl_compat_get_rcu(struct net *net, struct sock *nfnl,
goto out_put; goto out_put;
} }
ret = netlink_unicast(nfnl, skb2, NETLINK_CB(skb).portid, ret = nfnetlink_unicast(skb2, net, NETLINK_CB(skb).portid);
MSG_DONTWAIT);
if (ret > 0)
ret = 0;
out_put: out_put:
rcu_read_lock(); rcu_read_lock();
module_put(THIS_MODULE); module_put(THIS_MODULE);
return ret == -EAGAIN ? -ENOBUFS : ret;
return ret;
} }
static const struct nla_policy nfnl_compat_policy_get[NFTA_COMPAT_MAX+1] = { static const struct nla_policy nfnl_compat_policy_get[NFTA_COMPAT_MAX+1] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册