<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/core, branch v3.0.82</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/core?h=v3.0.82</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/core?h=v3.0.82'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-05-19T17:04:46Z</updated>
<entry>
<title>ipv6: do not clear pinet6 field</title>
<updated>2013-05-19T17:04:46Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-05-09T10:28:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1e74f2ea952f201c5ee5edce74daab21aea89b31'/>
<id>urn:sha1:1e74f2ea952f201c5ee5edce74daab21aea89b31</id>
<content type='text'>
[ Upstream commit f77d602124d865c38705df7fa25c03de9c284ad2 ]

We have seen multiple NULL dereferences in __inet6_lookup_established()

After analysis, I found that inet6_sk() could be NULL while the
check for sk_family == AF_INET6 was true.

Bug was added in linux-2.6.29 when RCU lookups were introduced in UDP
and TCP stacks.

Once an IPv6 socket, using SLAB_DESTROY_BY_RCU is inserted in a hash
table, we no longer can clear pinet6 field.

This patch extends logic used in commit fcbdf09d9652c891
("net: fix nulls list corruptions in sk_prot_alloc")

TCP/UDP/UDPLite IPv6 protocols provide their own .clear_sk() method
to make sure we do not clear pinet6 field.

At socket clone phase, we do not really care, as cloning the parent (non
NULL) pinet6 is not adding a fatal race.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&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>net: fix incorrect credentials passing</title>
<updated>2013-05-01T15:56:38Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-04-19T15:32:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=73d2de1ad017f674ec21e57405e47028dbc884bf'/>
<id>urn:sha1:73d2de1ad017f674ec21e57405e47028dbc884bf</id>
<content type='text'>
[ Upstream commit 83f1b4ba917db5dc5a061a44b3403ddb6e783494 ]

Commit 257b5358b32f ("scm: Capture the full credentials of the scm
sender") changed the credentials passing code to pass in the effective
uid/gid instead of the real uid/gid.

Obviously this doesn't matter most of the time (since normally they are
the same), but it results in differences for suid binaries when the wrong
uid/gid ends up being used.

This just undoes that (presumably unintentional) part of the commit.

Reported-by: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Serge E. Hallyn &lt;serge@hallyn.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Acked-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&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>rtnetlink: Call nlmsg_parse() with correct header length</title>
<updated>2013-05-01T15:56:37Z</updated>
<author>
<name>Michael Riesch</name>
<email>michael.riesch@omicron.at</email>
</author>
<published>2013-04-08T05:45:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f5045d1c27676a8714142cd082e6b0e0e3e10138'/>
<id>urn:sha1:f5045d1c27676a8714142cd082e6b0e0e3e10138</id>
<content type='text'>
[ Upstream commit 88c5b5ce5cb57af6ca2a7cf4d5715fa320448ff9 ]

Signed-off-by: Michael Riesch &lt;michael.riesch@omicron.at&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Jiri Benc &lt;jbenc@redhat.com&gt;
Cc: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: linux-kernel@vger.kernel.org
Acked-by: Mark Rustad &lt;mark.d.rustad@intel.com&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>netfilter: don't reset nf_trace in nf_reset()</title>
<updated>2013-05-01T15:56:37Z</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2013-04-05T18:42:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a57d91ae48c1bca556dcde0d0a6273f7d8fabe1e'/>
<id>urn:sha1:a57d91ae48c1bca556dcde0d0a6273f7d8fabe1e</id>
<content type='text'>
[ Upstream commit 124dff01afbdbff251f0385beca84ba1b9adda68 ]

Commit 130549fe ("netfilter: reset nf_trace in nf_reset") added code
to reset nf_trace in nf_reset(). This is wrong and unnecessary.

nf_reset() is used in the following cases:

- when passing packets up the the socket layer, at which point we want to
  release all netfilter references that might keep modules pinned while
  the packet is queued. nf_trace doesn't matter anymore at this point.

- when encapsulating or decapsulating IPsec packets. We want to continue
  tracing these packets after IPsec processing.

- when passing packets through virtual network devices. Only devices on
  that encapsulate in IPv4/v6 matter since otherwise nf_trace is not
  used anymore. Its not entirely clear whether those packets should
  be traced after that, however we've always done that.

