<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/net/ipvlan, branch v4.4.27</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.27</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.27'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-11-17T19:39:29Z</updated>
<entry>
<title>ipvlan: fix use after free of skb</title>
<updated>2015-11-17T19:39:29Z</updated>
<author>
<name>Sabrina Dubroca</name>
<email>sd@queasysnail.net</email>
</author>
<published>2015-11-16T21:44:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a534dc529853c69e94994aa47c1d80a03ce2c11d'/>
<id>urn:sha1:a534dc529853c69e94994aa47c1d80a03ce2c11d</id>
<content type='text'>
ipvlan_handle_frame is a rx_handler, and when it returns a value other
than RX_HANDLER_CONSUMED (here, NET_RX_DROP aka RX_HANDLER_ANOTHER),
__netif_receive_skb_core expects that the skb still exists and will
process it further, but we just freed it.

Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: fix leak in ipvlan_rcv_frame</title>
<updated>2015-11-17T19:39:28Z</updated>
<author>
<name>Sabrina Dubroca</name>
<email>sd@queasysnail.net</email>
</author>
<published>2015-11-16T21:34:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cf554ada0be7077906aa9a17faf151ff66e3cb8e'/>
<id>urn:sha1:cf554ada0be7077906aa9a17faf151ff66e3cb8e</id>
<content type='text'>
Pass a **skb to ipvlan_rcv_frame so that if skb_share_check returns a
new skb, we actually use it during further processing.

It's safe to ignore the new skb in the ipvlan_xmit_* functions, because
they call ipvlan_rcv_frame with local == true, so that dev_forward_skb
is called and always takes ownership of the skb.

Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: read direct ifindex instead of iflink</title>
<updated>2015-10-22T13:39:08Z</updated>
<author>
<name>Brenden Blanco</name>
<email>bblanco@plumgrid.com</email>
</author>
<published>2015-10-20T23:47:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=63b11e757d6dae570bc22450ec58a5b68cdf5c3c'/>
<id>urn:sha1:63b11e757d6dae570bc22450ec58a5b68cdf5c3c</id>
<content type='text'>
In the ipv4 outbound path of an ipvlan device in l3 mode, the ifindex is
being grabbed from dev_get_iflink. This works for the physical device
case, since as the documentation of that function notes: "Physical
interfaces have the same 'ifindex' and 'iflink' values.".  However, if
the master device is a veth, and the pairs are in separate net
namespaces, the route lookup will fail with -ENODEV due to outer veth
pair being in a separate namespace from the ipvlan master/routing
namespace.

  ns0    |   ns1    |   ns2
 veth0a--|--veth0b--|--ipvl0

In ipvlan_process_v4_outbound(), a packet sent from ipvl0 in the above
configuration will pass fl.flowi4_oif == veth0a to
ip_route_output_flow(), but *net == ns1.

Notice also that ipv6 processing is not using iflink. Since there is a
discrepancy in usage, fixup both v4 and v6 case to use local dev
variable.

Tested this with l3 ipvlan on top of veth, as well as with single
physical interface in the top namespace.

Signed-off-by: Brenden Blanco &lt;bblanco@plumgrid.com&gt;
Reviewed-by: Jiri Benc &lt;jbenc@redhat.com&gt;
Acked-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4, ipv6: Pass net into ip_local_out and ip6_local_out</title>
<updated>2015-10-08T11:27:02Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-10-07T21:48:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=33224b16ffccb49cf798317670389e0bfba0024c'/>
<id>urn:sha1:33224b16ffccb49cf798317670389e0bfba0024c</id>
<content type='text'>
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: Cache net in ipvlan_process_v4_outbound and ipvlan_process_v6_outbound</title>
<updated>2015-10-08T11:27:01Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-10-07T21:48:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=57c4bf859cad9d6c4f73d8c98a95e00f156301e0'/>
<id>urn:sha1:57c4bf859cad9d6c4f73d8c98a95e00f156301e0</id>
<content type='text'>
Compute net once in ipvlan_process_v4_outbound and
ipvlan_process_v6_outbound and store it in a variable so that net does
not need to be recomputed next time it is used.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: Merge ip6_local_out and ip6_local_out_sk</title>
<updated>2015-10-08T11:26:58Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-10-07T21:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=792883303cdb3a7edd16017d7aba53926189ef41'/>
<id>urn:sha1:792883303cdb3a7edd16017d7aba53926189ef41</id>
<content type='text'>
Stop hidding the sk parameter with an inline helper function and make
all of the callers pass it, so that it is clear what the function is
doing.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4: Merge ip_local_out and ip_local_out_sk</title>
<updated>2015-10-08T11:26:57Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-10-07T21:48:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e2cb77db089796f163092326ca25512845df7a3a'/>
<id>urn:sha1:e2cb77db089796f163092326ca25512845df7a3a</id>
<content type='text'>
It is confusing and silly hiding a parameter so modify all of
the callers to pass in the appropriate socket or skb-&gt;sk if
no socket is known.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipvlan: convert to using IFF_NO_QUEUE</title>
<updated>2015-08-18T18:55:06Z</updated>
<author>
<name>Phil Sutter</name>
<email>phil@nwl.cc</email>
</author>
<published>2015-08-18T08:30:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bf485bcf0df5dcb01b723efc9d5887329e515aa7'/>
<id>urn:sha1:bf485bcf0df5dcb01b723efc9d5887329e515aa7</id>
<content type='text'>
Signed-off-by: Phil Sutter &lt;phil@nwl.cc&gt;
Cc: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: ignore addresses from ipv6 autoconfiguration</title>
<updated>2015-07-16T04:33:40Z</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@yandex-team.ru</email>
</author>
<published>2015-07-14T13:35:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=23a5a49c83dd8a7201a42e96d24238bde3547c11'/>
<id>urn:sha1:23a5a49c83dd8a7201a42e96d24238bde3547c11</id>
<content type='text'>
Inet6addr notifier is atomic and runs in bh context without RTNL when
ipv6 receives router advertisement packet and performs autoconfiguration.

