Skip to content

Commit

Permalink
xfrm: Do not parse 32bits compiled xfrm netlink msg on 64bits host
Browse files Browse the repository at this point in the history
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: Fan Du <fan.du@intel.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
  • Loading branch information
fengyuleidian0615 authored and klassert committed Mar 3, 2015
1 parent b898441 commit 7400599
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,11 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
const struct xfrm_link *link;
int type, err;

#ifdef CONFIG_COMPAT
if (is_compat_task())
return -ENOTSUPP;
#endif

type = nlh->nlmsg_type;
if (type > XFRM_MSG_MAX)
return -EINVAL;
Expand Down

0 comments on commit 7400599

Please sign in to comment.