From nobody Mon Sep 8 08:51:29 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50243C6FA89 for ; Tue, 13 Sep 2022 15:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235155AbiIMPCz (ORCPT ); Tue, 13 Sep 2022 11:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235058AbiIMPAm (ORCPT ); Tue, 13 Sep 2022 11:00:42 -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 5080263F2E; Tue, 13 Sep 2022 07:29:11 -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 145E2B80FBD; Tue, 13 Sep 2022 14:28:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7170BC433D6; Tue, 13 Sep 2022 14:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663079310; bh=0g+BrGBAcEGOoFsoTPa/mAv79Cn8p/845NrwDK9nLmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FakfxQDMaDXxOpoe+4kdk9j8EjRKjcdsiQfkQfxav+w59P1794tEBrVH/tMI3hqAN EhzmeXT0uUDN0u9ccRdBetTRb9zKThRn1s+iNeVAj0oNsiDc62pdMPscb97Uw5/POq mXw3r/yH4+IPwRkG31cjxjFPT0gciKqCpWSIxYLA= 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.4 058/108] net: mac802154: Fix a condition in the receive path Date: Tue, 13 Sep 2022 16:06:29 +0200 Message-Id: <20220913140356.120003207@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140353.549108748@linuxfoundation.org> References: <20220913140353.549108748@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 varia= nts") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220826142954.254853-1-miquel.raynal@bootl= in.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 =20 switch (mac_cb(skb)->dest.mode) { case IEEE802154_ADDR_NONE: - if (mac_cb(skb)->dest.mode !=3D IEEE802154_ADDR_NONE) + if (hdr->source.mode !=3D IEEE802154_ADDR_NONE) /* FIXME: check if we are PAN coordinator */ skb->pkt_type =3D PACKET_OTHERHOST; else