<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/net/ipvlan, branch v4.4.271</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.271</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.271'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-09-03T09:19:22Z</updated>
<entry>
<title>ipvlan: fix device features</title>
<updated>2020-09-03T09:19:22Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2020-08-15T05:53:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f7f299f1a5021d968df7af9fcbeba8c465671b0a'/>
<id>urn:sha1:f7f299f1a5021d968df7af9fcbeba8c465671b0a</id>
<content type='text'>
[ Upstream commit d0f5c7076e01fef6fcb86988d9508bf3ce258bd4 ]

Processing NETDEV_FEAT_CHANGE causes IPvlan links to lose
NETIF_F_LLTX feature because of the incorrect handling of
features in ipvlan_fix_features().

--before--
lpaa10:~# ethtool -k ipvl0 | grep tx-lockless
tx-lockless: on [fixed]
lpaa10:~# ethtool -K ipvl0 tso off
Cannot change tcp-segmentation-offload
Actual changes:
vlan-challenged: off [fixed]
tx-lockless: off [fixed]
lpaa10:~# ethtool -k ipvl0 | grep tx-lockless
tx-lockless: off [fixed]
lpaa10:~#

--after--
lpaa10:~# ethtool -k ipvl0 | grep tx-lockless
tx-lockless: on [fixed]
lpaa10:~# ethtool -K ipvl0 tso off
Cannot change tcp-segmentation-offload
Could not change any device features
lpaa10:~# ethtool -k ipvl0 | grep tx-lockless
tx-lockless: on [fixed]
lpaa10:~#

Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Cc: 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>ipvlan: don't deref eth hdr before checking it's set</title>
<updated>2020-03-20T08:06:21Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2020-03-09T22:56:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=85a45e23770fc0a2b279ff34c597b53e41582893'/>
<id>urn:sha1:85a45e23770fc0a2b279ff34c597b53e41582893</id>
<content type='text'>
[ Upstream commit ad8192767c9f9cf97da57b9ffcea70fb100febef ]

IPvlan in L3 mode discards outbound multicast packets but performs
the check before ensuring the ether-header is set or not. This is
an error that Eric found through code browsing.

Fixes: 2ad7bf363841 (“ipvlan: Initial check-in of the IPVLAN driver.”)
Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Reported-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>ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast()</title>
<updated>2020-03-20T08:06:20Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2020-03-10T01:22:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ad4e61b9faea41c4ee20f81cf2d2f52d369bdce1'/>
<id>urn:sha1:ad4e61b9faea41c4ee20f81cf2d2f52d369bdce1</id>
<content type='text'>
[ Upstream commit afe207d80a61e4d6e7cfa0611a4af46d0ba95628 ]

Commit e18b353f102e ("ipvlan: add cond_resched_rcu() while
processing muticast backlog") added a cond_resched_rcu() in a loop
using rcu protection to iterate over slaves.

This is breaking rcu rules, so lets instead use cond_resched()
at a point we can reschedule

Fixes: e18b353f102e ("ipvlan: add cond_resched_rcu() while processing muticast backlog")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Mahesh Bandewar &lt;maheshb@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>ipvlan: egress mcast packets are not exceptional</title>
<updated>2020-03-20T08:06:20Z</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2018-02-28T10:43:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f4ec628a28dad91f4143af9af986895492f5f44c'/>
<id>urn:sha1:f4ec628a28dad91f4143af9af986895492f5f44c</id>
<content type='text'>
commit cccc200fcaf04cff4342036a72e51d6adf6c98c1 upstream.

Currently, if IPv6 is enabled on top of an ipvlan device in l3
mode, the following warning message:

 Dropped {multi|broad}cast of type= [86dd]

is emitted every time that a RS is generated and dmseg is soon
filled with irrelevant messages. Replace pr_warn with pr_debug,
to preserve debuggability, without scaring the sysadmin.

Signed-off-by: Paolo Abeni &lt;pabeni@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>ipvlan: do not add hardware address of master to its unicast filter list</title>
<updated>2020-03-20T08:06:20Z</updated>
<author>
<name>Jiri Wiesner</name>
<email>jwiesner@suse.com</email>
</author>
<published>2020-03-07T12:31:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a86eb074760381a1d554982b65369e9b7521a4f2'/>
<id>urn:sha1:a86eb074760381a1d554982b65369e9b7521a4f2</id>
<content type='text'>
[ Upstream commit 63aae7b17344d4b08a7d05cb07044de4c0f9dcc6 ]

There is a problem when ipvlan slaves are created on a master device that
is a vmxnet3 device (ipvlan in VMware guests). The vmxnet3 driver does not
support unicast address filtering. When an ipvlan device is brought up in
ipvlan_open(), the ipvlan driver calls dev_uc_add() to add the hardware
address of the vmxnet3 master device to the unicast address list of the
master device, phy_dev-&gt;uc. This inevitably leads to the vmxnet3 master
device being forced into promiscuous mode by __dev_set_rx_mode().

Promiscuous mode is switched on the master despite the fact that there is
still only one hardware address that the master device should use for
filtering in order for the ipvlan device to be able to receive packets.
The comment above struct net_device describes the uc_promisc member as a
"counter, that indicates, that promiscuous mode has been enabled due to
the need to listen to additional unicast addresses in a device that does
not implement ndo_set_rx_mode()". Moreover, the design of ipvlan
guarantees that only the hardware address of a master device,
phy_dev-&gt;dev_addr, will be used to transmit and receive all packets from
its ipvlan slaves. Thus, the unicast address list of the master device
should not be modified by ipvlan_open() and ipvlan_stop() in order to make
ipvlan a workable option on masters that do not support unicast address
filtering.

Fixes: 2ad7bf3638411 ("ipvlan: Initial check-in of the IPVLAN driver")
Reported-by: Per Sundstrom &lt;per.sundstrom@redqube.se&gt;
Signed-off-by: Jiri Wiesner &lt;jwiesner@suse.com&gt;
Reviewed-by: Eric Dumazet &lt;edumazet@google.com&gt;
Acked-by: Mahesh Bandewar &lt;maheshb@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>ipvlan: add cond_resched_rcu() while processing muticast backlog</title>
<updated>2020-03-20T08:06:20Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2020-03-09T22:57:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=32bf9980ddb6908f22421f556a081899f8d7902d'/>
<id>urn:sha1:32bf9980ddb6908f22421f556a081899f8d7902d</id>
<content type='text'>
[ Upstream commit e18b353f102e371580f3f01dd47567a25acc3c1d ]

If there are substantial number of slaves created as simulated by
Syzbot, the backlog processing could take much longer and result
into the issue found in the Syzbot report.

INFO: rcu_sched detected stalls on CPUs/tasks:
        (detected by 1, t=10502 jiffies, g=5049, c=5048, q=752)
All QSes seen, last rcu_sched kthread activity 10502 (4294965563-4294955061), jiffies_till_next_fqs=1, root -&gt;qsmask 0x0
syz-executor.1  R  running task on cpu   1  10984 11210   3866 0x30020008 179034491270
Call Trace:
 &lt;IRQ&gt;
 [&lt;ffffffff81497163&gt;] _sched_show_task kernel/sched/core.c:8063 [inline]
 [&lt;ffffffff81497163&gt;] _sched_show_task.cold+0x2fd/0x392 kernel/sched/core.c:8030
 [&lt;ffffffff8146a91b&gt;] sched_show_task+0xb/0x10 kernel/sched/core.c:8073
 [&lt;ffffffff815c931b&gt;] print_other_cpu_stall kernel/rcu/tree.c:1577 [inline]
 [&lt;ffffffff815c931b&gt;] check_cpu_stall kernel/rcu/tree.c:1695 [inline]
 [&lt;ffffffff815c931b&gt;] __rcu_pending kernel/rcu/tree.c:3478 [inline]
 [&lt;ffffffff815c931b&gt;] rcu_pending kernel/rcu/tree.c:3540 [inline]
 [&lt;ffffffff815c931b&gt;] rcu_check_callbacks.cold+0xbb4/0xc29 kernel/rcu/tree.c:2876
 [&lt;ffffffff815e3962&gt;] update_process_times+0x32/0x80 kernel/time/timer.c:1635
 [&lt;ffffffff816164f0&gt;] tick_sched_handle+0xa0/0x180 kernel/time/tick-sched.c:161
 [&lt;ffffffff81616ae4&gt;] tick_sched_timer+0x44/0x130 kernel/time/tick-sched.c:1193
 [&lt;ffffffff815e75f7&gt;] __run_hrtimer kernel/time/hrtimer.c:1393 [inline]
 [&lt;ffffffff815e75f7&gt;] __hrtimer_run_queues+0x307/0xd90 kernel/time/hrtimer.c:1455
 [&lt;ffffffff815e90ea&gt;] hrtimer_interrupt+0x2ea/0x730 kernel/time/hrtimer.c:1513
 [&lt;ffffffff844050f4&gt;] local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1031 [inline]
 [&lt;ffffffff844050f4&gt;] smp_apic_timer_interrupt+0x144/0x5e0 arch/x86/kernel/apic/apic.c:1056
 [&lt;ffffffff84401cbe&gt;] apic_timer_interrupt+0x8e/0xa0 arch/x86/entry/entry_64.S:778
RIP: 0010:do_raw_read_lock+0x22/0x80 kernel/locking/spinlock_debug.c:153
RSP: 0018:ffff8801dad07ab8 EFLAGS: 00000a02 ORIG_RAX: ffffffffffffff12
RAX: 0000000000000000 RBX: ffff8801c4135680 RCX: 0000000000000000
RDX: 1ffff10038826afe RSI: ffff88019d816bb8 RDI: ffff8801c41357f0
RBP: ffff8801dad07ac0 R08: 0000000000004b15 R09: 0000000000310273
R10: ffff88019d816bb8 R11: 0000000000000001 R12: ffff8801c41357e8
R13: 0000000000000000 R14: ffff8801cfb19850 R15: ffff8801cfb198b0
 [&lt;ffffffff8101460e&gt;] __raw_read_lock_bh include/linux/rwlock_api_smp.h:177 [inline]
 [&lt;ffffffff8101460e&gt;] _raw_read_lock_bh+0x3e/0x50 kernel/locking/spinlock.c:240
 [&lt;ffffffff840d78ca&gt;] ipv6_chk_mcast_addr+0x11a/0x6f0 net/ipv6/mcast.c:1006
 [&lt;ffffffff84023439&gt;] ip6_mc_input+0x319/0x8e0 net/ipv6/ip6_input.c:482
 [&lt;ffffffff840211c8&gt;] dst_input include/net/dst.h:449 [inline]
 [&lt;ffffffff840211c8&gt;] ip6_rcv_finish+0x408/0x610 net/ipv6/ip6_input.c:78
 [&lt;ffffffff840214de&gt;] NF_HOOK include/linux/netfilter.h:292 [inline]
 [&lt;ffffffff840214de&gt;] NF_HOOK include/linux/netfilter.h:286 [inline]
 [&lt;ffffffff840214de&gt;] ipv6_rcv+0x10e/0x420 net/ipv6/ip6_input.c:278
 [&lt;ffffffff83a29efa&gt;] __netif_receive_skb_one_core+0x12a/0x1f0 net/core/dev.c:5303
 [&lt;ffffffff83a2a15c&gt;] __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:5417
 [&lt;ffffffff83a2f536&gt;] process_backlog+0x216/0x6c0 net/core/dev.c:6243
 [&lt;ffffffff83a30d1b&gt;] napi_poll net/core/dev.c:6680 [inline]
 [&lt;ffffffff83a30d1b&gt;] net_rx_action+0x47b/0xfb0 net/core/dev.c:6748
 [&lt;ffffffff846002c8&gt;] __do_softirq+0x2c8/0x99a kernel/softirq.c:317
 [&lt;ffffffff813e656a&gt;] invoke_softirq kernel/softirq.c:399 [inline]
 [&lt;ffffffff813e656a&gt;] irq_exit+0x16a/0x1a0 kernel/softirq.c:439
 [&lt;ffffffff84405115&gt;] exiting_irq arch/x86/include/asm/apic.h:561 [inline]
 [&lt;ffffffff84405115&gt;] smp_apic_timer_interrupt+0x165/0x5e0 arch/x86/kernel/apic/apic.c:1058
 [&lt;ffffffff84401cbe&gt;] apic_timer_interrupt+0x8e/0xa0 arch/x86/entry/entry_64.S:778
 &lt;/IRQ&gt;
RIP: 0010:__sanitizer_cov_trace_pc+0x26/0x50 kernel/kcov.c:102
RSP: 0018:ffff880196033bd8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff12
RAX: ffff88019d8161c0 RBX: 00000000ffffffff RCX: ffffc90003501000
RDX: 0000000000000002 RSI: ffffffff816236d1 RDI: 0000000000000005
RBP: ffff880196033bd8 R08: ffff88019d8161c0 R09: 0000000000000000
R10: 1ffff10032c067f0 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000080 R14: 0000000000000000 R15: 0000000000000000
 [&lt;ffffffff816236d1&gt;] do_futex+0x151/0x1d50 kernel/futex.c:3548
 [&lt;ffffffff816260f0&gt;] C_SYSC_futex kernel/futex_compat.c:201 [inline]
 [&lt;ffffffff816260f0&gt;] compat_SyS_futex+0x270/0x3b0 kernel/futex_compat.c:175
 [&lt;ffffffff8101da17&gt;] do_syscall_32_irqs_on arch/x86/entry/common.c:353 [inline]
 [&lt;ffffffff8101da17&gt;] do_fast_syscall_32+0x357/0xe1c arch/x86/entry/common.c:415
 [&lt;ffffffff84401a9b&gt;] entry_SYSENTER_compat+0x8b/0x9d arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7f23c69
RSP: 002b:00000000f5d1f12c EFLAGS: 00000282 ORIG_RAX: 00000000000000f0
RAX: ffffffffffffffda RBX: 000000000816af88 RCX: 0000000000000080
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000816af8c
RBP: 00000000f5d1f228 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
rcu_sched kthread starved for 10502 jiffies! g5049 c5048 f0x2 RCU_GP_WAIT_FQS(3) -&gt;state=0x0 -&gt;cpu=1
rcu_sched       R  running task on cpu   1  13048     8      2 0x90000000 179099587640
Call Trace:
 [&lt;ffffffff8147321f&gt;] context_switch+0x60f/0xa60 kernel/sched/core.c:3209
 [&lt;ffffffff8100095a&gt;] __schedule+0x5aa/0x1da0 kernel/sched/core.c:3934
 [&lt;ffffffff810021df&gt;] schedule+0x8f/0x1b0 kernel/sched/core.c:4011
 [&lt;ffffffff8101116d&gt;] schedule_timeout+0x50d/0xee0 kernel/time/timer.c:1803
 [&lt;ffffffff815c13f1&gt;] rcu_gp_kthread+0xda1/0x3b50 kernel/rcu/tree.c:2327
 [&lt;ffffffff8144b318&gt;] kthread+0x348/0x420 kernel/kthread.c:246
 [&lt;ffffffff84400266&gt;] ret_from_fork+0x56/0x70 arch/x86/entry/entry_64.S:393

Fixes: ba35f8588f47 (“ipvlan: Defer multicast / broadcast processing to a work-queue”)
Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Reported-by: syzbot &lt;syzkaller@googlegroups.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>ipvlan: disallow userns cap_net_admin to change global mode/flags</title>
<updated>2019-03-23T07:44:31Z</updated>
<author>
<name>Daniel Borkmann</name>
<email>daniel@iogearbox.net</email>
</author>
<published>2019-02-19T23:15:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cb604342bc8596967493e2ee2aa991d2745ca42b'/>
<id>urn:sha1:cb604342bc8596967493e2ee2aa991d2745ca42b</id>
<content type='text'>
[ Upstream commit 7cc9f7003a969d359f608ebb701d42cafe75b84a ]

When running Docker with userns isolation e.g. --userns-remap="default"
and spawning up some containers with CAP_NET_ADMIN under this realm, I
noticed that link changes on ipvlan slave device inside that container
can affect all devices from this ipvlan group which are in other net
namespaces where the container should have no permission to make changes
to, such as the init netns, for example.

This effectively allows to undo ipvlan private mode and switch globally to
bridge mode where slaves can communicate directly without going through
hostns, or it allows to switch between global operation mode (l2/l3/l3s)
for everyone bound to the given ipvlan master device. libnetwork plugin
here is creating an ipvlan master and ipvlan slave in hostns and a slave
each that is moved into the container's netns upon creation event.

* In hostns:

  # ip -d a
  [...]
  8: cilium_host@bond0: &lt;BROADCAST,MULTICAST,NOARP,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
     link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
     ipvlan  mode l3 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
     inet 10.41.0.1/32 scope link cilium_host
       valid_lft forever preferred_lft forever
  [...]

* Spawn container &amp; change ipvlan mode setting inside of it:

  # docker run -dt --cap-add=NET_ADMIN --network cilium-net --name client -l app=test cilium/netperf
  9fff485d69dcb5ce37c9e33ca20a11ccafc236d690105aadbfb77e4f4170879c

  # docker exec -ti client ip -d a
  [...]
  10: cilium0@if4: &lt;BROADCAST,MULTICAST,NOARP,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
      link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
      ipvlan  mode l3 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
      inet 10.41.197.43/32 brd 10.41.197.43 scope global cilium0
         valid_lft forever preferred_lft forever

  # docker exec -ti client ip link change link cilium0 name cilium0 type ipvlan mode l2

  # docker exec -ti client ip -d a
  [...]
  10: cilium0@if4: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
      link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
      ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
      inet 10.41.197.43/32 brd 10.41.197.43 scope global cilium0
         valid_lft forever preferred_lft forever

* In hostns (mode switched to l2):

  # ip -d a
  [...]
  8: cilium_host@bond0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
      link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
      ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
      inet 10.41.0.1/32 scope link cilium_host
         valid_lft forever preferred_lft forever
  [...]

Same l3 -&gt; l2 switch would also happen by creating another slave inside
the container's network namespace when specifying the existing cilium0
link to derive the actual (bond0) master:

  # docker exec -ti client ip link add link cilium0 name cilium1 type ipvlan mode l2

  # docker exec -ti client ip -d a
  [...]
  2: cilium1@if4: &lt;BROADCAST,MULTICAST&gt; mtu 1500 qdisc noop state DOWN group default qlen 1000
      link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
      ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
  10: cilium0@if4: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
      link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
      ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
      inet 10.41.197.43/32 brd 10.41.197.43 scope global cilium0
         valid_lft forever preferred_lft forever

* In hostns:

  # ip -d a
  [...]
  8: cilium_host@bond0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
      link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
      ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
      inet 10.41.0.1/32 scope link cilium_host
         valid_lft forever preferred_lft forever
  [...]

One way to mitigate it is to check CAP_NET_ADMIN permissions of
the ipvlan master device's ns, and only then allow to change
mode or flags for all devices bound to it. Above two cases are
then disallowed after the patch.

Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Mahesh Bandewar &lt;maheshb@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>ipvlan: add L2 check for packets arriving via virtual devices</title>
<updated>2018-03-22T08:23:30Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2017-12-07T23:15:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=401a3b5c027bde94e8318c4995cac8c82596b93d'/>
<id>urn:sha1:401a3b5c027bde94e8318c4995cac8c82596b93d</id>
<content type='text'>
[ Upstream commit 92ff42645028fa6f9b8aa767718457b9264316b4 ]

Packets that don't have dest mac as the mac of the master device should
not be entertained by the IPvlan rx-handler. This is mostly true as the
packet path mostly takes care of that, except when the master device is
a virtual device. As demonstrated in the following case -

  ip netns add ns1
  ip link add ve1 type veth peer name ve2
  ip link add link ve2 name iv1 type ipvlan mode l2
  ip link set dev iv1 netns ns1
  ip link set ve1 up
  ip link set ve2 up
  ip -n ns1 link set iv1 up
  ip addr add 192.168.10.1/24 dev ve1
  ip -n ns1 addr 192.168.10.2/24 dev iv1
  ping -c2 192.168.10.2
  &lt;Works!&gt;
  ip neigh show dev ve1
  ip neigh show 192.168.10.2 lladdr &lt;random&gt; dev ve1
  ping -c2 192.168.10.2
  &lt;Still works! Wrong!!&gt;

This patch adds that missing check in the IPvlan rx-handler.

Reported-by: Amit Sikka &lt;amit.sikka@ericsson.com&gt;
Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipvlan: Add the skb-&gt;mark as flow4's member to lookup route</title>
<updated>2018-02-25T10:03:40Z</updated>
<author>
<name>Gao Feng</name>
<email>gfree.wind@vip.163.com</email>
</author>
<published>2017-12-01T01:58:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5a87feefe4969b9ae9c359463337d0741dc2b520'/>
<id>urn:sha1:5a87feefe4969b9ae9c359463337d0741dc2b520</id>
<content type='text'>
[ Upstream commit a98a4ebc8c61d20f0150d6be66e0e65223a347af ]

Current codes don't use skb-&gt;mark to assign flowi4_mark, it would
make the policy route rule with fwmark doesn't work as expected.

Signed-off-by: Gao Feng &lt;gfree.wind@vip.163.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipvlan: fix ipv6 outbound device</title>
<updated>2017-12-16T09:33:56Z</updated>
<author>
<name>Keefe Liu</name>
<email>liuqifa@huawei.com</email>
</author>
<published>2017-11-09T12:09:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1b9baf30673cb261356d0a2e10d0028c267a92f6'/>
<id>urn:sha1:1b9baf30673cb261356d0a2e10d0028c267a92f6</id>
<content type='text'>
[ Upstream commit ca29fd7cce5a6444d57fb86517589a1a31c759e1 ]

When process the outbound packet of ipv6, we should assign the master
device to output device other than input device.

Signed-off-by: Keefe Liu &lt;liuqifa@huawei.com&gt;
Acked-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
