]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: state and policy should fail if XFRMA_IF_ID 0
authorAntony Antony <antony.antony@secunet.com>
Sun, 12 Dec 2021 10:35:00 +0000 (11:35 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 17 Dec 2021 06:17:35 +0000 (07:17 +0100)
commit73d26648dc36d64b59f0f375fa9d575882bdddb8
tree3c0a67f364771746a0ca533513fc7d2da0d92464
parente134b7e872db626d9e0c521f1013540c8b435e95
xfrm: state and policy should fail if XFRMA_IF_ID 0

xfrm ineterface does not allow xfrm if_id = 0
fail to create or update xfrm state and policy.

With this commit:
 ip xfrm policy add src 192.0.2.1 dst 192.0.2.2 dir out if_id 0
 RTNETLINK answers: Invalid argument

 ip xfrm state add src 192.0.2.1 dst 192.0.2.2 proto esp spi 1 \
            reqid 1 mode tunnel aead 'rfc4106(gcm(aes))' \
            0x1111111111111111111111111111111111111111 96 if_id 0
 RTNETLINK answers: Invalid argument

v1->v2 change:
 - add Fixes: tag

Fixes: 23a4e32a6468 ("xfrm: fix disable_xfrm sysctl when used on xfrm interfaces")
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_user.c