* [PATCH] Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
@ 2022-03-03 14:55 kailueke
2022-03-07 8:22 ` Steffen Klassert
0 siblings, 1 reply; 4+ messages in thread
From: kailueke @ 2022-03-03 14:55 UTC (permalink / raw)
To: netdev, Steffen Klassert, Jakub Kicinski, Paul Chaignon,
Eyal Birger
From: Kai Lueke <kailueke@linux.microsoft.com>
This reverts commit 68ac0f3810e76a853b5f7b90601a05c3048b8b54 because ID
0 was meant to be used for configuring the policy/state without
matching for a specific interface (e.g., Cilium is affected, see
https://github.com/cilium/cilium/pull/18789 and
https://github.com/cilium/cilium/pull/19019).
Signed-off-by: Kai Lueke <kailueke@linux.microsoft.com>
---
net/xfrm/xfrm_user.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 8cd6c8129004..be89a8ac54a4 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -630,13 +630,8 @@ static struct xfrm_state *xfrm_state_construct(struct net *net,
xfrm_smark_init(attrs, &x->props.smark);
- if (attrs[XFRMA_IF_ID]) {
+ if (attrs[XFRMA_IF_ID])
x->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
- if (!x->if_id) {
- err = -EINVAL;
- goto error;
- }
- }
err = __xfrm_init_state(x, false, attrs[XFRMA_OFFLOAD_DEV]);
if (err)
@@ -1432,13 +1427,8 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh,
mark = xfrm_mark_get(attrs, &m);
- if (attrs[XFRMA_IF_ID]) {
+ if (attrs[XFRMA_IF_ID])
if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
- if (!if_id) {
- err = -EINVAL;
- goto out_noput;
- }
- }
if (p->info.seq) {
x = xfrm_find_acq_byseq(net, mark, p->info.seq);
@@ -1751,13 +1741,8 @@ static struct xfrm_policy *xfrm_policy_construct(struct net *net, struct xfrm_us
xfrm_mark_get(attrs, &xp->mark);
- if (attrs[XFRMA_IF_ID]) {
+ if (attrs[XFRMA_IF_ID])
xp->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
- if (!xp->if_id) {
- err = -EINVAL;
- goto error;
- }
- }
return xp;
error:
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
2022-03-03 14:55 [PATCH] Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0" kailueke
@ 2022-03-07 8:22 ` Steffen Klassert
2022-03-14 12:19 ` Kai Lueke
0 siblings, 1 reply; 4+ messages in thread
From: Steffen Klassert @ 2022-03-07 8:22 UTC (permalink / raw)
To: kailueke; +Cc: netdev, Jakub Kicinski, Paul Chaignon, Eyal Birger
On Thu, Mar 03, 2022 at 03:55:10PM +0100, kailueke@linux.microsoft.com wrote:
> From: Kai Lueke <kailueke@linux.microsoft.com>
>
> This reverts commit 68ac0f3810e76a853b5f7b90601a05c3048b8b54 because ID
> 0 was meant to be used for configuring the policy/state without
> matching for a specific interface (e.g., Cilium is affected, see
> https://github.com/cilium/cilium/pull/18789 and
> https://github.com/cilium/cilium/pull/19019).
>
> Signed-off-by: Kai Lueke <kailueke@linux.microsoft.com>
Applied, thanks Kai!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
2022-03-07 8:22 ` Steffen Klassert
@ 2022-03-14 12:19 ` Kai Lueke
2022-03-14 12:27 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Kai Lueke @ 2022-03-14 12:19 UTC (permalink / raw)
To: stable; +Cc: Steffen Klassert, netdev, Jakub Kicinski, Paul Chaignon,
Eyal Birger
I forgot to CC stable@ when submitting, doing it now:
Can this be picked for the next round of stable kernels (down to 5.10)?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a3d9001b4e287fc043e5539d03d71a32ab114bcb
Thanks,
Kai
On 07.03.2022 09:22, Steffen Klassert wrote:
> On Thu, Mar 03, 2022 at 03:55:10PM +0100, kailueke@linux.microsoft.com wrote:
>> From: Kai Lueke <kailueke@linux.microsoft.com>
>>
>> This reverts commit 68ac0f3810e76a853b5f7b90601a05c3048b8b54 because ID
>> 0 was meant to be used for configuring the policy/state without
>> matching for a specific interface (e.g., Cilium is affected, see
>> https://github.com/cilium/cilium/pull/18789 and
>> https://github.com/cilium/cilium/pull/19019).
>>
>> Signed-off-by: Kai Lueke <kailueke@linux.microsoft.com>
> Applied, thanks Kai!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
2022-03-14 12:19 ` Kai Lueke
@ 2022-03-14 12:27 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2022-03-14 12:27 UTC (permalink / raw)
To: Kai Lueke
Cc: stable, Steffen Klassert, netdev, Jakub Kicinski, Paul Chaignon,
Eyal Birger
On Mon, Mar 14, 2022 at 01:19:19PM +0100, Kai Lueke wrote:
> I forgot to CC stable@ when submitting, doing it now:
> Can this be picked for the next round of stable kernels (down to 5.10)?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a3d9001b4e287fc043e5539d03d71a32ab114bcb
>
> Thanks,
> Kai
>
> On 07.03.2022 09:22, Steffen Klassert wrote:
> > On Thu, Mar 03, 2022 at 03:55:10PM +0100, kailueke@linux.microsoft.com wrote:
> >> From: Kai Lueke <kailueke@linux.microsoft.com>
> >>
> >> This reverts commit 68ac0f3810e76a853b5f7b90601a05c3048b8b54 because ID
> >> 0 was meant to be used for configuring the policy/state without
> >> matching for a specific interface (e.g., Cilium is affected, see
> >> https://github.com/cilium/cilium/pull/18789 and
> >> https://github.com/cilium/cilium/pull/19019).
> >>
> >> Signed-off-by: Kai Lueke <kailueke@linux.microsoft.com>
> > Applied, thanks Kai!
I will pick it up for the next round of releases after these go out.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-14 12:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-03 14:55 [PATCH] Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0" kailueke
2022-03-07 8:22 ` Steffen Klassert
2022-03-14 12:19 ` Kai Lueke
2022-03-14 12:27 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).