Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6775862rwn; Tue, 13 Sep 2022 08:52:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR6l8LF/5gFN7C2dbWUmYrwyEJOaE3StAt0KocEqUpJpoA+BHPB9tlOxdMAdFCaIlj69RsJL X-Received: by 2002:a05:6402:27ca:b0:451:7b58:1b01 with SMTP id c10-20020a05640227ca00b004517b581b01mr11592484ede.61.1663084371451; Tue, 13 Sep 2022 08:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663084371; cv=none; d=google.com; s=arc-20160816; b=D5Oyf7g3UgZao0xmn+MEoLvAzK7+yEtUUtgb3ZohUsRd9u8BWUZCaopjEn8M1S4oWt ScHn/Lg0sy4llXEsEEsPl6rxIPrX9ae0oPTaiSw17K9rBayoJAb5ddPvq7FaJF+KtFXn gVCBM1IWNYKCM7eSK6xuKi9+OmhLnmHgFot0+p8JFseVPImLdaGRfcl7kr9V8/6nD4Fa ufvrRmDodjIhmkbsBzqBRjTobuF2uwHnLudTzAxklywokZRMKt2BMnZ40Re9FmC3n+X/ PCqsYjFlyA//MDGUiPCYloKgWsGp/5xTlOdDt8p2f8pKDME0bKJSgQ08sMwQgEboffND oLHw== 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=OcclY42E5DaQvmThgywvdzBIDEyucHh5BYon1t+Vh2U=; b=DapZ/qsFpstEy/OLyKGoeGhV+W7pa7HtJZ4dqFdHa5wC9PYUqyNR9fO2vjGFgHaXn0 sBFZPd958s2Yx0eR6WtZThkLl6imseU5ofC6ZxEZwxe9zNL8DuQ3EQXl/lcEQmv8iXNf wQ+NrRVn6Qfar05aMvnZgcwxmNAlFYIGfwlQGitDO69RXn8di6wLbuuSvCB38ESAmJcb q124PghnHUwp5hj6oVOvU3ibI+DOTJNZ26ccEWi78AnT5s3Ph3Bgp/AvMN9JqY+5zfmz f2wlQfw9b1JrjnjOFuyBOEk2f//jyJv1FrJUo/xet4b92afxAVxU5+1G5Psc4e7KtDaX iK8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UCDqudbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a170906040200b00732fd99cdb5si7249225eja.854.2022.09.13.08.52.25; Tue, 13 Sep 2022 08:52:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UCDqudbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S236343AbiIMP1q (ORCPT + 99 others); Tue, 13 Sep 2022 11:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236311AbiIMP0D (ORCPT ); Tue, 13 Sep 2022 11:26:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8CEE7DF4B; Tue, 13 Sep 2022 07:38:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8631CB80FE3; Tue, 13 Sep 2022 14:34:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEFADC433C1; Tue, 13 Sep 2022 14:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663079673; bh=JYuxi9O3FdJnifusqhvtJkC+4XphOyrht8mntGp0LCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UCDqudbAM2Fxy9sT82X0MEDvtjf6rWOCqV0RO8AKYkNLM4BXKVhNfthbahBNlvkHw rzLrYFBaj92m/Plj78l12/OgndJpwXuMPAr84r4BEZl25VgxG+2YNmnhmjBVkDNKa9 klBTzWqENSOVTfoqfJ7z4mRbK6EId+yBLq9t5YII= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , Stefan Schmidt Subject: [PATCH 4.14 31/61] net: mac802154: Fix a condition in the receive path Date: Tue, 13 Sep 2022 16:07:33 +0200 Message-Id: <20220913140348.048092061@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140346.422813036@linuxfoundation.org> References: <20220913140346.422813036@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miquel Raynal commit f0da47118c7e93cdbbc6fb403dd729a5f2c90ee3 upstream. Upon reception, a packet must be categorized, either it's destination is the host, or it is another host. A packet with no destination addressing fields may be valid in two situations: - the packet has no source field: only ACKs are built like that, we consider the host as the destination. - the packet has a valid source field: it is directed to the PAN coordinator, as for know we don't have this information we consider we are not the PAN coordinator. There was likely a copy/paste error made during a previous cleanup because the if clause is now containing exactly the same condition as in the switch case, which can never be true. In the past the destination address was used in the switch and the source address was used in the if, which matches what the spec says. Cc: stable@vger.kernel.org Fixes: ae531b9475f6 ("ieee802154: use ieee802154_addr instead of *_sa variants") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220826142954.254853-1-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt Signed-off-by: Greg Kroah-Hartman --- net/mac802154/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/mac802154/rx.c +++ b/net/mac802154/rx.c @@ -52,7 +52,7 @@ ieee802154_subif_frame(struct ieee802154 switch (mac_cb(skb)->dest.mode) { case IEEE802154_ADDR_NONE: - if (mac_cb(skb)->dest.mode != IEEE802154_ADDR_NONE) + if (hdr->source.mode != IEEE802154_ADDR_NONE) /* FIXME: check if we are PAN coordinator */ skb->pkt_type = PACKET_OTHERHOST; else