From 8e81ac31830f1bc045a2db729bc6f1c010cc4227 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Thu, 27 Jan 2005 20:43:12 +0000 Subject: [PATCH] - merge revision 1.6 date: 2005/01/19 22:42:27; author: mef; state: Exp; lines: +4 -0 Fixes CAN-2004 security reports 1016, 1017, and 1068 --- include/linux/socket.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/socket.h b/include/linux/socket.h index 602d03b5d..f30253c38 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -90,6 +90,10 @@ struct cmsghdr { (struct cmsghdr *)(ctl) : \ (struct cmsghdr *)NULL) #define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen) +#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \ + (cmsg)->cmsg_len <= (unsigned long) \ + ((mhdr)->msg_controllen - \ + ((char *)(cmsg) - (char *)(mhdr)->msg_control))) /* * This mess will go away with glibc -- 2.47.0