[25463] in Source-Commits
/svn/athena r25000 - in trunk/debathena/debathena/metrics: debathena/metrics debian
daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Wed Mar 2 20:03:44 2011
Date: Wed, 2 Mar 2011 20:03:36 -0500
From: Geoffrey Thomas <geofft@MIT.EDU>
Message-Id: <201103030103.p2313acj005580@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: geofft
Date: 2011-03-02 20:03:36 -0500 (Wed, 02 Mar 2011)
New Revision: 25000
Modified:
trunk/debathena/debathena/metrics/debathena/metrics/connector.pyx
trunk/debathena/debathena/metrics/debian/changelog
Log:
In metrics:
* Require that netlink messages come from the kernel, not from userspace.
Patch by Nelson Elhage.
Modified: trunk/debathena/debathena/metrics/debathena/metrics/connector.pyx
===================================================================
--- trunk/debathena/debathena/metrics/debathena/metrics/connector.pyx 2011-03-03 00:52:52 UTC (rev 24999)
+++ trunk/debathena/debathena/metrics/debathena/metrics/connector.pyx 2011-03-03 01:03:36 UTC (rev 25000)
@@ -270,15 +270,17 @@
cdef proc_event *ev
cdef object ret
- from_addr.nl_family = AF_NETLINK
- from_addr.nl_groups = CN_IDX_PROC
- from_addr.nl_pid = 1
s = sizeof(from_addr)
- if recvfrom(self.sock, buf, sizeof(buf), 0,
- <sockaddr *>&from_addr, &s) == -1:
- raise IOError(errno, strerror(errno))
+ while True:
+ if recvfrom(self.sock, buf, sizeof(buf), 0,
+ <sockaddr *>&from_addr, &s) == -1:
+ raise IOError(errno, strerror(errno))
+ if from_addr.nl_pid != 0:
+ # Ignore messages that don't come from the kernel
+ continue
+
ev = <proc_event *>((<cn_msg *>NLMSG_DATA(buf)).data)
if ev.what == PROC_EVENT_FORK:
Modified: trunk/debathena/debathena/metrics/debian/changelog
===================================================================
--- trunk/debathena/debathena/metrics/debian/changelog 2011-03-03 00:52:52 UTC (rev 24999)
+++ trunk/debathena/debathena/metrics/debian/changelog 2011-03-03 01:03:36 UTC (rev 25000)
@@ -1,3 +1,10 @@
+debathena-metrics (1.6) unstable; urgency=low
+
+ * Require that netlink messages come from the kernel, not from userspace.
+ Patch by Nelson Elhage.
+
+ -- Geoffrey Thomas <geofft@mit.edu> Wed, 02 Mar 2011 20:02:12 -0500
+
debathena-metrics (1.5.1) unstable; urgency=low
* Update the blacklist