From: Nicolas Dichtel <nicolas.dichtel@6wind•com>
To: Fan Du <fan.du@intel•com>, steffen.klassert@secunet•com
Cc: herbert@gondor•apana.org.au, davem@davemloft•net,
netdev@vger•kernel.org, fengyuleidian0615@gmail•com
Subject: Re: [PATCHv3, ipsec-next] xfrm: Do not parse 32bits compiled xfrm netlink msg on 64bits host
Date: Thu, 29 Jan 2015 11:29:51 +0100 [thread overview]
Message-ID: <54CA0B9F.8080104@6wind.com> (raw)
In-Reply-To: <1422349230-17394-1-git-send-email-fan.du@intel.com>
Le 27/01/2015 10:00, Fan Du a écrit :
> 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.
>
> Quotes from: http://marc.info/?l=linux-netdev&m=142226348715503&w=2
>>
>> Before a clean solution show up, I think it's better to warn user in some way
>> like http://patchwork.ozlabs.org/patch/323842/ did. Otherwise, many people
>> who stuck there will always spend time and try to fix this issue in whatever way.
>
> Yes, this is the first thing we should do. I'm willing to accept a patch
>
> Signed-off-by: Fan Du <fan.du@intel•com>
A way to solve this problem was to provide to userland a xfrm compat header
file, which match the ABI of the kernel. Something like:
#include <linux/xfrm.h>
#define xfrm_usersa_info xfrm_usersa_info_64
#define xfrm_usersa_info_compat xfrm_usersa_info
struct xfrm_usersa_info_compat {
struct xfrm_selector sel;
struct xfrm_id id;
xfrm_address_t saddr;
struct xfrm_lifetime_cfg lft;
struct xfrm_lifetime_cur curlft;
struct xfrm_stats stats;
__u32 seq;
__u32 reqid;
__u16 family;
__u8 mode;
__u8 replay_window;
__u8 flags;
__u8 hole1;
__u32 hole2;
};
The point I try to make is that patching userland apps allows to use xfrm on a
32bits userland / 64bits kernel.
If I understand well your patch, it will not be possible anymore, all messages
will be rejected. And this may break existing apps.
Regards,
Nicolas
next prev parent reply other threads:[~2015-01-29 10:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20150127.001226.711259930266409202.davem () davemloft ! net>
2015-01-27 9:00 ` [PATCHv3 ipsec-next] xfrm: Do not parse 32bits compiled xfrm netlink msg on 64bits host Fan Du
2015-01-27 9:46 ` David Laight
2015-01-27 11:04 ` Florian Westphal
2015-01-27 11:54 ` David Laight
2015-01-27 19:24 ` David Miller
2015-01-28 9:53 ` David Laight
2015-01-28 4:34 ` Fan Du
2015-01-29 10:29 ` Nicolas Dichtel [this message]
2015-01-29 13:56 ` [PATCHv3, " David Laight
2015-01-29 14:14 ` Nicolas Dichtel
2015-01-30 2:11 ` Fan Du
2015-02-02 8:44 ` Steffen Klassert
2015-02-02 9:02 ` Nicolas Dichtel
2015-02-02 19:45 ` David Miller
2015-02-03 12:24 ` Steffen Klassert
2015-02-03 14:02 ` Nicolas Dichtel
2015-03-06 6:13 ` [PATCHv3 " Steffen Klassert
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=54CA0B9F.8080104@6wind.com \
--to=nicolas.dichtel@6wind$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=fan.du@intel$(echo .)com \
--cc=fengyuleidian0615@gmail$(echo .)com \
--cc=herbert@gondor$(echo .)apana.org.au \
--cc=netdev@vger$(echo .)kernel.org \
--cc=steffen.klassert@secunet$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox