Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2521861pxb; Mon, 19 Apr 2021 07:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt3zFgBBzSe0ElcOvjC2mA/Eg724TTtEnhL+tEqzR2pT8jGRW5HhyztyOCsi/cu6cc9AjJ X-Received: by 2002:a50:fd13:: with SMTP id i19mr11640357eds.375.1618843218375; Mon, 19 Apr 2021 07:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618843218; cv=none; d=google.com; s=arc-20160816; b=Thpr59uQTjtZYocCbe+5SlHMVm3ckSddtkH7wwR0zIlLhRUga3z6xpsQmNt+hIBRt2 m7Jy0BQTugDT3xGzpnPPPSqlMKQMFFePK0K5Qq6ax3MX7yeR4WLUl5tozPzhiBHzQy3x kANezWHuN4MlWxlcdc4lIT9EKft8nYIbgcumn0PtMkIXpxgffkMSk5FqNOg1x9OkDjEi saZr7O8TwqISoKnI3VZuCS3nK3ix477gwp6poYvFpTtznVDbcnjOsAGYwDdkb9x76OsL aW17kenEj5duFIV2KyOITh5isP2nj1iMLIZKCiF7rlQoxN9Q6GRALk+8zsVSud0wdoyX pZXA== 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=X8eIIFJVoiDFQ9VK9t5k5gDZAE3+lRusc3eXxqGQgDs=; b=j806pLi6O/KZfmeDv+otOVBuLB0polFT07ayorKM0KOxwXjVqshcTMwmFSNRCVtLLY mbpDzsyG1qqZgqSwmXj0yIfxMwS7QaUi8KIOZ7Sxzx1UKTozCUw6Fv6zfNbdQJ2xPzCr NFVxOkh0kg4KwuP1CHGJBCep69n7EkDcnEIq5nb9e4ARIvxU2s0Ka1kGWwrV1sp5N04I hY5RFunxyGAJOVoc2c1i5EyYa1DWC1cFBb+BDLln4KNJ4iFc13TrA7YDru119/jypG32 42+ADcP/m0dzL1RmiHcySEYWqryGTB8ANpi9nw+AlU6ElSW/vnNFR5lQwZCVsLD/fEfJ 91nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C+DN3Yt8; 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 w15si12502468edc.302.2021.04.19.07.39.54; Mon, 19 Apr 2021 07:40:18 -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=C+DN3Yt8; 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 S240597AbhDSNVR (ORCPT + 99 others); Mon, 19 Apr 2021 09:21:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:54806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239640AbhDSNQq (ORCPT ); Mon, 19 Apr 2021 09:16:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EFFD761246; Mon, 19 Apr 2021 13:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838046; bh=QXEEnIMFb1usIywqSO4YVq+/fmvHo02LzcJsp6j+few=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C+DN3Yt8V7jBph6bo7CkicusnfZ8M2IM7SReSxA4uj6qlDqAlCoz9dsYZGYzmsPtL 62D5gU7SdtPwhq1yU3B8o0CjgoBRiTGIelPXPXsL/gCPjUs9xJ1rxBb9HtWwaldqH6 cnU/xibjlbUB35ipc6BQpbZ6prtIwLHqCiYz7eCs= 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.10 023/103] neighbour: Disregard DEAD dst in neigh_update Date: Mon, 19 Apr 2021 15:05:34 +0200 Message-Id: <20210419130528.590661430@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@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 2fe4bbb6b80c..8339978d46ff 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