android_kernel_sony_sdm845/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sven Eckelmann 01b0a8c047 batman-adv: Don't expect inter-netns unique iflink indices
commit 6c1f41afc1dbe59d9d3c8bb0d80b749c119aa334 upstream.

The ifindex doesn't have to be unique for multiple network namespaces on
the same machine.

  $ ip netns add test1
  $ ip -net test1 link add dummy1 type dummy
  $ ip netns add test2
  $ ip -net test2 link add dummy2 type dummy

  $ ip -net test1 link show dev dummy1
  6: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/ether 96:81:55:1e:dd:85 brd ff:ff:ff:ff:ff:ff
  $ ip -net test2 link show dev dummy2
  6: dummy2: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/ether 5a:3c:af:35:07:c3 brd ff:ff:ff:ff:ff:ff

But the batman-adv code to walk through the various layers of virtual
interfaces uses this assumption because dev_get_iflink handles it
internally and doesn't return the actual netns of the iflink. And
dev_get_iflink only documents the situation where ifindex == iflink for
physical devices.

But only checking for dev->netdev_ops->ndo_get_iflink is also not an option
because ipoib_get_iflink implements it even when it sometimes returns an
iflink != ifindex and sometimes iflink == ifindex. The caller must
therefore make sure itself to check both netns and iflink + ifindex for
equality. Only when they are equal, a "physical" interface was detected
which should stop the traversal. On the other hand, vxcan_get_iflink can
also return 0 in case there was currently no valid peer. In this case, it
is still necessary to stop.

