Verify that netlink messages are coming from kernel.
authorMichał Januszewski <spock@gentoo.org>
Fri, 25 Feb 2011 21:24:46 +0000 (25 22:24 +0100)
committerMichał Januszewski <spock@gentoo.org>
Fri, 25 Feb 2011 21:24:46 +0000 (25 22:24 +0100)
Thanks to Nelson Elhage for reporting this problem.

v86.c

diff --git a/v86.c b/v86.c
index 5e4e69b..e065d84 100644 (file)
--- a/v86.c
+++ b/v86.c
@@ -129,6 +129,11 @@ int main(int argc, char *argv[])
 
                reply = (struct nlmsghdr *)buf;
 
+               /* Ignore requests coming from outside the kernel. */
+               if (reply->nlmsg_pid != 0) {
+                       continue;
+               }
+
                switch (reply->nlmsg_type) {
                case NLMSG_ERROR:
                        ulog(LOG_ERR, "Error message received.\n");