Re: [PATCH] xfrm: return error when esp offload is requested and not supported

2021-03-17 Thread Antony Antony
Hi, On Mon, Mar 15, 2021 at 16:29:59 +0100, Sabrina Dubroca wrote: > 2021-03-15, 11:43:50 +0100, Steffen Klassert wrote: > > On Wed, Mar 10, 2021 at 10:36:11AM +0100, Antony Antony wrote: > > > When ESP offload is not supported by the device return an error, > > > -

[PATCH] xfrm: return error when esp offload is requested and not supported

2021-03-10 Thread Antony Antony
defined and the user is trying to create an SA with the offload. Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API") Signed-off-by: Antony Antony --- include/net/xfrm.h | 2 +- net/xfrm/xfrm_device.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) di

[PATCH ipsec-next v5] xfrm: redact SA secret with lockdown confidentiality

2020-11-17 Thread Antony Antony
s with tabs for consistency v3->v4 - use kernel lockdown instead of a /proc setting v4->v5 - remove kconfig option Reviewed-by: Stephan Mueller Signed-off-by: Antony Antony --- include/linux/security.h | 1 + net/xfrm/xfrm_user.c | 74 securit

Re: [PATCH] xfrm: redact SA secret with lockdown confidentiality

2020-11-17 Thread Antony Antony
On Sat, Oct 31, 2020 at 11:49:11 +0100, Steffen Klassert wrote: > On Fri, Oct 16, 2020 at 03:36:12PM +0200, Antony Antony wrote: > > redact XFRM SA secret in the netlink response to xfrm_get_sa() > > or dumpall sa. > > Enable this at build time and set kernel lockdo

[PATCH] xfrm: redact SA secret with lockdown confidentiality

2020-10-16 Thread Antony Antony
bs for consistency v3->v4 - use kernel lockdown instead of a /proc setting Reviewed-by: Stephan Mueller Signed-off-by: Antony Antony --- include/linux/security.h | 1 + net/xfrm/Kconfig | 9 + net/xfrm/xfrm_user.c | 76 security/s

[PATCH] ixgbe: fail to create xfrm offload of IPsec tunnel mode SA

2020-10-14 Thread Antony Antony
: add ipsec offload add and remove SA") Signed-off-by: Antony Antony --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 5 + drivers/net/ethernet/intel/ixgbevf/ipsec.c | 5 + 2 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/ne

[PATCH iproute2-net v2] ip xfrm: support setting XFRMA_SET_MARK_MASK attribute in states

2020-10-02 Thread Antony Antony
.0.0/0 dst 0.0.0.0/0 Signed-off-by: Antony Antony --- v1 -> v2 - add man page and usage for mask -- ip/xfrm_state.c| 23 ++- man/man8/ip-xfrm.8 | 4 +++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c index ddf78

[PATCH iproute2-next] ip xfrm: support setting XFRMA_SET_MARK_MASK attribute in states

2020-09-29 Thread Antony Antony
.0.0/0 dst 0.0.0.0/0 Signed-off-by: Antony Antony --- ip/xfrm_state.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c index ddf784ca..779ccf0e 100644 --- a/ip/xfrm_state.c +++ b/ip/xfrm_state.c @@ -328,7 +328,7 @@

[PATCH iproute2-next RFC] ip xfrm: support setting XFRMA_SET_MARK_MASK attribute in states

2020-09-19 Thread Antony Antony
uot; is wrong: MARK value is invalid ./ip/ip xfrm state add mark 0xZZ mask 0xab proto esp auth \ digest_null 0 enc cipher_null '' Error: argument "0xZZ" is wrong: MARK value is invalid Signed-off-by: Antony Antony --- ip/xfrm_state.c | 13 +++-- 1 file changed, 7 inserti

[PATCH iproute2-next RFC] ip xfrm: support setting XFRMA_SET_MARK_MASK attribute in states

