net: xfrm: Amend XFRMA_SEC_CTX nla_policy structure
stable inclusion from stable-v4.19.293 commit 996a40c68ba1fdedfd3b2a3dac1c0eac80611ebb category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I85XNK CVE: NA -------------------------------- commit d1e0e61d 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: cf5cb79f ("[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> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>
Loading
Please sign in to comment