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]
Message-ID: <AM0PR05MB525009BEE505EB3AD45B87DEC4890@AM0PR05MB5250.eurprd05.prod.outlook.com>
Date:   Mon, 7 Jan 2019 09:53:31 +0000
From:   Raed Salem <raeds@...lanox.com>
To:     Steffen Klassert <steffen.klassert@...unet.com>
CC:     Boris Pismenny <borisp@...lanox.com>,
        Yossi Kuperman <yossiku@...lanox.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>,
        "davem@...emloft.net" <davem@...emloft.net>
Subject: RE: [PATCH ipsec] xfrm: fix non-GRO codepath for IPsec hardware
 offloading



> -----Original Message-----
> From: Steffen Klassert [mailto:steffen.klassert@...unet.com]
> Sent: Friday, January 04, 2019 1:22 PM
> To: Raed Salem <raeds@...lanox.com>
> Cc: Boris Pismenny <borisp@...lanox.com>; Yossi Kuperman
> <yossiku@...lanox.com>; netdev@...r.kernel.org;
> herbert@...dor.apana.org.au; davem@...emloft.net
> Subject: Re: [PATCH ipsec] xfrm: fix non-GRO codepath for IPsec hardware
> offloading
> 
> On Fri, Jan 04, 2019 at 11:17:33AM +0000, Raed Salem wrote:
> > >
> > > I guess this works because of transport mode, here we don't have
> > > different inner and outer IP headers. Can you please test this with
> > > some tunnel mode configurations?
> > Sure,
> > Works with the following SA and policy DB:
> > ip x s s:
> > src 1.2.3.4 dst 1.2.3.5
> >         proto esp spi 0x56c8245e reqid 1455957086 mode tunnel
> >         replay-window 0
> >         aead rfc4106(gcm(aes))
> 0xae41773f260e9fbda4cd9f117d8d5fb42d4a4a68 128
> >         anti-replay context: seq 0x0, oseq 0x0, bitmap 0x00000000
> >         crypto offload parameters: dev p6p1 dir in
> >         sel src 1.2.3.4/32 dst 1.2.3.5/32 src 1.2.3.5 dst 1.2.3.4
> >         proto esp spi 0xd94ba134 reqid 3645612340 mode tunnel
> >         replay-window 0
> >         aead rfc4106(gcm(aes)) 0x55a5136bec858fcb6944b8596fc73aa0ca553bf7
> 128
> >         anti-replay context: seq 0x0, oseq 0xd, bitmap 0x00000000
> >         crypto offload parameters: dev p6p1 dir out
> >         sel src 1.2.3.5/32 dst 1.2.3.4/32 ip x p s:
> > src 1.2.3.4/32 dst 1.2.3.5/32
> >         dir fwd priority 0 ptype main
> >         tmpl src 1.2.3.4 dst 1.2.3.5
> >                 proto esp reqid 1455957086 mode tunnel src 1.2.3.4/32
> > dst 1.2.3.5/32
> >         dir in priority 0 ptype main
> >         tmpl src 1.2.3.4 dst 1.2.3.5
> >                 proto esp reqid 1455957086 mode tunnel src 1.2.3.5/32
> > dst 1.2.3.4/32
> >         dir out priority 0 ptype main
> >         tmpl src 1.2.3.5 dst 1.2.3.4
> >                 proto esp reqid 3645612340 mode tunnel
> 
> Here are the src and dst addresses are the same for inner and outer headers.
> You need to test this with a bit more complex configuration.

tested based on kernel v4.20-rc7 with the patch it works when configured with hw offload and without gro:
topology used:
Server A (192.168.8.2) <--> GW C <---> GW D <--> Server B (192.168.9.4):
Server A (vm) connected to gateway C (host) via linux bridge (bripsec - 192.168.8.1)
Gateway C connected to gateway D back to back with ipsec hw offload capable NICs (interface names [ip] respectfully p6p1 [192.168.7.2] /enp4s0 [192.168.7.9])
Server B (vm) connected to gateway D (host) via linux bridge (bripsec - 192.168.9.1)

test flow:
1- configure ipsec tunnel with hw offload on and appropriate ip route at gateways C+D
2- Server A send ping traffic to server B using the tunnel

Server A config:
ip route:
192.168.7.0/24 via 192.168.8.1 dev ens6
192.168.8.0/24 dev ens6 proto kernel scope link src 192.168.8.2
192.168.9.0/24 via 192.168.8.1 dev ens6

