[PATCH net] xfrm: fix a small bug in frm_sa_len()

Subsystems: networking [general], networking [ipsec], the rest

STALE1770d

2 messages, 2 authors, 2021-12-10 · open the first message on its own page

[PATCH net] xfrm: fix a small bug in frm_sa_len()

From: Eric Dumazet <hidden>
Date: 2021-12-08 20:20:25

From: Eric Dumazet <redacted>

copy_user_offload() will actually push a struct struct xfrm_user_offload,
which is different than (struct xfrm_state *)->xso
(struct xfrm_state_offload)

Fixes: d77e38e612a01 ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Eric Dumazet <redacted>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 7c36cc1f3d79c2df16a35077031b74bd2dce730a..0a2d2bae28316f4a43cec96c3e698b42f6b6864b 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -3058,7 +3058,7 @@ static inline unsigned int xfrm_sa_len(struct xfrm_state *x)
 	if (x->props.extra_flags)
 		l += nla_total_size(sizeof(x->props.extra_flags));
 	if (x->xso.dev)
-		 l += nla_total_size(sizeof(x->xso));
+		 l += nla_total_size(sizeof(struct xfrm_user_offload));
 	if (x->props.smark.v | x->props.smark.m) {
 		l += nla_total_size(sizeof(x->props.smark.v));
 		l += nla_total_size(sizeof(x->props.smark.m));
-- 
2.34.1.400.ga245620fadb-goog

Re: [PATCH net] xfrm: fix a small bug in frm_sa_len()

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: 2021-12-10 12:33:17

On Wed, Dec 08, 2021 at 12:20:19PM -0800, Eric Dumazet wrote:
From: Eric Dumazet <redacted>

copy_user_offload() will actually push a struct struct xfrm_user_offload,
which is different than (struct xfrm_state *)->xso
(struct xfrm_state_offload)

Fixes: d77e38e612a01 ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Eric Dumazet <redacted>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Applied to the ipsec tree, thanks Eric!

Note: I fixed a typo in the subject 'frm_sa_len -> xfrm_sa_len'
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help