diff options
author | Fan Du <fan.du@intel.com> | 2015-01-27 04:00:29 -0500 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2015-03-03 04:10:16 -0500 |
commit | 74005991b78a0a7a6546004fb37d33a651c613e7 (patch) | |
tree | 2e83a78f68648da7c7ef91dbd49fd96a06d744d4 /net/xfrm | |
parent | b898441f4ece44933af90b116b467f7864dd1ae7 (diff) |
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: Fan Du <fan.du@intel.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_user.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 7de2ed9ec46d..2091664295ba 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -2423,6 +2423,11 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
2423 | const struct xfrm_link *link; | 2423 | const struct xfrm_link *link; |
2424 | int type, err; | 2424 | int type, err; |
2425 | 2425 | ||
2426 | #ifdef CONFIG_COMPAT | ||
2427 | if (is_compat_task()) | ||
2428 | return -ENOTSUPP; | ||
2429 | #endif | ||
2430 | |||
2426 | type = nlh->nlmsg_type; | 2431 | type = nlh->nlmsg_type; |
2427 | if (type > XFRM_MSG_MAX) | 2432 | if (type > XFRM_MSG_MAX) |
2428 | return -EINVAL; | 2433 | return -EINVAL; |