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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YwNN5hPMD474r03i@unreal>
Date:   Mon, 22 Aug 2022 12:35:34 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Steffen Klassert <steffen.klassert@...unet.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        netdev@...r.kernel.org, Raed Salem <raeds@...dia.com>,
        ipsec-devel <devel@...ux-ipsec.org>
Subject: Re: [PATCH xfrm-next v2 5/6] xfrm: add RX datapath protection for
 IPsec full offload mode

On Mon, Aug 22, 2022 at 10:06:42AM +0200, Steffen Klassert wrote:
> On Thu, Aug 18, 2022 at 04:36:46PM +0300, Leon Romanovsky wrote:
> > On Thu, Aug 18, 2022 at 12:27:08PM +0200, Steffen Klassert wrote:
> > > On Tue, Aug 16, 2022 at 11:59:26AM +0300, Leon Romanovsky wrote:
> > > > From: Leon Romanovsky <leonro@...dia.com>
> > > > 
> > > > Traffic received by device with enabled IPsec full offload should be
> > > > forwarded to the stack only after decryption, packet headers and
> > > > trailers removed.
> > > > 
> > > > Such packets are expected to be seen as normal (non-XFRM) ones, while
> > > > not-supported packets should be dropped by the HW.
> > > > 
> > > > Reviewed-by: Raed Salem <raeds@...dia.com>
> > > > Signed-off-by: Leon Romanovsky <leonro@...dia.com>
> > > 
> > > > @@ -1125,6 +1148,15 @@ static inline int __xfrm_policy_check2(struct sock *sk, int dir,
> > > >  {
> > > >  	struct net *net = dev_net(skb->dev);
> > > >  	int ndir = dir | (reverse ? XFRM_POLICY_MASK + 1 : 0);
> > > > +	struct xfrm_offload *xo = xfrm_offload(skb);
> > > > +	struct xfrm_state *x;
> > > > +
> > > > +	if (xo) {
> > > > +		x = xfrm_input_state(skb);
> > > > +		if (x->xso.type == XFRM_DEV_OFFLOAD_FULL)
> > > > +			return (xo->flags & CRYPTO_DONE) &&
> > > > +			       (xo->status & CRYPTO_SUCCESS);
> > > > +	}
> > > >  
> > > >  	if (sk && sk->sk_policy[XFRM_POLICY_IN])
> > > >  		return __xfrm_policy_check(sk, ndir, skb, family);
> > > 
> > > What happens here if there is a socket policy configured?
> > 
> > No change, we don't support offload of socket policies.
> 
> But the user can confugure it, so it should be enforced
> regardless if we had an offload before.

Thanks, I'll see how it can be resolved.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