Files
linux/net/xfrm
Xin Long 171d449a02 xfrm: fix uctx len check in verify_sec_ctx_len
It's not sufficient to do 'uctx->len != (sizeof(struct xfrm_user_sec_ctx) +
uctx->ctx_len)' check only, as uctx->len may be greater than nla_len(rt),
in which case it will cause slab-out-of-bounds when accessing uctx->ctx_str
later.

This patch is to fix it by return -EINVAL when uctx->len > nla_len(rt).

Fixes: df71837d50 ("[LSM-IPSec]: Security association restriction.")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2020-02-12 11:06:32 +01:00
..
2019-12-09 09:59:07 +01:00
2019-12-09 09:59:07 +01:00
2018-10-31 08:54:16 -07:00
2019-07-30 14:21:32 -07:00
2019-12-09 09:59:07 +01:00
2019-12-09 09:59:07 +01:00