Fixes: b7eddd0b39 ("batman-adv: prevent using any virtual device created on batman-adv as hard-interface")
Fixes: 5ed4a460a1d3 ("batman-adv: additional checks for virtual interfaces on top of WiFi")
Reported-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
[ bp: 4.9 backported: drop modification of non-existing batadv_get_real_netdevice. ]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-16 12:49:01 +01:00
..
6lowpan 6lowpan: Off by one handling ->nexthdr 2020-01-29 10:24:22 +01:00
9p 9p/trans_virtio: Remove sysfs file on probe failure 2021-09-26 13:36:18 +02:00
802 net/802/garp: fix memleak in garp_request_join() 2021-08-04 11:58:02 +02:00
8021q vlan: fix memory leak in vlan_dev_set_egress_priority 2020-01-12 11:24:27 +01:00
appletalk appletalk: Fix skb allocation size in loopback case 2021-04-07 12:05:39 +02:00
atm atm: fix a memory leak of vcc->user_back 2020-10-01 20:40:12 +02:00
ax25 ax25: Fix NULL pointer dereference in ax25_kill_by_device 2022-03-16 12:49:00 +01:00
batman-adv batman-adv: Don't expect inter-netns unique iflink indices 2022-03-16 12:49:01 +01:00
bluetooth Bluetooth: refactor malicious adv data check 2022-02-08 18:15:26 +01:00
bridge netfilter: bridge: add support for pppoe filtering 2022-01-27 08:47:33 +01:00
caif net-caif: avoid user-triggerable WARN_ON(1) 2021-09-22 11:43:09 +02:00
can can: bcm: fix UAF of bcm op 2022-02-08 18:15:26 +01:00
ceph libceph: clear con->out_msg on Policy::stateful_server faults 2020-11-10 10:23:59 +01:00
core net-sysfs: add check for netdevice being present to speed_show 2022-03-16 12:49:01 +01:00
dcb net: dcb: disable softirqs in dcbnl_flush_dev() 2022-03-08 19:00:59 +01:00
dccp dccp: don't duplicate ccid when cloning dccp sock 2021-09-22 11:43:09 +02:00
decnet net: decnet: Fix sleeping inside in af_decnet 2021-07-28 09:14:27 +02:00
dns_resolver KEYS: DNS: fix parsing multiple options 2018-07-22 14:27:39 +02:00
dsa net: dsa: tag_brcm: Fix skb->fwd_offload_mark location 2020-04-13 10:32:53 +02:00
ethernet net: add annotations on hh->hh_len lockless accesses 2020-01-12 11:24:19 +01:00
hsr hsr: use netdev_err() instead of WARN_ONCE() 2021-05-22 10:40:20 +02:00
ieee802154 net: ieee802154: Return meaningful error codes from the netlink helpers 2022-02-08 18:15:29 +01:00
ipv4 gso: do not skip outer ip header in case of ipip and net_failover 2022-03-02 11:32:02 +01:00
ipv6 xfrm: fix MTU regression 2022-03-08 19:00:57 +01:00
ipx ipx: call ipxitf_put() in ioctl error path 2017-05-25 15:44:41 +02:00
irda irda: Only insert new objects into the global database via setsockopt 2018-09-15 09:43:01 +02:00
iucv net/af_iucv: set correct sk_protocol for child sockets 2020-12-11 13:37:56 +01:00
kcm kcm: switch order of device registration to fix a crash 2019-04-17 08:36:44 +02:00
key af_key: relax availability checks for skb size calculation 2021-02-23 13:59:14 +01:00
l2tp net/l2tp: Fix reference count leak in l2tp_udp_recv_core 2021-09-22 11:43:09 +02:00
l3mdev
lapb net: lapb: Copy the skb before sending a packet 2021-02-10 09:09:25 +01:00
llc net: llc: fix skb_over_panic 2021-08-04 11:58:03 +02:00
mac80211 mac80211: fix forwarded mesh frames AC & queue selection 2022-03-08 19:00:58 +01:00
mac802154 net: mac802154: Fix general protection fault 2021-04-16 11:59:10 +02:00
mpls net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0 2021-03-17 16:10:13 +01:00
ncsi net/ncsi: Use real net-device for response handler 2021-01-12 19:49:01 +01:00
netfilter netfilter: nf_queue: fix possible use-after-free 2022-03-08 19:00:57 +01:00
netlabel cipso,calipso: resolve a number of problems with the DOI refcounts 2022-01-27 08:47:42 +01:00
netlink net: netlink: af_netlink: Prevent empty skb by adding a check on len. 2021-12-22 09:05:13 +01:00
netrom netrom: Decrease sock refcount when sock timers expire 2021-07-28 09:14:27 +02:00
nfc nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind() 2022-01-27 08:47:31 +01:00
openvswitch openvswitch: Fix setting ipv6 fields causing hw csum failure 2022-03-02 11:32:02 +01:00
packet af_packet: fix data-race in packet_setsockopt / packet_setsockopt 2022-02-08 18:15:28 +01:00
phonet phonet: refcount leak in pep_sock_accep 2022-01-11 13:38:12 +01:00
qrtr net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() 2021-03-30 14:41:42 +02:00
rds net/rds: correct socket tunable error in rds_tcp_tune() 2021-12-08 08:45:06 +01:00
rfkill rfkill: Fix incorrect check to avoid NULL pointer dereference 2020-01-12 11:24:23 +01:00
rose rose: Fix Null pointer dereference in rose_send_frame() 2020-12-11 13:37:56 +01:00
rxrpc rxrpc: Fix handling of an unsupported token type in rxrpc_read() 2021-01-23 15:38:19 +01:00
sched net_sched: restore "mpu xxx" handling 2022-01-27 08:47:42 +01:00
sctp sctp: fix kernel-infoleak for SCTP sockets 2022-03-16 12:49:01 +01:00
strparser strparser: Fix incorrect strp->need_bytes value. 2018-04-29 11:32:02 +02:00
sunrpc rpc: fix gss_svc_init cleanup on failure 2021-09-22 11:43:07 +02:00
switchdev switchdev: Execute bridge ndos only for bridge ports 2016-10-19 10:58:04 -04:00
tipc tipc: rate limit warning for received illegal binding update 2022-02-16 12:43:54 +01:00
unix af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress 2022-01-27 08:47:41 +01:00
vmw_vsock vsock: remove vsock from connected table when connect is interrupted by a signal 2022-02-23 11:56:40 +01:00
wimax
wireless cfg80211: call cfg80211_stop_ap when switch from P2P_GO type 2021-11-26 11:48:43 +01:00
x25 net/x25: Return the correct errno code 2021-06-30 08:49:12 -04:00
xfrm xfrm: Fix error reporting in xfrm_state_construct. 2021-07-20 16:21:07 +02:00
compat.c net: Return the correct errno code 2021-06-30 08:49:12 -04:00
Kconfig
Makefile net: split out functions related to registering inflight socket files 2021-08-04 11:58:01 +02:00
socket.c net: Set fput_needed iff FDPUT_FPUT is set 2020-08-21 11:02:04 +02:00
sysctl_net.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2016-10-06 09:52:23 -07:00