Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2546283pxb; Mon, 19 Apr 2021 08:09:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV+KGoCz28WCljNK53jpBu9gQXg3sjoMx+ftjEsdhN1srhjjwOL0i4bdNlZ9EqOQRSeMsC X-Received: by 2002:a63:2314:: with SMTP id j20mr12335424pgj.409.1618844962611; Mon, 19 Apr 2021 08:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618844962; cv=none; d=google.com; s=arc-20160816; b=Su3bLAphj7BA8Zfw5+U/Ux+rk5CiK0orCFwj3pcxYiZctW+AOmKJpywvkd7uAI/K9E v7Hcn7A3uEYJr3WESRNDMy8FklsPXZD4K0fpqhN6xlwaDc8/L8kDNuUfmsuuT2jxXDE9 KYDPBzNTn9vr96wXWahyQJjqWcn91Ih4EpavhZpxbstdSoqG+TlrJWAT0mEWRF/i6ypc Quw1MiQ+1sDs6bb5ipWGxxazOWvPE5scwH+AzoFDxO6ju2eAlX5D8xFWimKGT4jDaXhH Yy1OcSuPdpLkpa6NgIQ0samuIFgnV08egHmn1hMrgOAtLt7KRe+vSaOo4irnfALnqk4j cF6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Eo29ln2T5TrAEU6qP8rvm9Tiv6v9OHOaFC9dFcBFhVg=; b=YrUjdW9Iaf+YNgEqUWjqEToy8m1KiJ9BNoNiMbi+qoBrOAP6EzYkUovYKuDACcwJYg 6OhG6sHwsD4tps42++o0EiD04az1tSPAyEnlZOhapL712w6YCMkb9/ZdUPU1F08jDDiB puK2liXrdnhoJje7jH6U9NBkMkZxSgxNKpQhn+7OsFuwmHvwZZ//XLxtqUHHGwzGBlMz MUMyufW9zPpdSpTwS8MtXgJdfnTJnK9T1x1oY8r3F6LmYy+oeBynMlrDWV2kwGGnOGJ0 h/rrcDW/NhS/1Y9QyQOCWRkjBaPvT5jhI8S2ZgicBaufvksC6SVoGxK6d/JhNVxId8at 60vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RjvRlAXP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si18379860pga.365.2021.04.19.08.09.09; Mon, 19 Apr 2021 08:09:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RjvRlAXP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239575AbhDSNMc (ORCPT + 99 others); Mon, 19 Apr 2021 09:12:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:45730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238492AbhDSNKr (ORCPT ); Mon, 19 Apr 2021 09:10:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 48F4C61364; Mon, 19 Apr 2021 13:10:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618837816; bh=rX390SiO/YXKxx4ZKmYe4BkaQu+3j707HAVuSfCyoLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RjvRlAXPs0B9tno3wAocHYYa84konwO2BVsOzORcG7AEfFukumfVvNNYlOOmjIMN1 qK/cGH3aB0EQY8c62+AgnRXa09l5aX4H/mXb5iu/mRiFovz9cpXDp5S54/cpbeG+oE VEdvMNS6DbA04Hi11ydDwHTgXgk80FkfVRqo0PnY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tong Zhu , "David S. Miller" , Sasha Levin Subject: [PATCH 5.11 029/122] neighbour: Disregard DEAD dst in neigh_update Date: Mon, 19 Apr 2021 15:05:09 +0200 Message-Id: <20210419130531.151963067@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130530.166331793@linuxfoundation.org> References: <20210419130530.166331793@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tong Zhu [ 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/core/neighbour.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 6d2d557442dc..7b413fe907d6 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1380,7 +1380,7 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr, * we can reinject the packet there. */ n2 = NULL; - if (dst) { + if (dst && dst->obsolete != DST_OBSOLETE_DEAD) { n2 = dst_neigh_lookup_skb(dst, skb); if (n2) n1 = n2; -- 2.30.2