<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/netlink/af_netlink.c, branch linux-3.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-10-02T17:38:55Z</updated>
<entry>
<title>netlink: fix possible spoofing from non-root processes</title>
<updated>2012-10-02T17:38:55Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
</author>
<published>2012-08-23T02:09:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2dfd8abf6c1f5ec34730dc72f2c4a4f31c6b8dc6'/>
<id>urn:sha1:2dfd8abf6c1f5ec34730dc72f2c4a4f31c6b8dc6</id>
<content type='text'>
[ Upstream commit 20e1db19db5d6b9e4e83021595eab0dc8f107bef ]

Non-root user-space processes can send Netlink messages to other
processes that are well-known for being subscribed to Netlink
asynchronous notifications. This allows ilegitimate non-root
process to send forged messages to Netlink subscribers.

The userspace process usually verifies the legitimate origin in
two ways:

a) Socket credentials. If UID != 0, then the message comes from
   some ilegitimate process and the message needs to be dropped.

b) Netlink portID. In general, portID == 0 means that the origin
   of the messages comes from the kernel. Thus, discarding any
   message not coming from the kernel.

However, ctnetlink sets the portID in event messages that has
been triggered by some user-space process, eg. conntrack utility.
So other processes subscribed to ctnetlink events, eg. conntrackd,
know that the event was triggered by some user-space action.

Neither of the two ways to discard ilegitimate messages coming
from non-root processes can help for ctnetlink.

This patch adds capability validation in case that dst_pid is set
in netlink_sendmsg(). This approach is aggressive since existing
applications using any Netlink bus to deliver messages between
two user-space processes will break. Note that the exception is
NETLINK_USERSOCK, since it is reserved for netlink-to-netlink
userspace communication.

Still, if anyone wants that his Netlink bus allows netlink-to-netlink
userspace, then they can set NL_NONROOT_SEND. However, by default,
I don't think it makes sense to allow to use NETLINK_ROUTE to
communicate two processes that are sending no matter what information
that is not related to link/neighbouring/routing. They should be using
NETLINK_USERSOCK instead for that.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>af_netlink: force credentials passing [CVE-2012-3520]</title>
<updated>2012-10-02T17:38:55Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2012-08-21T06:21:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7d34ab836a0130db7643b55eb8713726ef704b52'/>
<id>urn:sha1:7d34ab836a0130db7643b55eb8713726ef704b52</id>
<content type='text'>
[ Upstream commit e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea ]

Pablo Neira Ayuso discovered that avahi and
potentially NetworkManager accept spoofed Netlink messages because of a
kernel bug.  The kernel passes all-zero SCM_CREDENTIALS ancillary data
to the receiver if the sender did not provide such data, instead of not
including any such data at all or including the correct data from the
peer (as it is the case with AF_UNIX).

This bug was introduced in commit 16e572626961
(af_unix: dont send SCM_CREDENTIALS by default)

This patch forces passing credentials for netlink, as
before the regression.

Another fix would be to not add SCM_CREDENTIALS in
netlink messages if not provided by the sender, but it
might break some programs.

With help from Florian Weimer &amp; Petr Matousek

This issue is designated as CVE-2012-3520

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Petr Matousek &lt;pmatouse@redhat.com&gt;
Cc: Florian Weimer &lt;fweimer@redhat.com&gt;
Cc: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>af_netlink: drop_monitor/dropwatch friendly</title>
<updated>2012-04-24T04:35:14Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2012-04-22T21:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bfb253c9b277acd9f85b1886ff82b1dd5fbff2ae'/>
<id>urn:sha1:bfb253c9b277acd9f85b1886ff82b1dd5fbff2ae</id>
<content type='text'>
Need to consume_skb() instead of kfree_skb() in netlink_dump() and
netlink_unicast_kernel() to avoid false dropwatch positives.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>af_netlink: cleanups</title>
<updated>2012-04-24T04:35:14Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2012-04-22T21:30:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=658cb354edf0f16cc5a2a2bda3ec5be1bba25e6d'/>
<id>urn:sha1:658cb354edf0f16cc5a2a2bda3ec5be1bba25e6d</id>
<content type='text'>
netlink_destroy_callback() move to avoid forward reference

