netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Kevin Cernekee <cernekee@chromium.org>
Cc: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
	<paul@paul-moore.com>, <sds@tycho.nsa.gov>,
	<eparis@parisplace.org>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>, <selinux@tycho.nsa.gov>, <fw@strlen.de>,
	<fan.du@windriver.com>, <dianders@chromium.org>,
	<dtor@chromium.org>
Subject: Re: [PATCH 0/4] Make xfrm usable by 32-bit programs
Date: Mon, 23 Jan 2017 10:35:17 +0100	[thread overview]
Message-ID: <20170123093517.GM3541@gauss.secunet.com> (raw)
In-Reply-To: <20170121000507.34381-1-cernekee@chromium.org>

On Fri, Jan 20, 2017 at 04:05:03PM -0800, Kevin Cernekee wrote:
> Several of the xfrm netlink and setsockopt() interfaces are not usable
> from a 32-bit binary running on a 64-bit kernel due to struct padding
> differences.  This has been the case for many, many years[0].  This
> patch series deprecates the broken netlink messages and replaces them
> with packed structs that are compatible between 64-bit and 32-bit
> programs.  It retains support for legacy user programs (i.e. anything
> that is currently working today), and allows legacy support to be
> compiled out via CONFIG_XFRM_USER_LEGACY if it becomes unnecessary in
> the future.

This would mean that we have to maintain two APIs from now on.
This is something I really want to avoid because it is almost
impossible to get rid of the old one.

> 
> Earlier attempts at fixing the problem had implemented a compat layer.
> A compat layer is helpful because it avoids the need to recompile old
> user binaries, but there are many challenges involved in implementing
> it.  I believe a compat layer is of limited value in this instance
> because anybody who really needed to solve the problem without
> recompiling their binaries has almost certainly found another solution
> in the ~7 years since the compat patches were first proposed.
> 
> A benefit of this approach is that long-term, the broken netlink messages
> will no longer be used.  A drawback is that in the short term, user
> programs that want to adopt the new message formats will require a
> modern kernel.  Projects like strongSwan and iproute2 bundle the xfrm.h
> header inside their own source trees, so they will need to make a
> judgment call on when to remove support for kernels that do not support
> the new messages.  And programs built against the new kernel headers
> will not work on old kernels.

So this creates new incompatibilities what is another argument against
this approach. If you really need this, try to implement a full compat
layer. I think this is the only sane solution for this.

  parent reply	other threads:[~2017-01-23  9:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-21  0:05 [PATCH 0/4] Make xfrm usable by 32-bit programs Kevin Cernekee
2017-01-21  0:05 ` [PATCH 1/4] xfrm: Constify xfrm_user arguments and xfrm_mgr callback APIs Kevin Cernekee
2017-01-21  0:05 ` [PATCH 2/4] xfrm_user: Allow common functions to be called from another file Kevin Cernekee
2017-01-21  0:05 ` [PATCH 3/4] xfrm_user: Initial commit of xfrm_user_legacy.c Kevin Cernekee
2017-01-21  0:05 ` [PATCH 4/4] xfrm_user: Add new 32/64-agnostic netlink messages Kevin Cernekee
2017-01-21  8:21   ` kbuild test robot
2017-01-23  9:35 ` Steffen Klassert [this message]
2017-01-23 15:47   ` [PATCH 0/4] Make xfrm usable by 32-bit programs David Miller
2017-01-23 16:45 ` David Laight
2017-01-23 16:57   ` 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=20170123093517.GM3541@gauss.secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=cernekee@chromium.org \
    --cc=davem@davemloft.net \
    --cc=dianders@chromium.org \
    --cc=dtor@chromium.org \
    --cc=eparis@parisplace.org \
    --cc=fan.du@windriver.com \
    --cc=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /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 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).