Verify that netlink messages are coming from kernel.
[v86d.git] / 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");