lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 6 Mar 2024 20:28:57 +0100
From: Antony Antony <antony@...nome.org>
To: Leon Romanovsky <leon@...nel.org>
Cc: Antony Antony <antony.antony@...unet.com>, netdev@...r.kernel.org,
	devel@...ux-ipsec.org, Herbert Xu <herbert@...dor.apana.org.au>
Subject: Re: [DKIM] Re: [devel-ipsec] [PATCH ipsec-next] xfrm: Add Direction
 to the SA in or out

On Mon, Mar 04, 2024 at 09:42:39AM +0200, Leon Romanovsky via Devel wrote:
> On Sun, Mar 03, 2024 at 10:08:41PM +0100, Antony Antony 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.
> > 
> > Signed-off-by: Antony Antony <antony.antony@...unet.com>
> > ---
> >  include/net/xfrm.h        |  1 +
> >  include/uapi/linux/xfrm.h |  8 ++++++++
> >  net/xfrm/xfrm_compat.c    |  6 ++++--
> >  net/xfrm/xfrm_device.c    |  5 +++++
> >  net/xfrm/xfrm_state.c     |  1 +
> >  net/xfrm/xfrm_user.c      | 43 +++++++++++++++++++++++++++++++++++----
> >  6 files changed, 58 insertions(+), 6 deletions(-)
> 
> <...>
> 
> > +enum xfrm_sa_dir {
> > +	XFRM_SA_DIR_UNSET = 0,
> > +	XFRM_SA_DIR_IN	= 1,
> > +	XFRM_SA_DIR_OUT	= 2,
> > +	XFRM_SA_DIR_MAX = 3,
> > +};
> 
> <...>
> 
> > +	if (attrs[XFRMA_SA_DIR]) {
> > +		u8 sa_dir = nla_get_u8(attrs[XFRMA_SA_DIR]);
> > +
> > +		if (!sa_dir || sa_dir >= XFRM_SA_DIR_MAX)  {
> 
> Netlink approach is to rely on attrs[XFRMA_SA_DIR] as a marker for XFRM_SA_DIR_UNSET.
> If attrs[XFRMA_SA_DIR] == NULL, then the direction is XFRM_SA_DIR_UNSET.

yes I aggree.
the above 'if' changed to

if (sa_dir != XFRM_SA_DIR_IN  && sa_dir != XFRM_SA_DIR_OUT)  {

> Also, why do you need XFRM_SA_DIR_MAX in UAPI?

Agree, I removed it.

thanks,
-antony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