From: Thomas Graf Date: Tue, 3 May 2005 21:26:01 +0000 (-0700) Subject: [XFRM]: Prevent off-by-one access to xfrm_dispatch X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=526bdb80a23b2e10ed4ccc3fcf309c9118d892d6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [XFRM]: Prevent off-by-one access to xfrm_dispatch Makes the type > XFRM_MSG_MAX check behave correctly to protect access to xfrm_dispatch. Signed-off-by: Thomas Graf Signed-off-by: David S. Miller --- diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index f0df02ae68a4..4d19b9e65317 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h @@ -140,8 +140,9 @@ enum { XFRM_MSG_FLUSHPOLICY, #define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY - XFRM_MSG_MAX + __XFRM_MSG_MAX }; +#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) struct xfrm_user_tmpl { struct xfrm_id id;