GW C:
ip route:
192.168.7.0/24 dev p6p1 proto kernel scope link src 192.168.7.2
192.168.8.0/24 dev bripsec proto kernel scope link src 192.168.8.1
192.168.9.0/24 via 192.168.7.9 dev p6p1
ip x s s:
src 192.168.7.9 dst 192.168.7.2
        proto esp spi 0x052dada4 reqid 86879652 mode tunnel
        replay-window 0
        aead rfc4106(gcm(aes)) 0xa04f6b814ce4b8738ced2adc2e1abea3152822281df5338560fe9f50cf473cfa16747cd9 128
        anti-replay context: seq 0x0, oseq 0x0, bitmap 0x00000000
        crypto offload parameters: dev p6p1 dir in
        sel src 192.168.9.2/24 dst 192.168.8.2/24
src 192.168.7.2 dst 192.168.7.9
        proto esp spi 0x2b4f9d61 reqid 726637921 mode tunnel
        replay-window 0
        aead rfc4106(gcm(aes)) 0x4f580ac2e9b959c195c212451498edfc54204dcf152dac387baaf3aa6be7677952954644 128
        anti-replay context: seq 0x0, oseq 0x2d, bitmap 0x00000000
        crypto offload parameters: dev p6p1 dir out
        sel src 192.168.8.2/24 dst 192.168.9.2/24
ip x p s:
src 192.168.9.2/24 dst 192.168.8.2/24
        dir fwd priority 0 ptype main
        tmpl src 192.168.7.9 dst 192.168.7.2
                proto esp reqid 86879652 mode tunnel
src 192.168.9.2/24 dst 192.168.8.2/24
        dir in priority 0 ptype main
        tmpl src 192.168.7.9 dst 192.168.7.2
                proto esp reqid 86879652 mode tunnel
src 192.168.8.2/24 dst 192.168.9.2/24
        dir out priority 0 ptype main
        tmpl src 192.168.7.2 dst 192.168.7.9
                proto esp reqid 726637921 mode tunnel
				
GW D:
ip route:
192.168.7.0/24 dev enp4s0 proto kernel scope link src 192.168.7.9
192.168.8.0/24 via 192.168.7.2 dev enp4s0
192.168.9.0/24 dev bripsec proto kernel scope link src 192.168.9.1
ip x s s:
src 192.168.7.9 dst 192.168.7.2
        proto esp spi 0x052dada4 reqid 86879652 mode tunnel
        replay-window 0
        aead rfc4106(gcm(aes)) 0xa04f6b814ce4b8738ced2adc2e1abea3152822281df5338560fe9f50cf473cfa16747cd9 128
        anti-replay context: seq 0x0, oseq 0x2d, bitmap 0x00000000
        crypto offload parameters: dev enp4s0 dir out
        sel src 192.168.9.2/24 dst 192.168.8.2/24
src 192.168.7.2 dst 192.168.7.9
        proto esp spi 0x2b4f9d61 reqid 726637921 mode tunnel
        replay-window 0
        aead rfc4106(gcm(aes)) 0x4f580ac2e9b959c195c212451498edfc54204dcf152dac387baaf3aa6be7677952954644 128
        anti-replay context: seq 0x0, oseq 0x0, bitmap 0x00000000
        crypto offload parameters: dev enp4s0 dir in
        sel src 192.168.8.2/24 dst 192.168.9.2/24
ip x p s:
src 192.168.8.2/24 dst 192.168.9.2/24
        dir fwd priority 0 ptype main
        tmpl src 192.168.7.2 dst 192.168.7.9
                proto esp reqid 726637921 mode tunnel
src 192.168.8.2/24 dst 192.168.9.2/24
        dir in priority 0 ptype main
        tmpl src 192.168.7.2 dst 192.168.7.9
                proto esp reqid 726637921 mode tunnel
src 192.168.9.2/24 dst 192.168.8.2/24
        dir out priority 0 ptype main
        tmpl src 192.168.7.9 dst 192.168.7.2
                proto esp reqid 86879652 mode tunnel

Server B:
Ip route:
192.168.7.0/24 via 192.168.9.1 dev ens6
192.168.8.0/24 via 192.168.9.1 dev ens6
192.168.9.0/24 dev ens6 proto kernel scope link src 192.168.9.2

test:
at Server A:  ping -I ens6 192.168.9.2

Results: without the patch it does not work without GRO, with the patch it works

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