From: Mark Huang Date: Thu, 27 Jan 2005 20:43:12 +0000 (+0000) Subject: - merge revision 1.6 X-Git-Tag: planetlab-3_0-rc10~28 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8e81ac31830f1bc045a2db729bc6f1c010cc4227;p=linux-2.6.git - 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 --- 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