CodingStyle cleanups

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: dont drop packet but consume it</title>
<updated>2012-04-19T18:23:55Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2012-04-19T02:24:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8460c00f6e2fb8e05421a277fee62fe09803f7a7'/>
<id>urn:sha1:8460c00f6e2fb8e05421a277fee62fe09803f7a7</id>
<content type='text'>
When we need to clone skb, we dont drop a packet.
Call consume_skb() to not confuse dropwatch.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: fix races after skb queueing</title>
<updated>2012-04-06T08:21:06Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2012-04-05T22:17:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a7e7c2ad540e54c75489a70137bf0ec15d3a127'/>
<id>urn:sha1:4a7e7c2ad540e54c75489a70137bf0ec15d3a127</id>
<content type='text'>
As soon as an skb is queued into socket receive_queue, another thread
can consume it, so we are not allowed to reference skb anymore, or risk
use after free.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: allow to pass data pointer to netlink_dump_start() callback</title>
<updated>2012-02-26T19:10:44Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
</author>
<published>2012-02-24T14:30:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7175c883071515f0d4c1cece2646203b8a5a7415'/>
<id>urn:sha1:7175c883071515f0d4c1cece2646203b8a5a7415</id>
<content type='text'>
This patch allows you to pass a data pointer that can be
accessed from the dump callback.

Netfilter is going to use this patch to provide filtered dumps
to user-space. This is specifically interesting in ctnetlink that
may handle lots of conntrack entries. We can save precious
cycles by skipping the conversion to TLV format of conntrack
entries that are not interesting for user-space.

More specifically, ctnetlink will include one operation to allow
to filter the dumping of conntrack entries by ctmark values.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: add netlink_dump_control structure for netlink_dump_start()</title>
<updated>2012-02-26T19:10:06Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
</author>
<published>2012-02-24T14:30:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=80d326fab534a5380e8f6e509a0b9076655a9670'/>
<id>urn:sha1:80d326fab534a5380e8f6e509a0b9076655a9670</id>
<content type='text'>
Davem considers that the argument list of this interface is getting
out of control. This patch tries to address this issue following
his proposal:

struct netlink_dump_control c = { .dump = dump, .done = done, ... };

netlink_dump_start(..., &amp;c);

Suggested by David S. Miller.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Deinline __nlmsg_put and genlmsg_put. -7k code on i386 defconfig.</title>
<updated>2012-01-30T20:22:06Z</updated>
<author>
<name>Denys Vlasenko</name>
</author>
<published>2012-01-30T20:22:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a46621a3a8f24557201a7ef62de151c812f8985c'/>
<id>urn:sha1:a46621a3a8f24557201a7ef62de151c812f8985c</id>
<content type='text'>
   text	   data	    bss	    dec	    hex	filename
8455963	 532732	1810804	10799499 a4c98b	vmlinux.o.before
8448899	 532732	1810804	10792435 a4adf3	vmlinux.o

This change also removes commented-out copy of __nlmsg_put
which was last touched in 2005 with "Enable once all users
have been converted" comment on top.

Changes in v2: rediffed against net-next.

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: Undo const marker in netlink_is_kernel().</title>
<updated>2011-12-23T22:33:03Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2011-12-23T22:33:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=035c4c16bea2814890c64c657d177e91cec1f473'/>
<id>urn:sha1:035c4c16bea2814890c64c657d177e91cec1f473</id>
<content type='text'>
We can't do this without propagating the const to nlk_sk()
too, otherwise:

net/netlink/af_netlink.c: In function ‘netlink_is_kernel’:
net/netlink/af_netlink.c:103:2: warning: passing argument 1 of ‘nlk_sk’ discards ‘const’ qualifier from pointer target type [enabled by default]
net/netlink/af_netlink.c:96:36: note: expected ‘struct sock *’ but argument is of type ‘const struct sock *’

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