2020-09-19 Thread Antony Antony
r: argument "0xZZ" is wrong: value after "output-mark" is invalid vs ./ip/ip xfrm state add mark 0xZZ mask 0xab proto esp \ auth digest_null 0 enc cipher_null '' Error: argument "0xZZ" is wrong: MARK value is invalid Signed-off-by: Antony Antony ---

[PATCH v3 4/4] xfrm: clone whole liftime_cur structure in xfrm_do_migrate

2020-09-03 Thread Antony Antony
When we clone state only add_time was cloned. It missed values like bytes, packets. Now clone the all members of the structure. v1->v3: - use memcpy to copy the entire structure Fixes: 80c9abaabf42 ("[XFRM]: Extension for dynamic update of endpoint address(es)") Signed-off-by:

[PATCH v3 3/4] xfrm: clone XFRMA_SEC_CTX in xfrm_do_migrate

2020-09-03 Thread Antony Antony
XFRMA_SEC_CTX was not cloned from the old to the new. Migrate this attribute during XFRMA_MSG_MIGRATE v1->v2: - return -ENOMEM on error v2->v3: - fix return type to int Fixes: 80c9abaabf42 ("[XFRM]: Extension for dynamic update of endpoint address(es)") Signed-off-by: Antony

[PATCH v3 2/4] xfrm: clone XFRMA_REPLAY_ESN_VAL in xfrm_do_migrate

2020-09-03 Thread Antony Antony
XFRMA_REPLAY_ESN_VAL was not cloned completely from the old to the new. Migrate this attribute during XFRMA_MSG_MIGRATE v1->v2: - move curleft cloning to a separate patch Fixes: af2f464e326e ("xfrm: Assign esn pointers when cloning a state") Signed-off-by: Antony Antony --- inclu

[PATCH v3 1/4] xfrm: clone XFRMA_SET_MARK in xfrm_do_migrate

2020-09-03 Thread Antony Antony
XFRMA_SET_MARK and XFRMA_SET_MARK_MASK was not cloned from the old to the new. Migrate these two attributes during XFRMA_MSG_MIGRATE Fixes: 9b42c1f179a6 ("xfrm: Extend the output_mark to support input direction and masking.") Signed-off-by: Antony Antony --- net/xfrm/xfrm_state.c | 1

[PATCH iproute2-next] ip xfrm: support printing XFRMA_SET_MARK_MASK attribute in states

2020-08-28 Thread Antony Antony
32 flag af-unspec output-mark 0x3/0xff aead rfc4106(gcm(aes)) 0xENCAUTHKEY 128 if_id 0x1 Signed-off-by: Antony Antony --- ip/ipxfrm.c | 4 1 file changed, 4 insertions(+) diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c index cac8ba25..e4a72bd0 100644 --- a/ip/ipxfrm.c

[PATCH RFC] xfrm: fail to create ixgbe offload of IPsec tunnel mode sa

2020-08-28 Thread Antony Antony
Based on talks and indirect references ixgbe driver does not support offloading IPsec tunnel mode. It only support transport mode. Now explicitly fail to avoid when trying to offload. Fixes: 63a67fe229ea ("ixgbe: add ipsec offload add and remove SA") Signed-off-by: Antony Antony ---

Re: [PATCH ipsec-next v3] xfrm: add /proc/sys/core/net/xfrm_redact_secret

2020-08-27 Thread Antony Antony
Hi David, On Mon, Aug 24, 2020 at 08:00:38 +0200, Antony Antony wrote: > On Thu, Aug 20, 2020 at 15:42:22 -0700, David Miller wrote: > > From: Antony Antony > > Date: Thu, 20 Aug 2020 20:35:49 +0200 > > > > > Redacting secret is a FIPS 140-2 requirement. > &g

[PATCH v2 4/4] xfrm: clone whole liftime_cur structure in xfrm_do_migrate

