1. 21 Apr, 2020 5 commits
    • Wang Wenhu's avatar
      net: qrtr: send msgs from local of same id as broadcast · c08e523e
      Wang Wenhu authored
      [ Upstream commit 6dbf02ac ]
      
      If the local node id(qrtr_local_nid) is not modified after its
      initialization, it equals to the broadcast node id(QRTR_NODE_BCAST).
      So the messages from local node should not be taken as broadcast
      and keep the process going to send them out anyway.
      
      The definitions are as follow:
      static unsigned int qrtr_local_nid = NUMA_NO_NODE;
      
      Fixes: fdf5fd39 ("net: qrtr: Broadcast messages only from control port")
      Signed-off-by: default avatarWang Wenhu <wenhu.wang@vivo.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c08e523e
    • Tim Stallard's avatar
      net: ipv6: do not consider routes via gateways for anycast address check · 8fdf8a84
      Tim Stallard authored
      [ Upstream commit 03e2a984 ]
      
      The behaviour for what is considered an anycast address changed in
      commit 45e4fd26 ("ipv6: Only create RTF_CACHE routes after
      encountering pmtu exception"). This now considers the first
      address in a subnet where there is a route via a gateway
      to be an anycast address.
      
      This breaks path MTU discovery and traceroutes when a host in a
      remote network uses the address at the start of a prefix
      (eg 2600:: advertised as 2600::/48 in the DFZ) as ICMP errors
      will not be sent to anycast addresses.
      
      This patch excludes any routes with a gateway, or via point to
      point links, like the behaviour previously from
      rt6_is_gw_or_nonexthop in net/ipv6/route.c.
      
      This can be tested with:
      ip link add v1 type veth peer name v2
      ip netns add test
      ip netns exec test ip link set lo up
      ip link set v2 netns test
      ip link set v1 up
      ip netns exec test ip link set v2 up
      ip addr add 2001:db8::1/64 dev v1 nodad
      ip addr add 2001:db8:100:: dev lo nodad
      ip netns exec test ip addr add 2001:db8::2/64 dev v2 nodad
      ip netns exec test ip route add unreachable 2001:db8:1::1
      ip netns exec test ip route add 2001:db8:100::/64 via 2001:db8::1
      ip netns exec test sysctl net.ipv6.conf.all.forwarding=1
      ip route add 2001:db8:1::1 via 2001:db8::2
      ping -I 2001:db8::1 2001:db8:1::1 -c1
      ping -I 2001:db8:100:: 2001:db8:1::1 -c1
      ip addr delete 2001:db8:100:: dev lo
      ip netns delete test
      
      Currently the first ping will get back a destination unreachable ICMP
      error, but the second will never get a response, with "icmp6_send:
      acast source" logged. After this patch, both get destination
      unreachable ICMP replies.
      
      Fixes: 45e4fd26 ("ipv6: Only create RTF_CACHE routes after encountering pmtu exception")
      Signed-off-by: default avatarTim Stallard <code@timstallard.me.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8fdf8a84
    • Taras Chornyi's avatar
      net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin · 80dd8146
      Taras Chornyi authored
      [ Upstream commit 690cc863 ]
      
      When CONFIG_IP_MULTICAST is not set and multicast ip is added to the device
      with autojoin flag or when multicast ip is deleted kernel will crash.
      
      steps to reproduce:
      
      ip addr add 224.0.0.0/32 dev eth0
      ip addr del 224.0.0.0/32 dev eth0
      
      or
      
      ip addr add 224.0.0.0/32 dev eth0 autojoin
      
      Unable to handle kernel NULL pointer dereference at virtual address 0000000000000088
       pc : _raw_write_lock_irqsave+0x1e0/0x2ac
       lr : lock_sock_nested+0x1c/0x60
       Call trace:
        _raw_write_lock_irqsave+0x1e0/0x2ac
        lock_sock_nested+0x1c/0x60
        ip_mc_config.isra.28+0x50/0xe0
        inet_rtm_deladdr+0x1a8/0x1f0
        rtnetlink_rcv_msg+0x120/0x350
        netlink_rcv_skb+0x58/0x120
        rtnetlink_rcv+0x14/0x20
        netlink_unicast+0x1b8/0x270
        netlink_sendmsg+0x1a0/0x3b0
        ____sys_sendmsg+0x248/0x290
        ___sys_sendmsg+0x80/0xc0
        __sys_sendmsg+0x68/0xc0
        __arm64_sys_sendmsg+0x20/0x30
        el0_svc_common.constprop.2+0x88/0x150
        do_el0_svc+0x20/0x80
       el0_sync_handler+0x118/0x190
        el0_sync+0x140/0x180
      
      Fixes: 93a714d6 ("multicast: Extend ip address command to enable multicast group join/leave on")
      Signed-off-by: default avatarTaras Chornyi <taras.chornyi@plvision.eu>
      Signed-off-by: default avatarVadym Kochan <vadym.kochan@plvision.eu>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      80dd8146
    • Taehee Yoo's avatar
      hsr: check protocol version in hsr_newlink() · 32759da2
      Taehee Yoo authored
      [ Upstream commit 4faab8c4 ]
      
      In the current hsr code, only 0 and 1 protocol versions are valid.
      But current hsr code doesn't check the version, which is received by
      userspace.
      
      Test commands:
          ip link add dummy0 type dummy
          ip link add dummy1 type dummy
          ip link add hsr0 type hsr slave1 dummy0 slave2 dummy1 version 4
      
      In the test commands, version 4 is invalid.
      So, the command should be failed.
      
      After this patch, following error will occur.
      "Error: hsr: Only versions 0..1 are supported."
      
      Fixes: ee1c2797 ("net/hsr: Added support for HSR v1")
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      32759da2
    • Sebastian Andrzej Siewior's avatar
      amd-xgbe: Use __napi_schedule() in BH context · 10cea886
      Sebastian Andrzej Siewior authored
      [ Upstream commit d518691c ]
      
      The driver uses __napi_schedule_irqoff() which is fine as long as it is
      invoked with disabled interrupts by everybody. Since the commit
      mentioned below the driver may invoke xgbe_isr_task() in tasklet/softirq
      context. This may lead to list corruption if another driver uses
      __napi_schedule_irqoff() in IRQ context.
      
      Use __napi_schedule() which safe to use from IRQ and softirq context.
      
      Fixes: 85b85c85 ("amd-xgbe: Re-issue interrupt if interrupt status not cleared")
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Acked-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      10cea886
  2. 17 Apr, 2020 35 commits