Skip to contentSkip to conversation

Prevent off-by-one access to xfrm_dispatch

PATCH Applied Thomas Graf 2 participants 2 messages May 1, 2005 – May 3, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Prevent off-by-one access to xfrm_dispatch

Makes the type > XFRM_MSG_MAX check behave correctly to protect access to xfrm_dispatch.

include/linux/xfrm.h +2 -1
@@ -140,8 +140,9 @@
 	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;