Proper fix still in discussion. Let's at least plug the bug.
v1: http://lkml.kernel.org/r/20150514135618.14062.1969.stgit@buzz
v2: http://lkml.kernel.org/r/20150703125840.24121.91556.stgit@buzz

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: use rcu_deference_bh() in ipvlan_queue_xmit()</title>
<updated>2015-07-16T04:33:40Z</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2015-07-14T13:35:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0fba37a3af03a7e74bf9e75473729adb98da49c3'/>
<id>urn:sha1:0fba37a3af03a7e74bf9e75473729adb98da49c3</id>
<content type='text'>
In tx path rcu_read_lock_bh() is held, so we need rcu_deference_bh().
This fixes the following warning:

 ===============================
 [ INFO: suspicious RCU usage. ]
 4.1.0-rc1+ #1007 Not tainted
 -------------------------------
 drivers/net/ipvlan/ipvlan.h:106 suspicious rcu_dereference_check() usage!

 other info that might help us debug this:

 rcu_scheduler_active = 1, debug_locks = 0
 1 lock held by dhclient/1076:
  #0:  (rcu_read_lock_bh){......}, at: [&lt;ffffffff817e8d84&gt;] rcu_lock_acquire+0x0/0x26

 stack backtrace:
 CPU: 2 PID: 1076 Comm: dhclient Not tainted 4.1.0-rc1+ #1007
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
  0000000000000001 ffff8800d381bac8 ffffffff81a4154f 000000003c1a3c19
  ffff8800d4d0a690 ffff8800d381baf8 ffffffff810b849f ffff880117d41148
  ffff880117d40000 ffff880117d40068 0000000000000156 ffff8800d381bb18
 Call Trace:
  [&lt;ffffffff81a4154f&gt;] dump_stack+0x4c/0x65
  [&lt;ffffffff810b849f&gt;] lockdep_rcu_suspicious+0x107/0x110
  [&lt;ffffffff8165a522&gt;] ipvlan_port_get_rcu+0x47/0x4e
  [&lt;ffffffff8165ad14&gt;] ipvlan_queue_xmit+0x35/0x450
  [&lt;ffffffff817ea45d&gt;] ? rcu_read_unlock+0x3e/0x5f
  [&lt;ffffffff810a20bf&gt;] ? local_clock+0x19/0x22
  [&lt;ffffffff810b4781&gt;] ? __lock_is_held+0x39/0x52
  [&lt;ffffffff8165b64c&gt;] ipvlan_start_xmit+0x1b/0x44
  [&lt;ffffffff817edf7f&gt;] dev_hard_start_xmit+0x2ae/0x467
  [&lt;ffffffff817ee642&gt;] __dev_queue_xmit+0x50a/0x60c
  [&lt;ffffffff817ee7a7&gt;] dev_queue_xmit_sk+0x13/0x15
  [&lt;ffffffff81997596&gt;] dev_queue_xmit+0x10/0x12
  [&lt;ffffffff8199b41c&gt;] packet_sendmsg+0xb6b/0xbdf
  [&lt;ffffffff810b5ea7&gt;] ? mark_lock+0x2e/0x226
  [&lt;ffffffff810a1fcc&gt;] ? sched_clock_cpu+0x9e/0xb7
  [&lt;ffffffff817d56f9&gt;] sock_sendmsg_nosec+0x12/0x1d
  [&lt;ffffffff817d7257&gt;] sock_sendmsg+0x29/0x2e
  [&lt;ffffffff817d72cc&gt;] sock_write_iter+0x70/0x91
  [&lt;ffffffff81199563&gt;] __vfs_write+0x7e/0xa7
  [&lt;ffffffff811996bc&gt;] vfs_write+0x92/0xe8
  [&lt;ffffffff811997d7&gt;] SyS_write+0x47/0x7e
  [&lt;ffffffff81a4d517&gt;] system_call_fastpath+0x12/0x6f

Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Cc: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Acked-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Acked-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
