<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/net/core, branch v2.6.38</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge branch 'master' of /home/davem/src/GIT/linux-2.6/</title>
<updated>2011-03-10T22:00:44+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-03-10T22:00:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bef6e7e76868ab454d5e83635a4a7a1961c74fb5'/>
<id>bef6e7e76868ab454d5e83635a4a7a1961c74fb5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>net: don't allow CAP_NET_ADMIN to load non-netdev kernel modules</title>
<updated>2011-03-09T23:25:19+00:00</updated>
<author>
<name>Vasiliy Kulikov</name>
<email>segoon@openwall.com</email>
</author>
<published>2011-03-01T21:33:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8909c9ad8ff03611c9c96c9a92656213e4bb495b'/>
<id>8909c9ad8ff03611c9c96c9a92656213e4bb495b</id>
<content type='text'>
Since a8f80e8ff94ecba629542d9b4b5f5a8ee3eb565c any process with
CAP_NET_ADMIN may load any module from /lib/modules/.  This doesn't mean
that CAP_NET_ADMIN is a superset of CAP_SYS_MODULE as modules are
limited to /lib/modules/**.  However, CAP_NET_ADMIN capability shouldn't
allow anybody load any module not related to networking.

This patch restricts an ability of autoloading modules to netdev modules
with explicit aliases.  This fixes CVE-2011-1019.

Arnd Bergmann suggested to leave untouched the old pre-v2.6.32 behavior
of loading netdev modules by name (without any prefix) for processes
with CAP_SYS_MODULE to maintain the compatibility with network scripts
that use autoloading netdev modules by aliases like "eth0", "wlan0".

Currently there are only three users of the feature in the upstream
kernel: ipip, ip_gre and sit.

    root@albatros:~# capsh --drop=$(seq -s, 0 11),$(seq -s, 13 34) --
    root@albatros:~# grep Cap /proc/$$/status
    CapInh:	0000000000000000
    CapPrm:	fffffff800001000
    CapEff:	fffffff800001000
    CapBnd:	fffffff800001000
    root@albatros:~# modprobe xfs
    FATAL: Error inserting xfs
    (/lib/modules/2.6.38-rc6-00001-g2bf4ca3/kernel/fs/xfs/xfs.ko): Operation not permitted
    root@albatros:~# lsmod | grep xfs
    root@albatros:~# ifconfig xfs
    xfs: error fetching interface information: Device not found
    root@albatros:~# lsmod | grep xfs
    root@albatros:~# lsmod | grep sit
    root@albatros:~# ifconfig sit
    sit: error fetching interface information: Device not found
    root@albatros:~# lsmod | grep sit
    root@albatros:~# ifconfig sit0
    sit0      Link encap:IPv6-in-IPv4
	      NOARP  MTU:1480  Metric:1

    root@albatros:~# lsmod | grep sit
    sit                    10457  0
    tunnel4                 2957  1 sit

For CAP_SYS_MODULE module loading is still relaxed:

    root@albatros:~# grep Cap /proc/$$/status
    CapInh:	0000000000000000
    CapPrm:	ffffffffffffffff
    CapEff:	ffffffffffffffff
    CapBnd:	ffffffffffffffff
    root@albatros:~# ifconfig xfs
    xfs: error fetching interface information: Device not found
    root@albatros:~# lsmod | grep xfs
    xfs                   745319  0

Reference: https://lkml.org/lkml/2011/2/24/203

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Signed-off-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Kees Cook &lt;kees.cook@canonical.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since a8f80e8ff94ecba629542d9b4b5f5a8ee3eb565c any process with
CAP_NET_ADMIN may load any module from /lib/modules/.  This doesn't mean
that CAP_NET_ADMIN is a superset of CAP_SYS_MODULE as modules are
limited to /lib/modules/**.  However, CAP_NET_ADMIN capability shouldn't
allow anybody load any module not related to networking.

This patch restricts an ability of autoloading modules to netdev modules
with explicit aliases.  This fixes CVE-2011-1019.

Arnd Bergmann suggested to leave untouched the old pre-v2.6.32 behavior
of loading netdev modules by name (without any prefix) for processes
with CAP_SYS_MODULE to maintain the compatibility with network scripts
that use autoloading netdev modules by aliases like "eth0", "wlan0".

Currently there are only three users of the feature in the upstream
kernel: ipip, ip_gre and sit.

    root@albatros:~# capsh --drop=$(seq -s, 0 11),$(seq -s, 13 34) --
    root@albatros:~# grep Cap /proc/$$/status
    CapInh:	0000000000000000
    CapPrm:	fffffff800001000
    CapEff:	fffffff800001000
    CapBnd:	fffffff800001000
    root@albatros:~# modprobe xfs
    FATAL: Error inserting xfs
    (/lib/modules/2.6.38-rc6-00001-g2bf4ca3/kernel/fs/xfs/xfs.ko): Operation not permitted
    root@albatros:~# lsmod | grep xfs
    root@albatros:~# ifconfig xfs
    xfs: error fetching interface information: Device not found
    root@albatros:~# lsmod | grep xfs
    root@albatros:~# lsmod | grep sit
    root@albatros:~# ifconfig sit
    sit: error fetching interface information: Device not found
    root@albatros:~# lsmod | grep sit
    root@albatros:~# ifconfig sit0
    sit0      Link encap:IPv6-in-IPv4
	      NOARP  MTU:1480  Metric:1

    root@albatros:~# lsmod | grep sit
    sit                    10457  0
    tunnel4                 2957  1 sit

For CAP_SYS_MODULE module loading is still relaxed:

    root@albatros:~# grep Cap /proc/$$/status
    CapInh:	0000000000000000
    CapPrm:	ffffffffffffffff
    CapEff:	ffffffffffffffff
    CapBnd:	ffffffffffffffff
    root@albatros:~# ifconfig xfs
    xfs: error fetching interface information: Device not found
    root@albatros:~# lsmod | grep xfs
    xfs                   745319  0

Reference: https://lkml.org/lkml/2011/2/24/203

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Signed-off-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Kees Cook &lt;kees.cook@canonical.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pktgen: fix errata in show results</title>
<updated>2011-03-09T22:11:00+00:00</updated>
<author>
<name>Daniel Turull</name>
<email>daniel.turull@gmail.com</email>
</author>
<published>2011-03-09T22:11:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=03a14ab134f4811ab1475f07b1305ccaf38b690f'/>
<id>03a14ab134f4811ab1475f07b1305ccaf38b690f</id>
<content type='text'>
The units in show_results in pktgen were not correct.
The results are in usec but it was displayed nsec.

Reported-by: Jong-won Lee &lt;ljw@handong.edu&gt;
Signed-off-by: Daniel Turull &lt;daniel.turull@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The units in show_results in pktgen were not correct.
The results are in usec but it was displayed nsec.

Reported-by: Jong-won Lee &lt;ljw@handong.edu&gt;
Signed-off-by: Daniel Turull &lt;daniel.turull@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: handle addr_type of 0 properly</title>
<updated>2011-02-25T21:58:54+00:00</updated>
<author>
<name>Hagen Paul Pfeifer</name>
<email>hagen@jauu.net</email>
</author>
<published>2011-02-25T21:58:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5aca1a9e880e06bb7e5fd553a86a330ae7e218b5'/>
<id>5aca1a9e880e06bb7e5fd553a86a330ae7e218b5</id>
<content type='text'>
addr_type of 0 means that the type should be adopted from from_dev and
not from __hw_addr_del_multiple(). Unfortunately it isn't so and
addr_type will always be considered. Fix this by implementing the
considered and documented behavior.

Signed-off-by: Hagen Paul Pfeifer &lt;hagen@jauu.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
addr_type of 0 means that the type should be adopted from from_dev and
not from __hw_addr_del_multiple(). Unfortunately it isn't so and
addr_type will always be considered. Fix this by implementing the
considered and documented behavior.

Signed-off-by: Hagen Paul Pfeifer &lt;hagen@jauu.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: deinit automatic LIST_HEAD</title>
<updated>2011-02-18T19:49:36+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-02-17T22:59:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ceaaec98ad99859ac90ac6863ad0a6cd075d8e0e'/>
<id>ceaaec98ad99859ac90ac6863ad0a6cd075d8e0e</id>
<content type='text'>
commit 9b5e383c11b08784 (net: Introduce
unregister_netdevice_many()) left an active LIST_HEAD() in
rollback_registered(), with possible memory corruption.

Even if device is freed without touching its unreg_list (and therefore
touching the previous memory location holding LISTE_HEAD(single), better
close the bug for good, since its really subtle.

(Same fix for default_device_exit_batch() for completeness)

Reported-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Tested-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Reported-by: Eric W. Biderman &lt;ebiderman@xmission.com&gt;
Tested-by: Eric W. Biderman &lt;ebiderman@xmission.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Ingo Molnar &lt;mingo@elte.hu&gt;
CC: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
CC: stable &lt;stable@kernel.org&gt; [.33+]
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 9b5e383c11b08784 (net: Introduce
unregister_netdevice_many()) left an active LIST_HEAD() in
rollback_registered(), with possible memory corruption.

Even if device is freed without touching its unreg_list (and therefore
touching the previous memory location holding LISTE_HEAD(single), better
close the bug for good, since its really subtle.

(Same fix for default_device_exit_batch() for completeness)

Reported-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Tested-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Reported-by: Eric W. Biderman &lt;ebiderman@xmission.com&gt;
Tested-by: Eric W. Biderman &lt;ebiderman@xmission.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Ingo Molnar &lt;mingo@elte.hu&gt;
CC: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
CC: stable &lt;stable@kernel.org&gt; [.33+]
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: dont leave active on stack LIST_HEAD</title>
<updated>2011-02-18T19:49:35+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-02-17T22:54:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f87e6f47933e3ebeced9bb12615e830a72cedce4'/>
<id>f87e6f47933e3ebeced9bb12615e830a72cedce4</id>
<content type='text'>
Eric W. Biderman and Michal Hocko reported various memory corruptions
that we suspected to be related to a LIST head located on stack, that
was manipulated after thread left function frame (and eventually exited,
so its stack was freed and reused).

Eric Dumazet suggested the problem was probably coming from commit
443457242beb (net: factorize
sync-rcu call in unregister_netdevice_many)

This patch fixes __dev_close() and dev_close() to properly deinit their
respective LIST_HEAD(single) before exiting.

References: https://lkml.org/lkml/2011/2/16/304
References: https://lkml.org/lkml/2011/2/14/223

Reported-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Tested-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Reported-by: Eric W. Biderman &lt;ebiderman@xmission.com&gt;
Tested-by: Eric W. Biderman &lt;ebiderman@xmission.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Ingo Molnar &lt;mingo@elte.hu&gt;
CC: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Eric W. Biderman and Michal Hocko reported various memory corruptions
that we suspected to be related to a LIST head located on stack, that
was manipulated after thread left function frame (and eventually exited,
so its stack was freed and reused).

Eric Dumazet suggested the problem was probably coming from commit
443457242beb (net: factorize
sync-rcu call in unregister_netdevice_many)

This patch fixes __dev_close() and dev_close() to properly deinit their
respective LIST_HEAD(single) before exiting.

References: https://lkml.org/lkml/2011/2/16/304
References: https://lkml.org/lkml/2011/2/14/223

Reported-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Tested-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Reported-by: Eric W. Biderman &lt;ebiderman@xmission.com&gt;
Tested-by: Eric W. Biderman &lt;ebiderman@xmission.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Ingo Molnar &lt;mingo@elte.hu&gt;
CC: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Fix lockdep regression caused by initializing netdev queues too early.</title>
<updated>2011-02-08T23:02:50+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-02-08T23:02:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8d3bdbd55a7e2a3f2c148a4830aa26dd682b21c4'/>
<id>8d3bdbd55a7e2a3f2c148a4830aa26dd682b21c4</id>
<content type='text'>
In commit aa9421041128abb4d269ee1dc502ff65fb3b7d69 ("net: init ingress
queue") we moved the allocation and lock initialization of the queues
into alloc_netdev_mq() since register_netdevice() is way too late.

The problem is that dev-&gt;type is not setup until the setup()
callback is invoked by alloc_netdev_mq(), and the dev-&gt;type is
what determines the lockdep class to use for the locks in the
queues.

Fix this by doing the queue allocation after the setup() callback
runs.

This is safe because the setup() callback is not allowed to make any
state changes that need to be undone on error (memory allocations,
etc.).  It may, however, make state changes that are undone by
free_netdev() (such as netif_napi_add(), which is done by the
ipoib driver's setup routine).

The previous code also leaked a reference to the &amp;init_net namespace
object on RX/TX queue allocation failures.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In commit aa9421041128abb4d269ee1dc502ff65fb3b7d69 ("net: init ingress
queue") we moved the allocation and lock initialization of the queues
into alloc_netdev_mq() since register_netdevice() is way too late.

The problem is that dev-&gt;type is not setup until the setup()
callback is invoked by alloc_netdev_mq(), and the dev-&gt;type is
what determines the lockdep class to use for the locks in the
queues.

Fix this by doing the queue allocation after the setup() callback
runs.

This is safe because the setup() callback is not allowed to make any
state changes that need to be undone on error (memory allocations,
etc.).  It may, however, make state changes that are undone by
free_netdev() (such as netif_napi_add(), which is done by the
ipoib driver's setup routine).

The previous code also leaked a reference to the &amp;init_net namespace
object on RX/TX queue allocation failures.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gro: reset skb_iif on reuse</title>
<updated>2011-02-02T22:53:25+00:00</updated>
<author>
<name>Andy Gospodarek</name>
<email>andy@greyhouse.net</email>
</author>
<published>2011-02-02T22:53:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6d152e23ad1a7a5b40fef1f42e017d66e6115159'/>
<id>6d152e23ad1a7a5b40fef1f42e017d66e6115159</id>
<content type='text'>
Like Herbert's change from a few days ago:

66c46d741e2e60f0e8b625b80edb0ab820c46d7a gro: Reset dev pointer on reuse

this may not be necessary at this point, but we should still clean up
the skb-&gt;skb_iif.  If not we may end up with an invalid valid for
skb-&gt;skb_iif when the skb is reused and the check is done in
__netif_receive_skb.

Signed-off-by: Andy Gospodarek &lt;andy@greyhouse.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Like Herbert's change from a few days ago:

66c46d741e2e60f0e8b625b80edb0ab820c46d7a gro: Reset dev pointer on reuse

this may not be necessary at this point, but we should still clean up
the skb-&gt;skb_iif.  If not we may end up with an invalid valid for
skb-&gt;skb_iif when the skb is reused and the check is done in
__netif_receive_skb.

Signed-off-by: Andy Gospodarek &lt;andy@greyhouse.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Check rps_flow_table when RPS map length is 1</title>
<updated>2011-02-01T00:23:42+00:00</updated>
<author>
<name>Tom Herbert</name>
<email>therbert@google.com</email>
</author>
<published>2011-02-01T00:23:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8587523640441a9ff2564ebc6efeb39497ad6709'/>
<id>8587523640441a9ff2564ebc6efeb39497ad6709</id>
<content type='text'>
In get_rps_cpu, add check that the rps_flow_table for the device is
NULL when trying to take fast path when RPS map length is one.
Without this, RFS is effectively disabled if map length is one which
is not correct.

Signed-off-by: Tom Herbert &lt;therbert@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In get_rps_cpu, add check that the rps_flow_table for the device is
NULL when trying to take fast path when RPS map length is one.
Without this, RFS is effectively disabled if map length is one which
is not correct.

Signed-off-by: Tom Herbert &lt;therbert@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Fix ip link add netns oops</title>
<updated>2011-01-30T09:14:15+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2011-01-29T14:57:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=13ad17745c2cbd437d9e24b2d97393e0be11c439'/>
<id>13ad17745c2cbd437d9e24b2d97393e0be11c439</id>
<content type='text'>
Ed Swierk &lt;eswierk@bigswitch.com&gt; writes:
&gt; On 2.6.35.7
&gt;  ip link add link eth0 netns 9999 type macvlan
&gt; where 9999 is a nonexistent PID triggers an oops and causes all network functions to hang:
&gt; [10663.821898] BUG: unable to handle kernel NULL pointer dereference at 000000000000006d
&gt;  [10663.821917] IP: [&lt;ffffffff8149c2fa&gt;] __dev_alloc_name+0x9a/0x170
&gt;  [10663.821933] PGD 1d3927067 PUD 22f5c5067 PMD 0
&gt;  [10663.821944] Oops: 0000 [#1] SMP
&gt;  [10663.821953] last sysfs file: /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
&gt;  [10663.821959] CPU 3
&gt;  [10663.821963] Modules linked in: macvlan ip6table_filter ip6_tables rfcomm ipt_MASQUERADE binfmt_misc iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack sco ipt_REJECT bnep l2cap xt_tcpudp iptable_filter ip_tables x_tables bridge stp vboxnetadp vboxnetflt vboxdrv kvm_intel kvm parport_pc ppdev snd_hda_codec_intelhdmi snd_hda_codec_conexant arc4 iwlagn iwlcore mac80211 snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_midi snd_rawmidi i915 snd_seq_midi_event snd_seq thinkpad_acpi drm_kms_helper btusb tpm_tis nvram uvcvideo snd_timer snd_seq_device bluetooth videodev v4l1_compat v4l2_compat_ioctl32 tpm drm tpm_bios snd cfg80211 psmouse serio_raw intel_ips soundcore snd_page_alloc intel_agp i2c_algo_bit video output netconsole configfs lp parport usbhid hid e1000e sdhci_pci ahci libahci sdhci led_class
&gt;  [10663.822155]
&gt;  [10663.822161] Pid: 6000, comm: ip Not tainted 2.6.35-23-generic #41-Ubuntu 2901CTO/2901CTO
&gt;  [10663.822167] RIP: 0010:[&lt;ffffffff8149c2fa&gt;] [&lt;ffffffff8149c2fa&gt;] __dev_alloc_name+0x9a/0x170
&gt;  [10663.822177] RSP: 0018:ffff88014aebf7b8 EFLAGS: 00010286
&gt;  [10663.822182] RAX: 00000000fffffff4 RBX: ffff8801ad900800 RCX: 0000000000000000
&gt;  [10663.822187] RDX: ffff880000000000 RSI: 0000000000000000 RDI: ffff88014ad63000
&gt;  [10663.822191] RBP: ffff88014aebf808 R08: 0000000000000041 R09: 0000000000000041
&gt;  [10663.822196] R10: 0000000000000000 R11: dead000000200200 R12: ffff88014aebf818
&gt;  [10663.822201] R13: fffffffffffffffd R14: ffff88014aebf918 R15: ffff88014ad62000
&gt;  [10663.822207] FS: 00007f00c487f700(0000) GS:ffff880001f80000(0000) knlGS:0000000000000000
&gt;  [10663.822212] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
&gt;  [10663.822216] CR2: 000000000000006d CR3: 0000000231f19000 CR4: 00000000000026e0
&gt;  [10663.822221] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
&gt;  [10663.822226] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
&gt;  [10663.822231] Process ip (pid: 6000, threadinfo ffff88014aebe000, task ffff88014afb16e0)
&gt;  [10663.822236] Stack:
&gt;  [10663.822240] ffff88014aebf808 ffffffff814a2bb5 ffff88014aebf7e8 00000000a00ee8d6
&gt;  [10663.822251] &lt;0&gt; 0000000000000000 ffffffffa00ef940 ffff8801ad900800 ffff88014aebf818
&gt;  [10663.822265] &lt;0&gt; ffff88014aebf918 ffff8801ad900800 ffff88014aebf858 ffffffff8149c413
&gt;  [10663.822281] Call Trace:
&gt;  [10663.822290] [&lt;ffffffff814a2bb5&gt;] ? dev_addr_init+0x75/0xb0
&gt;  [10663.822298] [&lt;ffffffff8149c413&gt;] dev_alloc_name+0x43/0x90
&gt;  [10663.822307] [&lt;ffffffff814a85ee&gt;] rtnl_create_link+0xbe/0x1b0
&gt;  [10663.822314] [&lt;ffffffff814ab2aa&gt;] rtnl_newlink+0x48a/0x570
&gt;  [10663.822321] [&lt;ffffffff814aafcc&gt;] ? rtnl_newlink+0x1ac/0x570
&gt;  [10663.822332] [&lt;ffffffff81030064&gt;] ? native_x2apic_icr_read+0x4/0x20
&gt;  [10663.822339] [&lt;ffffffff814a8c17&gt;] rtnetlink_rcv_msg+0x177/0x290
&gt;  [10663.822346] [&lt;ffffffff814a8aa0&gt;] ? rtnetlink_rcv_msg+0x0/0x290
&gt;  [10663.822354] [&lt;ffffffff814c25d9&gt;] netlink_rcv_skb+0xa9/0xd0
&gt;  [10663.822360] [&lt;ffffffff814a8a85&gt;] rtnetlink_rcv+0x25/0x40
&gt;  [10663.822367] [&lt;ffffffff814c223e&gt;] netlink_unicast+0x2de/0x2f0
&gt;  [10663.822374] [&lt;ffffffff814c303e&gt;] netlink_sendmsg+0x1fe/0x2e0
&gt;  [10663.822383] [&lt;ffffffff81488533&gt;] sock_sendmsg+0xf3/0x120
&gt;  [10663.822391] [&lt;ffffffff815899fe&gt;] ? _raw_spin_lock+0xe/0x20
&gt;  [10663.822400] [&lt;ffffffff81168656&gt;] ? __d_lookup+0x136/0x150
&gt;  [10663.822406] [&lt;ffffffff815899fe&gt;] ? _raw_spin_lock+0xe/0x20
&gt;  [10663.822414] [&lt;ffffffff812b7a0d&gt;] ? _atomic_dec_and_lock+0x4d/0x80
&gt;  [10663.822422] [&lt;ffffffff8116ea90&gt;] ? mntput_no_expire+0x30/0x110
&gt;  [10663.822429] [&lt;ffffffff81486ff5&gt;] ? move_addr_to_kernel+0x65/0x70
&gt;  [10663.822435] [&lt;ffffffff81493308&gt;] ? verify_iovec+0x88/0xe0
&gt;  [10663.822442] [&lt;ffffffff81489020&gt;] sys_sendmsg+0x240/0x3a0
&gt; [10663.822450] [&lt;ffffffff8111e2a9&gt;] ? __do_fault+0x479/0x560
&gt;  [10663.822457] [&lt;ffffffff815899fe&gt;] ? _raw_spin_lock+0xe/0x20
&gt;  [10663.822465] [&lt;ffffffff8116cf4a&gt;] ? alloc_fd+0x10a/0x150
&gt;  [10663.822473] [&lt;ffffffff8158d76e&gt;] ? do_page_fault+0x15e/0x350
&gt;  [10663.822482] [&lt;ffffffff8100a0f2&gt;] system_call_fastpath+0x16/0x1b
&gt;  [10663.822487] Code: 90 48 8d 78 02 be 25 00 00 00 e8 92 1d e2 ff 48 85 c0 75 cf bf 20 00 00 00 e8 c3 b1 c6 ff 49 89 c7 b8 f4 ff ff ff 4d 85 ff 74 bd &lt;4d&gt; 8b 75 70 49 8d 45 70 48 89 45 b8 49 83 ee 58 eb 28 48 8d 55
&gt;  [10663.822618] RIP [&lt;ffffffff8149c2fa&gt;] __dev_alloc_name+0x9a/0x170
&gt;  [10663.822627] RSP &lt;ffff88014aebf7b8&gt;
&gt;  [10663.822631] CR2: 000000000000006d
&gt;  [10663.822636] ---[ end trace 3dfd6c3ad5327ca7 ]---

This bug was introduced in:
commit 81adee47dfb608df3ad0b91d230fb3cef75f0060
Author: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
Date:   Sun Nov 8 00:53:51 2009 -0800

    net: Support specifying the network namespace upon device creation.

    There is no good reason to not support userspace specifying the
    network namespace during device creation, and it makes it easier
    to create a network device and pass it to a child network namespace
    with a well known name.

    We have to be careful to ensure that the target network namespace
    for the new device exists through the life of the call.  To keep
    that logic clear I have factored out the network namespace grabbing
    logic into rtnl_link_get_net.

    In addtion we need to continue to pass the source network namespace
    to the rtnl_link_ops.newlink method so that we can find the base
    device source network namespace.

    Signed-off-by: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
    Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;

Where apparently I forgot to add error handling to the path where we create
a new network device in a new network namespace, and pass in an invalid pid.

Cc: stable@kernel.org
Reported-by: Ed Swierk &lt;eswierk@bigswitch.com&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ed Swierk &lt;eswierk@bigswitch.com&gt; writes:
&gt; On 2.6.35.7
&gt;  ip link add link eth0 netns 9999 type macvlan
&gt; where 9999 is a nonexistent PID triggers an oops and causes all network functions to hang:
&gt; [10663.821898] BUG: unable to handle kernel NULL pointer dereference at 000000000000006d
&gt;  [10663.821917] IP: [&lt;ffffffff8149c2fa&gt;] __dev_alloc_name+0x9a/0x170
&gt;  [10663.821933] PGD 1d3927067 PUD 22f5c5067 PMD 0
&gt;  [10663.821944] Oops: 0000 [#1] SMP
&gt;  [10663.821953] last sysfs file: /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
&gt;  [10663.821959] CPU 3
&gt;  [10663.821963] Modules linked in: macvlan ip6table_filter ip6_tables rfcomm ipt_MASQUERADE binfmt_misc iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack sco ipt_REJECT bnep l2cap xt_tcpudp iptable_filter ip_tables x_tables bridge stp vboxnetadp vboxnetflt vboxdrv kvm_intel kvm parport_pc ppdev snd_hda_codec_intelhdmi snd_hda_codec_conexant arc4 iwlagn iwlcore mac80211 snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_midi snd_rawmidi i915 snd_seq_midi_event snd_seq thinkpad_acpi drm_kms_helper btusb tpm_tis nvram uvcvideo snd_timer snd_seq_device bluetooth videodev v4l1_compat v4l2_compat_ioctl32 tpm drm tpm_bios snd cfg80211 psmouse serio_raw intel_ips soundcore snd_page_alloc intel_agp i2c_algo_bit video output netconsole configfs lp parport usbhid hid e1000e sdhci_pci ahci libahci sdhci led_class
&gt;  [10663.822155]
&gt;  [10663.822161] Pid: 6000, comm: ip Not tainted 2.6.35-23-generic #41-Ubuntu 2901CTO/2901CTO
&gt;  [10663.822167] RIP: 0010:[&lt;ffffffff8149c2fa&gt;] [&lt;ffffffff8149c2fa&gt;] __dev_alloc_name+0x9a/0x170
&gt;  [10663.822177] RSP: 0018:ffff88014aebf7b8 EFLAGS: 00010286
&gt;  [10663.822182] RAX: 00000000fffffff4 RBX: ffff8801ad900800 RCX: 0000000000000000
&gt;  [10663.822187] RDX: ffff880000000000 RSI: 0000000000000000 RDI: ffff88014ad63000
&gt;  [10663.822191] RBP: ffff88014aebf808 R08: 0000000000000041 R09: 0000000000000041
&gt;  [10663.822196] R10: 0000000000000000 R11: dead000000200200 R12: ffff88014aebf818
&gt;  [10663.822201] R13: fffffffffffffffd R14: ffff88014aebf918 R15: ffff88014ad62000
&gt;  [10663.822207] FS: 00007f00c487f700(0000) GS:ffff880001f80000(0000) knlGS:0000000000000000
&gt;  [10663.822212] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
&gt;  [10663.822216] CR2: 000000000000006d CR3: 0000000231f19000 CR4: 00000000000026e0
&gt;  [10663.822221] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
&gt;  [10663.822226] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
&gt;  [10663.822231] Process ip (pid: 6000, threadinfo ffff88014aebe000, task ffff88014afb16e0)
&gt;  [10663.822236] Stack:
&gt;  [10663.822240] ffff88014aebf808 ffffffff814a2bb5 ffff88014aebf7e8 00000000a00ee8d6
&gt;  [10663.822251] &lt;0&gt; 0000000000000000 ffffffffa00ef940 ffff8801ad900800 ffff88014aebf818
&gt;  [10663.822265] &lt;0&gt; ffff88014aebf918 ffff8801ad900800 ffff88014aebf858 ffffffff8149c413
&gt;  [10663.822281] Call Trace:
&gt;  [10663.822290] [&lt;ffffffff814a2bb5&gt;] ? dev_addr_init+0x75/0xb0
&gt;  [10663.822298] [&lt;ffffffff8149c413&gt;] dev_alloc_name+0x43/0x90
&gt;  [10663.822307] [&lt;ffffffff814a85ee&gt;] rtnl_create_link+0xbe/0x1b0
&gt;  [10663.822314] [&lt;ffffffff814ab2aa&gt;] rtnl_newlink+0x48a/0x570
&gt;  [10663.822321] [&lt;ffffffff814aafcc&gt;] ? rtnl_newlink+0x1ac/0x570
&gt;  [10663.822332] [&lt;ffffffff81030064&gt;] ? native_x2apic_icr_read+0x4/0x20
&gt;  [10663.822339] [&lt;ffffffff814a8c17&gt;] rtnetlink_rcv_msg+0x177/0x290
&gt;  [10663.822346] [&lt;ffffffff814a8aa0&gt;] ? rtnetlink_rcv_msg+0x0/0x290
&gt;  [10663.822354] [&lt;ffffffff814c25d9&gt;] netlink_rcv_skb+0xa9/0xd0
&gt;  [10663.822360] [&lt;ffffffff814a8a85&gt;] rtnetlink_rcv+0x25/0x40
&gt;  [10663.822367] [&lt;ffffffff814c223e&gt;] netlink_unicast+0x2de/0x2f0
&gt;  [10663.822374] [&lt;ffffffff814c303e&gt;] netlink_sendmsg+0x1fe/0x2e0
&gt;  [10663.822383] [&lt;ffffffff81488533&gt;] sock_sendmsg+0xf3/0x120
&gt;  [10663.822391] [&lt;ffffffff815899fe&gt;] ? _raw_spin_lock+0xe/0x20
&gt;  [10663.822400] [&lt;ffffffff81168656&gt;] ? __d_lookup+0x136/0x150
&gt;  [10663.822406] [&lt;ffffffff815899fe&gt;] ? _raw_spin_lock+0xe/0x20
&gt;  [10663.822414] [&lt;ffffffff812b7a0d&gt;] ? _atomic_dec_and_lock+0x4d/0x80
&gt;  [10663.822422] [&lt;ffffffff8116ea90&gt;] ? mntput_no_expire+0x30/0x110
&gt;  [10663.822429] [&lt;ffffffff81486ff5&gt;] ? move_addr_to_kernel+0x65/0x70
&gt;  [10663.822435] [&lt;ffffffff81493308&gt;] ? verify_iovec+0x88/0xe0
&gt;  [10663.822442] [&lt;ffffffff81489020&gt;] sys_sendmsg+0x240/0x3a0
&gt; [10663.822450] [&lt;ffffffff8111e2a9&gt;] ? __do_fault+0x479/0x560
&gt;  [10663.822457] [&lt;ffffffff815899fe&gt;] ? _raw_spin_lock+0xe/0x20
&gt;  [10663.822465] [&lt;ffffffff8116cf4a&gt;] ? alloc_fd+0x10a/0x150
&gt;  [10663.822473] [&lt;ffffffff8158d76e&gt;] ? do_page_fault+0x15e/0x350
&gt;  [10663.822482] [&lt;ffffffff8100a0f2&gt;] system_call_fastpath+0x16/0x1b
&gt;  [10663.822487] Code: 90 48 8d 78 02 be 25 00 00 00 e8 92 1d e2 ff 48 85 c0 75 cf bf 20 00 00 00 e8 c3 b1 c6 ff 49 89 c7 b8 f4 ff ff ff 4d 85 ff 74 bd &lt;4d&gt; 8b 75 70 49 8d 45 70 48 89 45 b8 49 83 ee 58 eb 28 48 8d 55
&gt;  [10663.822618] RIP [&lt;ffffffff8149c2fa&gt;] __dev_alloc_name+0x9a/0x170
&gt;  [10663.822627] RSP &lt;ffff88014aebf7b8&gt;
&gt;  [10663.822631] CR2: 000000000000006d
&gt;  [10663.822636] ---[ end trace 3dfd6c3ad5327ca7 ]---

This bug was introduced in:
commit 81adee47dfb608df3ad0b91d230fb3cef75f0060
Author: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
Date:   Sun Nov 8 00:53:51 2009 -0800

    net: Support specifying the network namespace upon device creation.

    There is no good reason to not support userspace specifying the
    network namespace during device creation, and it makes it easier
    to create a network device and pass it to a child network namespace
    with a well known name.

    We have to be careful to ensure that the target network namespace
    for the new device exists through the life of the call.  To keep
    that logic clear I have factored out the network namespace grabbing
    logic into rtnl_link_get_net.

    In addtion we need to continue to pass the source network namespace
    to the rtnl_link_ops.newlink method so that we can find the base
    device source network namespace.

    Signed-off-by: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
    Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;

Where apparently I forgot to add error handling to the path where we create
a new network device in a new network namespace, and pass in an invalid pid.

Cc: stable@kernel.org
Reported-by: Ed Swierk &lt;eswierk@bigswitch.com&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
