From: Olaf Hering <olaf@aepfle.de>
To: kys@microsoft.com, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, Olaf Hering <olaf@aepfle.de>
Subject: [PATCH 2/3] tools: hv: fix checks for origin of netlink message in hv_vss_daemon
Date: Tue, 26 Mar 2013 16:28:28 +0100 [thread overview]
Message-ID: <1364311709-18228-2-git-send-email-olaf@aepfle.de> (raw)
In-Reply-To: <1364311709-18228-1-git-send-email-olaf@aepfle.de>
Similar to what commit 95a69adab9acfc3981c504737a2b6578e4d846ef ("tools:
hv: Netlink source address validation allows DoS") does in
hv_kvp_daemon, improve checks for origin of netlink connector message.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
tools/hv/hv_vss_daemon.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
index 2a03d0b..dc3eb1e 100644
--- a/tools/hv/hv_vss_daemon.c
+++ b/tools/hv/hv_vss_daemon.c
@@ -186,13 +186,19 @@ int main(void)
len = recvfrom(fd, vss_recv_buffer, sizeof(vss_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
+ if (addr.nl_pid) {
+ syslog(LOG_WARNING, "Received packet from untrusted pid:%u",
+ addr.nl_pid);
+ continue;
+ }
+
incoming_msg = (struct nlmsghdr *)vss_recv_buffer;
if (incoming_msg->nlmsg_type != NLMSG_DONE)
next prev parent reply other threads:[~2013-03-26 15:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 15:28 [PATCH 1/3] Tools: hv: fix warnings " Olaf Hering
2013-03-26 15:28 ` Olaf Hering [this message]
2013-03-26 18:45 ` [PATCH 2/3] tools: hv: fix checks for origin of netlink message " KY Srinivasan
2013-03-26 15:28 ` [PATCH 3/3] tools: hv: use getmntent " Olaf Hering
2013-03-26 18:45 ` KY Srinivasan
2013-03-26 18:44 ` [PATCH 1/3] Tools: hv: fix warnings " KY Srinivasan
2013-04-19 23:24 ` Greg KH
2013-04-21 22:32 ` KY Srinivasan
2013-04-22 1:13 ` Greg KH
2013-04-23 12:43 ` KY Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364311709-18228-2-git-send-email-olaf@aepfle.de \
--to=olaf@aepfle.de \
--cc=gregkh@linuxfoundation.org \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®