- when passing packets through virtual network devices that make the
  packet cross network namespace boundaries. This is the only cases
  where we clearly want to reset nf_trace and is also what the
  original patch intended to fix.

Add a new function nf_reset_trace() and use it in dev_forward_skb() to
fix this properly.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&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>net: count hw_addr syncs so that unsync works properly.</title>
<updated>2013-05-01T15:56:36Z</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2013-04-02T21:10:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d569e833b770b21d29147c1ed937ab3882647252'/>
<id>urn:sha1:d569e833b770b21d29147c1ed937ab3882647252</id>
<content type='text'>
[ Upstream commit 4543fbefe6e06a9e40d9f2b28d688393a299f079 ]

A few drivers use dev_uc_sync/unsync to synchronize the
address lists from master down to slave/lower devices.  In
some cases (bond/team) a single address list is synched down
to multiple devices.  At the time of unsync, we have a leak
in these lower devices, because "synced" is treated as a
boolean and the address will not be unsynced for anything after
the first device/call.

Treat "synced" as a count (same as refcount) and allow all
unsync calls to work.

Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.com&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>net: add a synchronize_net() in netdev_rx_handler_unregister()</title>
<updated>2013-04-05T17:16:54Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-03-29T03:01:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cb241ae254e1f4ee9a9f07e4a452b12cd674fffc'/>
<id>urn:sha1:cb241ae254e1f4ee9a9f07e4a452b12cd674fffc</id>
<content type='text'>
[ Upstream commit 00cfec37484761a44a3b6f4675a54caa618210ae ]

commit 35d48903e97819 (bonding: fix rx_handler locking) added a race
in bonding driver, reported by Steven Rostedt who did a very good
diagnosis :

&lt;quoting Steven&gt;

