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-Tag: v2.6.12-rc4~117^2~23^2~23 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=526bdb80a23b2e10ed4ccc3fcf309c9118d892d6;p=linux-2.6 [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 f0df02ae68..4d19b9e653 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;