提交 74005991 编写于 作者: F Fan Du 提交者: Steffen Klassert

xfrm: Do not parse 32bits compiled xfrm netlink msg on 64bits host

structure like xfrm_usersa_info or xfrm_userpolicy_info
has different sizeof when compiled as 32bits and 64bits
due to not appending pack attribute in their definition.
This will result in broken SA and SP information when user
trying to configure them through netlink interface.

Inform user land about this situation instead of keeping
silent, the upper test scripts would behave accordingly.
Signed-off-by: NFan Du <fan.du@intel.com>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
上级 b898441f
...@@ -2423,6 +2423,11 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -2423,6 +2423,11 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
const struct xfrm_link *link; const struct xfrm_link *link;
int type, err; int type, err;
#ifdef CONFIG_COMPAT
if (is_compat_task())
return -ENOTSUPP;
#endif
type = nlh->nlmsg_type; type = nlh->nlmsg_type;
if (type > XFRM_MSG_MAX) if (type > XFRM_MSG_MAX)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册