From: Fan Du <fan.du@windriver.com>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] xfrm: Correctly parse netlink msg from 32bits ip command on 64bits host
Date: Tue, 25 Feb 2014 14:41:11 +0800 [thread overview]
Message-ID: <530C3B07.3090406@windriver.com> (raw)
In-Reply-To: <20140220095934.GF32371@secunet.com>
On 2014年02月20日 17:59, Steffen Klassert wrote:
> For now I think we should just refuse to do anything if someone tries
> to configure ipsec with 32 bit tools on a 64 bit machine.
I'm fine with your point, and it would be a good choice to inform user about
this behavior other than just creating non-working SA and SP for user.
From 873812ec0fe8738f476de58a217e58ec47665180 Mon Sep 17 00:00:00 2001
From: Fan Du <fan.du@windriver.com>
Date: Tue, 25 Feb 2014 14:34:41 +0800
Subject: [PATCH net-next] 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.
Before forging a compatibility layer like we have it for system calls to map
this correct. Inform user land about this situation instead of keeping silent,
then the upper test scripts could behave accordingly.
Signed-off-by: Fan Du <fan.du@windriver.com>
---
net/xfrm/xfrm_user.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 1ae3ec7..0249712 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2347,6 +2347,10 @@ 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 -EPERM;
+#endif
type = nlh->nlmsg_type;
if (type > XFRM_MSG_MAX)
return -EINVAL;
--
1.7.9.5
--
浮沉随浪只记今朝笑
--fan
next prev parent reply other threads:[~2014-02-25 6:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-19 9:12 [PATCH net-next] xfrm: Correctly parse netlink msg from 32bits ip command on 64bits host Fan Du
2014-02-20 9:59 ` Steffen Klassert
2014-02-25 6:41 ` Fan Du [this message]
2014-02-25 11:53 ` Steffen Klassert
2014-02-25 17:15 ` Ben Hutchings
2014-02-25 19:16 ` Florian Westphal
2014-02-27 23:52 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=530C3B07.3090406@windriver.com \
--to=fan.du@windriver.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.