From: MichaƂ Januszewski Date: Fri, 25 Feb 2011 21:24:46 +0000 (+0100) Subject: Verify that netlink messages are coming from kernel. X-Git-Tag: v86d-0.1.10~1 X-Git-Url: https://repo.or.cz/w/v86d.git/commitdiff_plain/f9abfd412639286c3143e93e8ba2c9598dfba640?hp=982d5ea17847d1e27bb650d9a3205a368b197131 Verify that netlink messages are coming from kernel. Thanks to Nelson Elhage for reporting this problem. --- diff --git a/v86.c b/v86.c index 5e4e69b..e065d84 100644 --- 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");