2020-08-26 Thread Antony Antony
When we clone state only add_time was cloned. It missed values like bytes, packets. Now clone the all members of the structure. Fixes: 80c9abaabf42 ("[XFRM]: Extension for dynamic update of endpoint address(es)") Signed-off-by: Antony Antony --- net/xfrm/xfrm_state.c | 2 +- 1 file

[PATCH v2 3/4] xfrm: clone XFRMA_SEC_CTX in xfrm_do_migrate

2020-08-26 Thread Antony Antony
XFRMA_SEC_CTX was not cloned from the old to the new. Migrate this attribute during XFRMA_MSG_MIGRATE v1->v2: - return -ENOMEM on error Fixes: 80c9abaabf42 ("[XFRM]: Extension for dynamic update of endpoint address(es)") Signed-off-by: Antony Antony --- net/xfrm/xfrm

[PATCH v2 2/4] xfrm: clone XFRMA_REPLAY_ESN_VAL in xfrm_do_migrate

2020-08-26 Thread Antony Antony
XFRMA_REPLAY_ESN_VAL was not cloned completely from the old to the new. Migrate this attribute during XFRMA_MSG_MIGRATE v1->v2: - move curleft cloning to a seperate patch Fixes: af2f464e326e ("xfrm: Assign esn pointers when cloning a state") Signed-off-by: Antony Antony --- inclu

[PATCH v2 1/4] xfrm: clone XFRMA_SET_MARK in xfrm_do_migrate

2020-08-26 Thread Antony Antony
XFRMA_SET_MARK and XFRMA_SET_MARK_MASK was not cloned from the old to the new. Migrate these two attributes during XFRMA_MSG_MIGRATE Fixes: 9b42c1f179a6 ("xfrm: Extend the output_mark to support input direction and masking.") Signed-off-by: Antony Antony --- net/xfrm/xfrm_state.c | 1

Re: [PATCH ipsec-next v3] xfrm: add /proc/sys/core/net/xfrm_redact_secret

2020-08-23 Thread Antony Antony
On Thu, Aug 20, 2020 at 15:42:22 -0700, David Miller wrote: > From: Antony Antony > Date: Thu, 20 Aug 2020 20:35:49 +0200 > > > Redacting secret is a FIPS 140-2 requirement. > > Why not control this via the kernel lockdown mode rather than making > an ad-hoc API for t

[PATCH ipsec-next v3] xfrm: add /proc/sys/core/net/xfrm_redact_secret

2020-08-20 Thread Antony Antony
lls v1->v3 - replace spaces with tabs for consistancy Signed-off-by: Antony Antony --- Documentation/networking/xfrm_sysctl.rst | 7 +++ include/net/netns/xfrm.h | 1 + net/xfrm/Kconfig | 10 net/xfrm/xfrm_sysctl.c | 20 +++

[PATCH 3/3] xfrm: clone XFRMA_SEC_CTX during xfrm_do_migrate

2020-08-20 Thread Antony Antony
XFRMA_SEC_CTX was not cloned from the old to the new. Migrate this attribute during XFRMA_MSG_MIGRATE Signed-off-by: Antony Antony --- net/xfrm/xfrm_state.c | 28 1 file changed, 28 insertions(+) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index

[PATCH 2/3] xfrm: clone XFRMA_REPLAY_ESN_VAL in xfrm_do_migrate

2020-08-20 Thread Antony Antony
XFRMA_REPLAY_ESN_VAL was not cloned from the old to the new. Migrate this attribute during XFRMA_MSG_MIGRATE Signed-off-by: Antony Antony --- include/net/xfrm.h| 16 ++-- net/xfrm/xfrm_state.c | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/include/net

[PATCH 1/3] xfrm: clone XFRMA_SET_MARK during xfrm_do_migrate

2020-08-20 Thread Antony Antony
XFRMA_SET_MARK and XFRMA_SET_MARK_MASK was not cloned from the old to the new. Migrate these two attributes during XFRMA_MSG_MIGRATE Signed-off-by: Antony Antony --- net/xfrm/xfrm_state.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index

