http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1185

--- a/udevd.c
+++ b/udevd.c
@@ -734,16 +734,34 @@ static struct udevd_uevent_msg *get_netl
 	struct udevd_uevent_msg *msg;
 	int bufpos;
 	ssize_t size;
+	struct sockaddr_nl snl;
+	struct msghdr smsg;
+	struct iovec iov;
 	static char buffer[UEVENT_BUFFER_SIZE+512];
 	char *pos;
 
-	size = recv(uevent_netlink_sock, &buffer, sizeof(buffer), 0);
+	iov.iov_base = buffer;
+	iov.iov_len = sizeof(buffer);
+
+	memset(&smsg, 0x00, sizeof(struct msghdr));
+	smsg.msg_name = &snl;
+	smsg.msg_namelen = sizeof(struct sockaddr_nl);
+	smsg.msg_iov = &iov;
+	smsg.msg_iovlen = 1;
+
+	size = recvmsg(uevent_netlink_sock, &smsg, 0);
 	if (size <  0) {
 		if (errno != EINTR)
 			err("unable to receive kernel netlink message: %s", strerror(errno));
 		return NULL;
 	}
 
+	if ((snl.nl_groups != 1) || (snl.nl_pid != 0)) {
+		info("ignored netlink message from invalid group/sender %d/%d\n",
+		     snl.nl_groups, snl.nl_pid);
+		return NULL;
+	}
+
 	if ((size_t)size > sizeof(buffer)-1)
 		size = sizeof(buffer)-1;
 	buffer[size] = '\0';