I'm currently debugging a crash in an old 3.0-rt kernel that one of our
customers is seeing. The bug happens with a stress test that loads and
unloads the bonding module in a loop (I don't know all the details as
I'm not the one that is directly interacting with the customer). But the
bug looks to be something that may still be present and possibly present
in mainline too. It will just be much harder to trigger it in mainline.

In -rt, interrupts are threads, and can schedule in and out just like
any other thread. Note, mainline now supports interrupt threads so this
may be easily reproducible in mainline as well. I don't have the ability
to tell the customer to try mainline or other kernels, so my hands are
somewhat tied to what I can do.

But according to a core dump, I tracked down that the eth irq thread
crashed in bond_handle_frame() here:

        slave = bond_slave_get_rcu(skb-&gt;dev);
        bond = slave-&gt;bond; &lt;--- BUG

the slave returned was NULL and accessing slave-&gt;bond caused a NULL
pointer dereference.

Looking at the code that unregisters the handler:

void netdev_rx_handler_unregister(struct net_device *dev)
{

        ASSERT_RTNL();
        RCU_INIT_POINTER(dev-&gt;rx_handler, NULL);
        RCU_INIT_POINTER(dev-&gt;rx_handler_data, NULL);
}

Which is basically:
        dev-&gt;rx_handler = NULL;
        dev-&gt;rx_handler_data = NULL;

And looking at __netif_receive_skb() we have:

        rx_handler = rcu_dereference(skb-&gt;dev-&gt;rx_handler);
        if (rx_handler) {
                if (pt_prev) {
                        ret = deliver_skb(skb, pt_prev, orig_dev);
                        pt_prev = NULL;
                }
                switch (rx_handler(&amp;skb)) {

My question to all of you is, what stops this interrupt from happening
while the bonding module is unloading?  What happens if the interrupt
triggers and we have this:

        CPU0                    CPU1
        ----                    ----
  rx_handler = skb-&gt;dev-&gt;rx_handler

                        netdev_rx_handler_unregister() {
                           dev-&gt;rx_handler = NULL;
                           dev-&gt;rx_handler_data = NULL;

  rx_handler()
   bond_handle_frame() {
    slave = skb-&gt;dev-&gt;rx_handler;
    bond = slave-&gt;bond; &lt;-- NULL pointer dereference!!!

What protection am I missing in the bond release handler that would
prevent the above from happening?

&lt;/quoting Steven&gt;

We can fix bug this in two ways. First is adding a test in
bond_handle_frame() and others to check if rx_handler_data is NULL.

A second way is adding a synchronize_net() in
netdev_rx_handler_unregister() to make sure that a rcu protected reader
has the guarantee to see a non NULL rx_handler_data.

The second way is better as it avoids an extra test in fast path.

Reported-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Jiri Pirko &lt;jpirko@redhat.com&gt;
Cc: Paul E. McKenney &lt;paulmck@us.ibm.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Reviewed-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&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>rtnetlink: Mask the rta_type when range checking</title>
<updated>2013-03-28T19:05:59Z</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2013-03-13T04:18:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=110789df9f88361dcf6b5dad53a38ea2f88cad77'/>
<id>urn:sha1:110789df9f88361dcf6b5dad53a38ea2f88cad77</id>
<content type='text'>
[ Upstream commit a5b8db91442fce9c9713fcd656c3698f1adde1d6 ]

Range/validity checks on rta_type in rtnetlink_rcv_msg() do
not account for flags that may be set.  This causes the function
to return -EINVAL when flags are set on the type (for example
NLA_F_NESTED).

Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Acked-by: Thomas Graf &lt;tgraf@suug.ch&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>rtnl: fix info leak on RTM_GETLINK request for VF devices</title>
<updated>2013-03-20T19:58:54Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@googlemail.com</email>
</author>
<published>2013-03-09T05:52:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3385fcdbf46ec6fbbcefffd41ac10a8c4daafd32'/>
<id>urn:sha1:3385fcdbf46ec6fbbcefffd41ac10a8c4daafd32</id>
<content type='text'>
[ Upstream commit 84d73cd3fb142bf1298a8c13fd4ca50fd2432372 ]

Initialize the mac address buffer with 0 as the driver specific function
will probably not fill the whole buffer. In fact, all in-kernel drivers
fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible
bytes. Therefore we currently leak 26 bytes of stack memory to userland
via the netlink interface.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&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>bridging: fix rx_handlers return code</title>
<updated>2013-03-20T19:58:54Z</updated>
<author>
<name>Cristian Bercaru</name>
<email>B43982@freescale.com</email>
</author>
<published>2013-03-08T07:03:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b8268476626db0dac71fad35da5532e32f6a879e'/>
<id>urn:sha1:b8268476626db0dac71fad35da5532e32f6a879e</id>
<content type='text'>
[ Upstream commit 3bc1b1add7a8484cc4a261c3e128dbe1528ce01f ]

The frames for which rx_handlers return RX_HANDLER_CONSUMED are no longer
counted as dropped. They are counted as successfully received by
'netif_receive_skb'.

This allows network interface drivers to correctly update their RX-OK and
RX-DRP counters based on the result of 'netif_receive_skb'.

Signed-off-by: Cristian Bercaru &lt;B43982@freescale.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&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>pktgen: correctly handle failures when adding a device</title>
<updated>2013-02-14T18:47:34Z</updated>
<author>
<name>Cong Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2013-01-27T21:14:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=aa5d2659341c70682149e1c987bce6fe6620b30b'/>
<id>urn:sha1:aa5d2659341c70682149e1c987bce6fe6620b30b</id>
<content type='text'>
[ Upstream commit 604dfd6efc9b79bce432f2394791708d8e8f6efc ]

The return value of pktgen_add_device() is not checked, so
even if we fail to add some device, for example, non-exist one,
we still see "OK:...". This patch fixes it.

After this patch, I got:

	# echo "add_device non-exist" &gt; /proc/net/pktgen/kpktgend_0
	-bash: echo: write error: No such device
	# cat /proc/net/pktgen/kpktgend_0
	Running:
	Stopped:
	Result: ERROR: can not add device non-exist
	# echo "add_device eth0" &gt; /proc/net/pktgen/kpktgend_0
	# cat /proc/net/pktgen/kpktgend_0
	Running:
	Stopped: eth0
	Result: OK: add_device=eth0

(Candidate for -stable)

Cc: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&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>
</feed>