[PATCH ipsec-next v2] xfrm: add /proc/sys/core/net/xfrm_redact_secret

2020-08-20 Thread Antony Antony
gcm(aes)) 0x 96 the aead secret is redacted. /proc/sys/core/net/xfrm_redact_secret is a toggle. Once enabled, either at compile or via proc, it can not be disabled. Redacting secret is a FIPS 140-2 requirement. --- Signed-off-by: Antony Antony --- v1-

Re: [PATCH ipsec-next] xfrm: add /proc/sys/core/net/xfrm_redact_secret

2020-08-20 Thread Antony Antony
On Tue, Jul 28, 2020 at 21:09:10 +0200, Stephan Mueller wrote: > Am Dienstag, 28. Juli 2020, 17:47:30 CEST schrieb Antony Antony: > > Hi Antony, > > > when enabled, 1, redact XFRM SA secret in the netlink response to > > xfrm_get_sa() or dump all sa. > > > >

Re: [PATCH ipsec-next] xfrm: add /proc/sys/core/net/xfrm_redact_secret

2020-07-28 Thread Antony Antony
On Wed, Jul 29, 2020 at 02:22:52 +1000, Herbert Xu wrote: > On Tue, Jul 28, 2020 at 05:47:30PM +0200, Antony Antony wrote: > > when enabled, 1, redact XFRM SA secret in the netlink response to > > xfrm_get_sa() or dump all sa. > > > > e.g > > echo 1 > /proc/sy

[PATCH ipsec-next] xfrm: add /proc/sys/core/net/xfrm_redact_secret

2020-07-28 Thread Antony Antony
gcm(aes)) 0x 96 the aead secret is redacted. /proc/sys/core/net/xfrm_redact_secret is a toggle. Once enabled, either at compile or via proc, it can not be disabled. Redacting secret is a FIPS 140-2 requirement. Cc: Stephan Mueller Signed-off-by: Antony Ant

[PATCH] ip: xfrm if_id -ve value is error

