Subject: Re: [devel-ipsec] [PATCH ipsec-next v8] xfrm: Add Direction to the SA in or out

From: Sabrina Dubroca <[email-masked]>
Date: Thu, 11 Apr 2024 22:00:07 +0200

2024-04-11, 14:55:57 +0300, Leon Romanovsky wrote:
> On Thu, Apr 11, 2024 at 01:07:52PM +0200, Antony Antony via Devel wrote:
> > On Thu, Apr 11, 2024 at 01:37:40PM +0300, Leon Romanovsky via Devel wrote:
> > > On Tue, Apr 09, 2024 at 07:37:20PM +0200, Antony Antony via Devel wrote:
> > > > This patch introduces the 'dir' attribute, 'in' or 'out', to the
> > > > xfrm_state, SA, enhancing usability by delineating the scope of values
> > > > based on direction. An input SA will now exclusively encompass values
> > > > pertinent to input, effectively segregating them from output-related
> > > > values. This change aims to streamline the configuration process and
> > > > improve the overall clarity of SA attributes.
> > > > 
> > > > This feature sets the groundwork for future patches, including
> > > > the upcoming IP-TFS patch.
> > > > 
> > > > v7->v8:
> > > >  - add extra validation check on replay window and seq
> > > >  - XFRM_MSG_UPDSA old and new SA should match "dir"
> > > 
> > > Why? Update is add and delete operation, and one can update any field
> > > he/she wants, including direction.
> > 
> > Update operations are not strictly necessary without IKEv2. However, during
> > IKEv2 negotiation, updating "in" SA becomes essential.
> 
> The thing is if you want to limit update routine to fit IKEv2 only, or
> continue to allow users to do whatever they want with netlink and their
> own applications without *swan.
> 
> I don't have knowledge about such users, just remember seeking tons of
> guides how to setup IPsec tunnel with iproute2 and scripts, one of them
> can be potentially broken by this change.

Nothing is going to break with this change. Old scripts and old
userspace software are not providing XFRMA_SA_DIR, so none of the new
checks apply.

-- 
Sabrina