android_kernel_motorola_sm6225/net/xfrm
Lin Ma 996a40c68b net: xfrm: Amend XFRMA_SEC_CTX nla_policy structure
commit d1e0e61d617ba17aa516db707aa871387566bbf7 upstream.

According to all consumers code of attrs[XFRMA_SEC_CTX], like

* verify_sec_ctx_len(), convert to xfrm_user_sec_ctx*
* xfrm_state_construct(), call security_xfrm_state_alloc whose prototype
is int security_xfrm_state_alloc(.., struct xfrm_user_sec_ctx *sec_ctx);
* copy_from_user_sec_ctx(), convert to xfrm_user_sec_ctx *
...

It seems that the expected parsing result for XFRMA_SEC_CTX should be
structure xfrm_user_sec_ctx, and the current xfrm_sec_ctx is confusing
and misleading (Luckily, they happen to have same size 8 bytes).

This commit amend the policy structure to xfrm_user_sec_ctx to avoid
ambiguity.

Fixes: cf5cb79f69 ("[XFRM] netlink: Establish an attribute policy")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-30 16:31:50 +02:00
..
Kconfig
Makefile xfrm: interface: rename xfrm_interface.c to xfrm_interface_core.c 2023-08-30 16:31:48 +02:00
xfrm_algo.c
xfrm_device.c xfrm: enforce validity of offload input flags 2022-03-08 19:04:07 +01:00
xfrm_hash.c
xfrm_hash.h
xfrm_input.c xfrm: Fix oops in xfrm_replay_advance_bmp 2021-02-03 23:23:25 +01:00
xfrm_interface_core.c xfrm: fix slab-use-after-free in decode_session6 2023-08-30 16:31:48 +02:00
xfrm_ipcomp.c xfrm: Update ipcomp_scratches with NULL when freed 2022-10-26 13:19:37 +02:00
xfrm_output.c xfrm: fix a NULL-ptr deref in xfrm_local_error 2020-06-03 08:19:45 +02:00
xfrm_policy.c xfrm: Check if_id in inbound policy/secpath match 2023-06-09 10:23:58 +02:00
xfrm_proc.c
xfrm_replay.c
xfrm_state.c xfrm: Fix xfrm migrate issues when address family changes 2022-03-23 09:10:40 +01:00
xfrm_sysctl.c
xfrm_user.c net: xfrm: Amend XFRMA_SEC_CTX nla_policy structure 2023-08-30 16:31:50 +02:00