2019-04-09 Thread Antony Antony
ned-off-by: Antony Antony --- ip/link_xfrm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ip/link_xfrm.c b/ip/link_xfrm.c index 79a902fd..7f66bad6 100644 --- a/ip/link_xfrm.c +++ b/ip/link_xfrm.c @@ -34,7 +34,9 @@ static int xfrm_parse_opt(struct link_util *lu, int argc, c

Re: [PATCH iproute2-next] ip xfrm: support setting/printing XFRMA_IF_ID attribute in states/policies

2019-04-05 Thread Antony Antony
ort for setting / displaying this attribute. > > > > Note that 0 is a valid value therefore set XFRMA_IF_ID if any value > > was provided in command line. > > > > Tested-by: Antony Antony > > Signed-off-by: Eyal Birger > > This is already handled b

Re: [iproute2] ip: support for xfrm interfaces

2019-04-05 Thread Antony Antony
Tested-by: Antony Antony On Fri, Apr 05, 2019 at 03:46:02PM -0400, Matt Ellison wrote: > I recently submitted v3 of the patch, please take a look there. great. I am testing v3 now. One comment. It seems to accept -ve value for if_id and quietly set to 0 may be throw an error for -ve val

Re: [iproute2] ip: support for xfrm interfaces

2019-04-04 Thread Antony Antony
Tested-by: Antony Antony Question: is it easy to add "if_id" to "ip link show" output? currently: ip link show ipsec0 4: ipsec0@eth1: mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/none da:25:61:2e:0c:98 brd ff:ff:ff:ff:ff:ff proposed:

Re: [ipsec-next,0/7] : Support multiple VTIs with the same src+dst pair

2018-01-05 Thread Antony Antony
Hi Lorenzo, I agree vti is very limiting! I am glad to hear about xfrmi. I saw two tunnels between gateways send traffic using VTI. So I am curious what is different in your case. Or are you dealing with something else? Here are a couple of outputs from libreswan testing this is the verbose ou

[PATCH] xfrm: fix xfrm_do_migrate() with AEAD e.g(AES-GCM)

2017-12-07 Thread Antony Antony
copy geniv when cloning the xfrm state. x->geniv was not copied to the new state and migration would fail. xfrm_do_migrate .. xfrm_state_clone() .. .. esp_init_aead() crypto_alloc_aead() crypto_alloc_tfm() crypto_find_alg() return EAGAIN and failed Signed-off-by: Ant

[PATCH v2 1/2] xfrm: extend MIGRATE with UDP encapsulation port

2017-06-06 Thread Antony Antony
UPDATE_SA message to migrate the IPsec SA. The change could be a change UDP encapsulation port, IP address, or both. Reported-by: Paul Wouters Signed-off-by: Antony Antony Reviewed-by: Richard Guy Briggs --- include/net/xfrm.h | 6 -- net/key/af_key.c | 2 +- net/xfrm/xfrm_policy.c

[PATCH v2 2/2] xfrm: add UDP encapsulation port in migrate message

2017-06-06 Thread Antony Antony
Add XFRMA_ENCAP, UDP encapsulation port, to km_migrate announcement to userland. Only add if XFRMA_ENCAP was in user migrate request. Signed-off-by: Antony Antony Reviewed-by: Richard Guy Briggs --- Changes in v2: - fixed pfkey_send_migrate, warning reported by kbuild test robot

[PATCH 2/2] xfrm: add UDP encapsulation port in migrate message

2017-06-05 Thread Antony Antony
Add XFRMA_ENCAP, UDP encapsulation port, to km_migrate announcement to userland. Only add if XFRMA_ENCAP was in user migrate request. Signed-off-by: Antony Antony --- include/net/xfrm.h | 5 +++-- net/key/af_key.c | 3 ++- net/xfrm/xfrm_policy.c | 2 +- net/xfrm/xfrm_state.c | 5

[PATCH 0/2] add udp encapsulation port to xfrm_do_migrate

2017-06-05 Thread Antony Antony
address, port, or both could change. With this patch xfrm_do_migrate will also support port change if necessary. Antony Antony (2): xfrm: extend MIGRATE with UDP encapsulation port xfrm: add UDP encapsulation port in migrate message include/net/xfrm.h | 11 +++ net/key/af_key.c

[PATCH 1/2] xfrm: extend MIGRATE with UDP encapsulation port

2017-06-05 Thread Antony Antony
UPDATE_SA message to migrate the IPsec SA. The change could be a change UDP encapsulation port, IP address, or both. Reported-by: Paul Wouters Signed-off-by: Antony Antony --- include/net/xfrm.h | 6 -- net/key/af_key.c | 2 +- net/xfrm/xfrm_policy.c | 11 --- net/xfrm

[PATCH v2] xfrm: fix state migration copy replay sequence numbers

2017-05-19 Thread Antony Antony
i=0xca1c282d,seq=0x1), length 136 IP 10.0.0.53.4500 > 10.0.10.46.4500: UDP-encap: ESP(spi=0x43ef462d,seq=0x7d2), length 136 IP 10.0.10.46.4500 > 10.0.0.53.4500: UDP-encap: ESP(spi=0xca1c282d,seq=0x2), length 136 Signed-off-by: Antony Antony --- Changes in v2: - include tcpdump output showi

[PATCH] xfrm: fix state migration replay sequence numbers

2017-05-18 Thread Antony Antony
i=0xca1c282d,seq=0x1), length 136 IP 10.0.0.53.4500 > 10.0.10.46.4500: UDP-encap: ESP(spi=0x43ef462d,seq=0x7d2), length 136 IP 10.0.10.46.4500 > 10.0.0.53.4500: UDP-encap: ESP(spi=0xca1c282d,seq=0x2), length 136 The attached patch fix it by copying replay and preplay. regards, -antony