Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1635154pxf; Fri, 19 Mar 2021 11:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyny4p0rU2ZGzM4TRpZMvzLvm3uTFTQM/UgKwaJQ1sH4lEstlUy4b2yXpNge5qC2bbu9W/M X-Received: by 2002:a17:906:c1ca:: with SMTP id bw10mr5955659ejb.510.1616179082074; Fri, 19 Mar 2021 11:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616179082; cv=none; d=google.com; s=arc-20160816; b=Sm9XhGSUDKHJcMPhr18HHeFMNdI9iLWCO5PA4EUZ4Q8/tsAlFs9D0TPS/IxWPszUQ9 fe45Lld3GsXG3vTHyKSb0fHneVsdlN8ipVqDdNrjq+P+5NjMrmoIi4jYFzsxT+Kiyb2r 5hN/36ziDUAtyfg0Swb6CYNKAXbyIoqsolyTPyL0FvNmv5qXAGM3+VQG9q99uSPsrRI/ lrnxkWamqF27p0AcY003pe++v8xKXQMfnfnaCbmigkarjZJb8MUSwZhbTezzjlbua4PU 39/K9Es4I98F2bXLbPe471RTga3ylbTsmwkqYZc2iR5FfISdaXJOFYV/uRdm/7ER+p7p w7kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=MFCVtENjBI3XFTYruH+r3sdrMzrerZrdEDh6dTMmGfU=; b=V7vDbpk0m3hGGgf0kdQnd4cZjM8ona2T2KSHqi85BD09FKPof5RFHc9o88YMRluDmZ N32mEboDE7jRpNJ27mwAy5F1o6s92gree2vjg+YxMElGd7LMJRTb3ueT3VkGO9W5RAJN 196mrRVNjF9p78zurO+JHUcafz6p4KmfXt08UhhStWRLEdOY++IzBPJFAy1EJQW5aiOT DTZW0b1sM5QdcO5J64pyrYJ3EON00mIBAiGv+xXuTm5s6csHdCm5ztQCyLULyIOWu2pq gFcQKCrWO9o6LxrgqmqKW+ftZNXPR5e2K23mb8uffktjfbFCWTkL1/f6uq3mb29/0UJy NbdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="Owgj/AGX"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si4664138eja.638.2021.03.19.11.37.39; Fri, 19 Mar 2021 11:38:02 -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=@amazon.com header.s=amazon201209 header.b="Owgj/AGX"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230439AbhCSSeJ (ORCPT + 99 others); Fri, 19 Mar 2021 14:34:09 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:34715 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbhCSSdy (ORCPT ); Fri, 19 Mar 2021 14:33:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1616178834; x=1647714834; h=date:from:to:cc:subject:message-id:mime-version; bh=MFCVtENjBI3XFTYruH+r3sdrMzrerZrdEDh6dTMmGfU=; b=Owgj/AGX8LAonSVhXrxbTNyNnpNJ1U4bRYhsFvDfZfbtgvEGL70ZDriz PBs5mJWV4UejFIXMiiIBc3xhvaYChPjJdfI6xMwlELTtS4ikLQkeCzhhB 35guWMK6FkLiaqfazZXrb6C8N5OD/l0YKz7SjjrmbQ8CzZOlVmSo0MaYF w=; X-IronPort-AV: E=Sophos;i="5.81,262,1610409600"; d="scan'208";a="94599431" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1d-16425a8d.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 19 Mar 2021 18:33:44 +0000 Received: from EX13MTAUEE001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1d-16425a8d.us-east-1.amazon.com (Postfix) with ESMTPS id 5426D100AB0; Fri, 19 Mar 2021 18:33:43 +0000 (UTC) Received: from EX13D06UEA002.ant.amazon.com (10.43.61.198) by EX13MTAUEE001.ant.amazon.com (10.43.62.226) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 19 Mar 2021 18:33:42 +0000 Received: from ucf43ac461c9a53.ant.amazon.com (10.43.161.86) by EX13D06UEA002.ant.amazon.com (10.43.61.198) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 19 Mar 2021 18:33:40 +0000 Date: Fri, 19 Mar 2021 14:33:37 -0400 From: Tong Zhu To: , , , , , CC: Subject: [PATCH] neighbour: Disregard DEAD dst in neigh_update Message-ID: <20210319183327.GA25778@ucf43ac461c9a53.ant.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.43.161.86] X-ClientProxiedBy: EX13D41UWB002.ant.amazon.com (10.43.161.109) To EX13D06UEA002.ant.amazon.com (10.43.61.198) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 e2982b3970b8..8379719d1dce 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1379,7 +1379,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.17.1