Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2474794pxb; Mon, 19 Apr 2021 06:38:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMWK90x7wDJDfUd6l2i+56spME4dySP2wMiOBg0YQ60Xd4P5cO9Vren0Lqb5h6CEUL1NQK X-Received: by 2002:a17:906:4b01:: with SMTP id y1mr21866874eju.218.1618839528440; Mon, 19 Apr 2021 06:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618839528; cv=none; d=google.com; s=arc-20160816; b=fhwvsx05TOQG1DodziHjW6XCPnCJ7lxomagS0EdMUDGzpw8wjRgBN/9EESl2ah+8Rq FZDVcdTCEC0uGEWBpc8euIPa3t1WvoarSlhyJBjCGcXHfP1j5TtT9m39wzWl1wGKDnJu ay90JTL/ig+LBTEfzk7MePsYz50rAViI50Q//JzIJF/KrXwgY3CsjJgMCshXnXeg29OE cf8fIA4kwUXvlcT6thxqfEIbit0rc2dRhyk7yYqlvAtGiN1feJXSu7UUpeqeqe5s2nMY ugJDaYEMNBKB0hZp9PDFls1El9vyes8wtyNI0NsHpuZZviSVdE6BYYzGtOewphuXQOzp wbdA== 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=44N3ubIjNvum0xDxU6SgoGeVq/My5dfI49AETU7ln2c=; b=nhHbLESRNRR/MXCgkefy2/ZyGzK6kwn4XRp1oYsNNpwysvw/o149Utqq42J9e7c44x pO8ARuf/didlrYtGnRhgMkz6eVtRtn6cSeVGF4sMv02x+kq9vsRCnKNrLqOAbwsy5gav IZZNH2uIV1EPu8V7Af2PRFD0l1LWtXJRyNKiuH+O7yNUGBYIPcBTWRwY09J8WmD5qaXD +O84xiJpCEgF4Vby4CZH9skJGehtEAfhL2egHQEgIbhxNv56aYzUxSZoBFDnIc+XEedx br8tq8erJzRwCspudSeLcGM3poggzzFpFIKiRwt1FZCTLaSdSaA6bwseTK6iAFEPn1gP T0mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sqDlcDGk; 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 ca6si8433419edb.84.2021.04.19.06.38.24; Mon, 19 Apr 2021 06:38:48 -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=sqDlcDGk; 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 S241115AbhDSNgC (ORCPT + 99 others); Mon, 19 Apr 2021 09:36:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:34014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240984AbhDSNXG (ORCPT ); Mon, 19 Apr 2021 09:23:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 74AC56135F; Mon, 19 Apr 2021 13:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838319; bh=HNztpqO9dHFStsQuB67uf7n+hO6/spYKdUoEVkhnPQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sqDlcDGk5BuhmIq3HD17YnG1IZOl8rWJIau7Ey0QPYz6a/ieYP8//GWVebkRNFl8N oaBjfXOAqW5kazsY+G2fOBUlAXfjOLyErC8x3eCTomE5GuMxM/FBuG+ZtZnpf+uv7f 5FnlBx4Ts1XeYRabdh3f7paorA1Z1PEWtmPkiucM= 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.4 18/73] neighbour: Disregard DEAD dst in neigh_update Date: Mon, 19 Apr 2021 15:06:09 +0200 Message-Id: <20210419130524.412396745@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130523.802169214@linuxfoundation.org> References: <20210419130523.802169214@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 7080d708b7d0..6635b83113f8 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.30.2