]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
neighbour: Disregard DEAD dst in neigh_update
authorTong Zhu <zhutong@amazon.com>
Fri, 19 Mar 2021 18:33:37 +0000 (14:33 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 May 2021 07:53:54 +0000 (09:53 +0200)
commita68adfa20dc8417f270b26860a07b646d37dc34e
tree0dbf583d45ce575a51a847f00e6165431fb672dc
parent5cf903b9438f8c211f915145cdf27932771fcc74
neighbour: Disregard DEAD dst in neigh_update

BugLink: https://bugs.launchpad.net/bugs/1926999
[ Upstream commit d47ec7a0a7271dda08932d6208e4ab65ab0c987c ]

After a short network outage, the dst_entry is timed out and put
in DST_OBSOLETE_DEAD. We are in this code because arp reply comes
from this neighbour after network recovers. There is a potential
race condition that dst_entry is still in DST_OBSOLETE_DEAD.
With that, another neighbour lookup causes more harm than good.

In best case all packets in arp_queue are lost. This is
counterproductive to the original goal of finding a better path
for those packets.

I observed a worst case with 4.x kernel where a dst_entry in
DST_OBSOLETE_DEAD state is associated with loopback net_device.
It leads to an ethernet header with all zero addresses.
A packet with all zero source MAC address is quite deadly with
mac80211, ath9k and 802.11 block ack.  It fails
ieee80211_find_sta_by_ifaddr in ath9k (xmit.c). Ath9k flushes tx
queue (ath_tx_complete_aggr). BAW (block ack window) is not
updated. BAW logic is damaged and ath9k transmission is disabled.

Signed-off-by: Tong Zhu <zhutong@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/core/neighbour.c