netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* xfrm: add x86 CONFIG_COMPAT support
@ 2010-02-15 16:46 Florian Westphal
  2010-02-15 16:46 ` [PATCH 1/5] netlink: append NLMSG_DONE to compatskb, too Florian Westphal
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Florian Westphal @ 2010-02-15 16:46 UTC (permalink / raw)
  To: netdev

At the moment it is not possible to use the xfrm netlink interface on
x86_64 with a 32bit userland.

The problem exists because a few structures, e.g. struct xfrm_usersa_info,
have different sizes in user/kernelspace (3 byte padding on x86, 7
byte on x86_64) due to different alignment requirements of "u64".

The following patch set aims to resolve this.

The first two patches add necessary CONFIG_COMPAT_NETLINK_MESSAGES
infrastructure to the netlink in/output path.

Patch 3 is a refactoring patch to split functionality (especially
nlmsg allocation and adding data to the nlmsg) in order to
re-use code and ease review.

Patch 4 adds CONFIG_COMPAT_FOR_U64_ALIGNMENT support to xfrm.

Patch 5 sets CMSG_MSG_COMPAT in sock_aio_write(), depending on
is_compat_task().  If patch 5 is deemed too ugly, just pretend it
doesn't exist; userspace can be patched to use sendmsg instead of
write() to avoid this problem.

 include/linux/netlink.h  |    1
 net/netlink/af_netlink.c |   11
 net/socket.c             |    4
 net/xfrm/Kconfig         |    1
 net/xfrm/xfrm_user.c     |  524 ++++++++++++++++++++++++++++++++++++++++++-----
 5 files changed, 488 insertions(+), 53 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-02-18  9:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 16:46 xfrm: add x86 CONFIG_COMPAT support Florian Westphal
2010-02-15 16:46 ` [PATCH 1/5] netlink: append NLMSG_DONE to compatskb, too Florian Westphal
2010-02-15 16:46 ` [PATCH 2/5] netlink: store MSG_CMSG_COMPAT flag in netlink_skb_parms Florian Westphal
2010-02-18  7:37   ` Johannes Berg
2010-02-15 16:46 ` [PATCH 3/5] xfrm: split nlmsg allocation and data copying Florian Westphal
2010-02-15 16:46 ` [PATCH 4/5] xfrm: CONFIG_COMPAT support for x86 architecture Florian Westphal
2010-02-18  7:57   ` Johannes Berg
2010-02-18  9:33     ` Florian Westphal
2010-02-15 16:46 ` [PATCH 5/5] net: sock_aio_write: set CMSG_MSG_COMPAT flag if is_compat_task Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).