]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: enforce validity of offload input flags
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 8 Feb 2022 14:14:32 +0000 (16:14 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 9 Feb 2022 08:00:40 +0000 (09:00 +0100)
commitff9d23a1552490b4aca86ae3750f0401c875fd47
treeda1b014964e0874d908fae7ad53732d06281581d
parentb39374520618a8e80ed495fd4c48d02bb4bbbcf7
xfrm: enforce validity of offload input flags

struct xfrm_user_offload has flags variable that received user input,
but kernel didn't check if valid bits were provided. It caused a situation
where not sanitized input was forwarded directly to the drivers.

For example, XFRM_OFFLOAD_IPV6 define that was exposed, was used by
strongswan, but not implemented in the kernel at all.

As a solution, check and sanitize input flags to forward
XFRM_OFFLOAD_INBOUND to the drivers.

Fixes: 2ed61e84269f ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
include/uapi/linux/xfrm.h
net/xfrm/xfrm_device.c