]> git.baikalelectronics.ru Git - kernel.git/commit
af_netlink: force credentials passing [CVE-2012-3520]
authorEric Dumazet <edumazet@google.com>
Tue, 21 Aug 2012 06:21:17 +0000 (06:21 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Aug 2012 21:53:01 +0000 (14:53 -0700)
commit329635d33fded7215b3cf00006319783e70ec56a
treed3a95cc25dd504fecc807dbb8a9e9c3501c90edf
parent16e54aa3e427e872d4922b18b800a1eb57a965fd
af_netlink: force credentials passing [CVE-2012-3520]

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 5406f96a2870
(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 & Petr Matousek

This issue is designated as CVE-2012-3520

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Petr Matousek <pmatouse@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/scm.h
net/netlink/af_netlink.c
net/unix/af_unix.c