Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3405477pxy; Mon, 26 Apr 2021 00:33:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzogDlO26IWUfBQORB7nKIIOeRCrUNd8R9yanAxuu7ErUhIguXkL5zfQFsuBKyDPo0utzkt X-Received: by 2002:a17:902:d204:b029:ed:19aa:c364 with SMTP id t4-20020a170902d204b02900ed19aac364mr6200564ply.34.1619422422740; Mon, 26 Apr 2021 00:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619422422; cv=none; d=google.com; s=arc-20160816; b=pYqKdp6qL9LXjWhTNz97D1mqN9shGmHOWR0C8u8fhsvTmSCAo/cwoUf0U+AO2x61AU SonqzNfzev0O1Tj/ByIVwC3A++AQbjoeWBrLHtfhFbD9YmFsVntd4SO8kmUQjAe+0DsW /jZY1DGqCZuPHKL5ZaOAyeps7dV9r5V7p8Icj7Fso+tkYuxfT3UYNAFT4lAxbMdpx53T qWvUo08+F0jfAOVJC1bZiKxgjxXMbYFJt3KtgwagOqu3i3jd9tnDsaMeIMkWGS94WL8i POBKGj1sdrWNEl3KRtx3B13HLCTLJ6yEYFQ8M1iHIkb0McCfwyuPXgFvTJlrX0nNNOkd jnfA== 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=HIvr0kALF/P/ShQVgXXLgrVhgD1vhO4q5m0nqD6vuug=; b=IkWezms20cI1EdFv2S9gbpBNbL4I5mbCbr+9H7FoW8lE0VEsMHYGJZnmz05j9QgTss nN0wrb1qf6hB7a9TFZDR7jSVTjeP/ICVdQTZKGGsEH7kDjRmU0EhHBTH4W3pj6yHo9K3 Pu7hsNG3oPSEX/AaqzMT2nTnyrQNEMLw9F+CwHKTvj4XBTNc0OANDSBjJA/jhOlhNizl ncftDsbPTFOwp272PndEG5BU5qbl5Cih3/jCEM9TMkYrdebOrN7OM3sdqXCS1iY1ucLw vXN1A8cvt+jjR9dgAmXdJFBv0Zh2Rvfh5+Yva3Shi0+3XQAYY5xg1q7GVmqRjbk/4Esc 7IYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dlpIeOaa; 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 202si1944890pgh.102.2021.04.26.00.33.30; Mon, 26 Apr 2021 00:33:42 -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=dlpIeOaa; 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 S232356AbhDZHcJ (ORCPT + 99 others); Mon, 26 Apr 2021 03:32:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:42776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232338AbhDZHcH (ORCPT ); Mon, 26 Apr 2021 03:32:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1AF4F611C1; Mon, 26 Apr 2021 07:31:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619422285; bh=9H8SH642Tv0t3TrlVYrw0+U2J0GZT5kXkFw7TJAp/TM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dlpIeOaagbgHYfubl8IBGo+fJa45Zqu/c7/Y7zlR79BzI4HsUbRmMWnzX/Ddgusdi qjjUR45thNj0KIFnOZshqO2r3MSTskDqDU4rtVc9j34dOTefTpmTe6xdHbWvzAUwP5 4VxcqnTNTQ1TDG6qwEUpHhsyfZKnOEB8rOb+z49g= 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 4.4 06/32] neighbour: Disregard DEAD dst in neigh_update Date: Mon, 26 Apr 2021 09:29:04 +0200 Message-Id: <20210426072816.812856038@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210426072816.574319312@linuxfoundation.org> References: <20210426072816.574319312@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 40d33431bc58..17997902d316 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1234,7 +1234,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, * 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