Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1164399lqb; Thu, 18 Apr 2024 01:53:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqtxpA+42X/v/PPmbT156IvCeaCk8RmOkieFISvW/KHMEByoPaaR7fHFAn/1EDzyw0Aj5ReEbI/C6BL+grNopXRmQWgXozjNU3paKGhw== X-Google-Smtp-Source: AGHT+IG2wXRqedzqkrIEbxZOBadi2tKHDSLV3UatAc0L2H4CMYO8hduiW/sggzukBO9qPIdXArd7 X-Received: by 2002:ac8:5ac2:0:b0:434:fef3:8ee2 with SMTP id d2-20020ac85ac2000000b00434fef38ee2mr2599288qtd.68.1713430400115; Thu, 18 Apr 2024 01:53:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713430400; cv=pass; d=google.com; s=arc-20160816; b=UTl/c6Bxd6ZU/U+IrEsxV8nE4xPy6KIuUDbesR7WwQXw7TFUzxvXnS9U1DzUl4jpcW uL232UAHkcnd36OqL7aPzUZkgOjfFwr0POE9gGvii3E85I7HsNRHZ0DoBi/JAGrXa9fk oyHmF0nEEgzfRnFjNH3joErfJAx2tM9MWJtAn/m0GnAR9bg7DBJxGk23aZ1h5HuR9Yie tN05w9t+7XMl2jEjyxggUI9a+v6fxf0xnpJRC4n7fdW3ZQr9KKrKnfLkSZ3YQKm+MSTI TGyZvUTMOkl1lhjRbVMP3rINJYCTSkx62Lp1dZBuxEx1OlPH9h3H4qFqcSO8gTkjQVF8 f2TA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kFcmn48v4nLQKI+zj5YVOA1rasu4U5g2/A5yyErjaDw=; fh=+S5FV3gCEy5qtcAJp3YWEfrDFIJhd+q8QUtwgu0fTU4=; b=jm9kaXcZVkLCChc6T91GlfWTZj53kF0ROQqgRGsz8gqU3mHoG/X/5l7aXSed3q/QOA ebOyh7pwoBzUIRCZnu2s3iVsbQKCw19Kb4tpPsCBYB6T38xfnBmEIWTZaWx2y7tHgml3 9mC2lHNN4IT4ZHgGbRNr1CVZ1r4kS+HLydUgFE2OdMr+d48Noi+TZMumMbTzkNL5fCOk FVBjSePlAynAQB2aULdsHofWLKwS3ZplwZ2pUSeR1Jd1iFQwqT/jYbRKEM5uVYNpWhks 3d3vAksf25EBy2NzkBmHPQb1Z95+gvESGtrE9t3xbhtT8XliejO1UZUOesJg7MuKrLzM ws9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="Kf/fw8kZ"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 18-20020ac85952000000b00434996df207si953792qtz.402.2024.04.18.01.53.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 01:53:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="Kf/fw8kZ"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D1D981C20CBA for ; Thu, 18 Apr 2024 08:53:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB8D815B0FD; Thu, 18 Apr 2024 08:52:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="Kf/fw8kZ" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F22E15AD91 for ; Thu, 18 Apr 2024 08:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713430358; cv=none; b=G8VyNCH6I5jubSt88+hdSbGeOa5DcGJuDNxXwlqj6FRC9C97F94r9oUhUyrUPUkZfcO9aPQgAwA+/ARuSyroqXUOdFzFMFZquhfPr/bti+3gt0+JOzs6yKq6TYmQYeMDWLWfJnJi/PRXYJ/JePGCWZlkiOptB8fY+ZI72qYUXBA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713430358; c=relaxed/simple; bh=r4OOmK+HKCtlholLfoyxeLt/X195g3BwwO4SDytNI3M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oB16EuGTRNy1KjD1pSSAmVfU/b6vdxV8AdgcKCrKbOQmQmHrOGtShF2bt/K0H8EFyV1Kes/odqltuq4zC3VYi/7FYnD1ppwYq6Bej7YGdyYVWUYUXqn1kaCY+nVmCrrCwsF1SEKm7Ap9dHwLf3zVug00oaq159Yo4o/6ZMEd0jo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=Kf/fw8kZ; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=kFcmn48v4nLQKI+zj5YVOA1rasu4U5g2/A5yyErjaDw=; t=1713430357; x=1714639957; b=Kf/fw8kZJFzkAwMzp1p2vErioOmzifT/fopgXzkETiLTE54 6yRn7SEcbBRyJ2B08lpUrxCCMt9yq28jnwR0KNcBEn6nC29Bs7s83iyB5sdg3Osh0SW3m39KHmp8C 0jm0REuVdP8DPUAgH/VTW/1cYvjkkdWFxs5WvYvmAiafLsS3NGFXP/WrA4srrp0pT8ySWRZXLsHCj aOOAlaQ+oygNnwXsHXITo1XwQCoqWmU0XZgfLw6F5HsSEkzIIlIoW+V3tRxIftfAb32oOBIAoVAHR HrEUzn8Gzqti/PgZyTlBez4XUzHV/kIC629TirS3XXHED93emC0v/YJIvwSFDdTw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rxNVN-0000000CIvO-0Gsz; Thu, 18 Apr 2024 10:52:29 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Ilan Peer , Miriam Rachel Korenblit Subject: [PATCH wireless 8/8] wifi: mac80211: fix unaligned le16 access Date: Thu, 18 Apr 2024 10:52:26 +0200 Message-ID: <20240418105220.356788ba0045.I2b3cdb3644e205d5bb10322c345c0499171cf5d2@changeid> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240418105220.90df97557702.I05d2228ce85c203b9f2d6da8538cc16dce46752a@changeid> References: <20240418105220.90df97557702.I05d2228ce85c203b9f2d6da8538cc16dce46752a@changeid> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg The AP removal timer field need not be aligned, so the code shouldn't access it directly, but use unaligned loads. Use get_unaligned_le16(), which even is shorter than the current code since it doesn't need a cast. Fixes: 8eb8dd2ffbbb ("wifi: mac80211: Support link removal using Reconfiguration ML element") Reviewed-by: Ilan Peer Reviewed-by: Miriam Rachel Korenblit Signed-off-by: Johannes Berg --- net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6f0880ec89da..3bbb216a0fc8 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -5819,7 +5819,7 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata, */ if (control & IEEE80211_MLE_STA_RECONF_CONTROL_AP_REM_TIMER_PRESENT) - link_removal_timeout[link_id] = le16_to_cpu(*(__le16 *)pos); + link_removal_timeout[link_id] = get_unaligned_le16(pos); } removed_links &= sdata->vif.valid_links; -- 2.44.0