Subject: Re: [PATCH 1/2] Revert "xfrm: interface with if_id 0 should return error"

From: Paul Chaignon <[email-masked]>
Date: Tue, 1 Mar 2022 16:09:30 +0100

On Tue, Mar 01, 2022 at 04:34:52PM +0200, Eyal Birger wrote:
> Hi Kai,
> 
> On Tue, Mar 1, 2022 at 4:17 PM Kai Lüke <[email-masked]> wrote:
> >
> > Hi,
> > > Whereas 8dce43919566 ("xfrm: interface with if_id 0 should return error")
> > > involves xfrm interfaces which don't appear in the pull request.
> > >
> > > In which case, why should that commit be reverted?
> >
> > Correct me if I misunderstood this but reading the commit message it is
> > explicitly labeled as a behavior change for userspace:
> >
> >     With this commit:
> >      ip link add ipsec0  type xfrm dev lo  if_id 0
> >      Error: if_id must be non zero.
> >
> > Changing behavior this way is from my understanding a regression because
> > it breaks programs that happened to work before, even if they worked
> > incorrect (cf. https://lwn.net/Articles/726021/ "The current process for
> > Linux development says that kernel patches cannot break programs that
> > rely on the ABI. That means a program that runs on the 4.0 kernel should
> > be able to run on the 5.0 kernel, Levin said.").
> 
> Well to some extent, but the point was that xfrm interfaces with if_id=0
> were already broken, so returning an error to userspace in such case
> would be a better behavior.
> So I'm not sure this is a regression but it's not up to me to decide these
> things.

I agree with Eyal here.  As far as Cilium is concerned, this is not
causing any regression.  Only the second commit, 68ac0f3810e7 ("xfrm:
state and policy should fail if XFRMA_IF_ID 0") causes issues in a
previously-working setup in Cilium.  We don't use xfrm interfaces.

Paul