Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4484285rwb; Tue, 6 Sep 2022 08:09:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR61vG9lZlPO5ThPdOV5KTpcQjme+Q6wrThmGmFQnj2GO1P7UjuTxndVkogNrFyIrgftaCAy X-Received: by 2002:a62:e91a:0:b0:537:e307:fab0 with SMTP id j26-20020a62e91a000000b00537e307fab0mr51484607pfh.37.1662476956950; Tue, 06 Sep 2022 08:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662476956; cv=none; d=google.com; s=arc-20160816; b=ZBDsoTyf0WlKz4EDlJXle0TTcWbpxEqn5qzjVXMZwTp5I8FmLbb0Le3+SFfMM59DIW VIBrxp51PS5bTt9w9in4276mOZsntlk6oHcHSbszt1sQcNB+ajisTZwyN9SgLkIU1KhO RtbYFIjm35Z0kPf5cgKc0C3hlR2FjA8DQnswbPwm2Wk9xoXUDGt5sd3RuF5T3rXIZpBm 3FUEPX3HcsHY5RsrsC5ERErkxnn6PNrJzAo/QQYahNUiFN3xKWBzlzaDONY79UCPpxXe 1siKh1hF0Qe1eBYLwVLRrow78l5sDvK7lDOEM+vIHxETV9ypXjix2MfJawV4F4B76Nmn BVdg== 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=ltJAaBo/AiTuDLaSvDmAA96/H1sje5HUIIQjU/BpeJ8=; b=aIjrTH2x//CmCGMV7spT0O0yZkYlN3uOrMdRrTZPjX2rsqs8WYttgNaYh6bH5rt1gI jJyQsPp5UxMRE3TeNgnTBNuX5oeE0GmWvpkUEuUWCPV16VndJwJv3CcCoRxsqQfsVDPl WFICvLOX/ZodpHv+8YbLciJMUXKOdv7FPHjClJxD4J1Lp8EWHJRVOSrVcaNQYEQe22e+ RlMVhC5GQhPTlYHtha51/YdS2C7XNx+I6zckXtIrzX1pTllhqSD62DC6630m/m2gMRW/ 35y5KZw/QO46e236Flc2owO9aaOzbzV7IzEYO1SDKPjY0cSnX0FXb7NHoihpdvg0HcNi rT6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EpQtuofX; 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 e2-20020a17090301c200b00176e16b0c58si160124plh.21.2022.09.06.08.09.05; Tue, 06 Sep 2022 08:09:16 -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=EpQtuofX; 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 S241512AbiIFOOu (ORCPT + 99 others); Tue, 6 Sep 2022 10:14:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241194AbiIFONK (ORCPT ); Tue, 6 Sep 2022 10:13:10 -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 B3D6B895C5; Tue, 6 Sep 2022 06:48:06 -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 3F05DB818DD; Tue, 6 Sep 2022 13:48:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F4A4C433C1; Tue, 6 Sep 2022 13:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662472085; bh=0g+BrGBAcEGOoFsoTPa/mAv79Cn8p/845NrwDK9nLmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EpQtuofXPDdsYa6UIWE3Ll+3QjOlw7Vet66dsBpVxSWbqXIhRktLsX2aaso5HUkCo uK/AO7yVuG0Hw+/XzE0NOebJG3gRt+tUIq5bjeXgjohMFWVtg3iO6zp+feRlNHm3B2 CoHkqRRtC60JRPr95yuIqp2FnvKvnbrNJNSx8mfU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , Stefan Schmidt Subject: [PATCH 5.19 143/155] net: mac802154: Fix a condition in the receive path Date: Tue, 6 Sep 2022 15:31:31 +0200 Message-Id: <20220906132835.480013066@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132829.417117002@linuxfoundation.org> References: <20220906132829.417117002@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 @@ -44,7 +44,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