Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3789636pxb; Mon, 4 Oct 2021 09:37:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAGYCZFwI0Xbmp5qHvCKG1fwAugBpW1gIfetdMrp1Fv8RWgf6KvKo6BPOQWX2pIcdj6Os7 X-Received: by 2002:a62:51c6:0:b0:43d:e849:c69d with SMTP id f189-20020a6251c6000000b0043de849c69dmr25744856pfb.31.1633365479675; Mon, 04 Oct 2021 09:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633365479; cv=none; d=google.com; s=arc-20160816; b=m2HZAGqTFNRBt/0sXk4HOp7VPilGNhtL+jDvxEdSz5f81qxn9CmTQJKIISmRUh9GWR 5jklaPVwzLLhOeYW/uwnixBjrQN48HWrLxRr3NZUf6WkmCOOAcQXdcKbeJcxqsTN1qIK 3T9vUcJMt0MEDNzDKhl0wXE8pYraEPzEYC4BR4PWrFcZ1K/yqi6Gv+wiIj/7q1MgDXnD TnmWPOgJgI0jmCNC9e7CE7mFZ22mUb+7lkbHLUYimoD27ZwkveDM0OtKXM9g4e8nufnW DqUC+JHYfNHiP6+PzGbG0Z8EC/qYV11RL9ae8qKsJyWXE5ijaaEyI6fxlLjeZjDz19qI PWYw== 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=6ZAuPsEZeTbH57qhJz32lXMNCAxYCTtqnokakpeKHXA=; b=whLIDTCV8TgCiOsOrtEXE5qT98ou+l+j9vuZLkFSo4iY9xhiot0/lZ445MfkuUCjrZ zr72Atq/NMBSRY8BmOAAH69P43k78MUksbJcbXNAOaJR3GTlxgO7HN/WALenc4Efjk6F ywmSPleLI66z4q9G50599wl1cQ0RZTs47YtE+et24+FaTk/o31Pk4WOcrXmzbfPaGAEL Wk+yd9TWa+3iiPE8aUpMV7s/Nsdyb+xAXmcqWYYvFJF3r7sKwv5H5LvahwNIVfJ9Sy5/ /8QiJ/5EOHX+/3hRwD/Kjvfx/wpAFaan0HtmpHczeYdslKGeprAf8+ucnaSEUmxOpqHh +ZRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l4EIbf7t; 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 129si17505980pfu.240.2021.10.04.09.37.46; Mon, 04 Oct 2021 09:37:59 -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=l4EIbf7t; 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 S234389AbhJDNhA (ORCPT + 99 others); Mon, 4 Oct 2021 09:37:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:47266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237184AbhJDNfN (ORCPT ); Mon, 4 Oct 2021 09:35:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8F10061A4F; Mon, 4 Oct 2021 13:15:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353346; bh=9TCFDX076KFMFP+Ixj5jt/z7WDpdxK/tcIF1mWSIeR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4EIbf7txX5CaCsPgbIOdbgz23NyZKX8+IzjSDKfIlzU9mHn18t5lOwueFzGj+xhL x5EJZbRKUZb4YZPZVwwfCu5MrpMwsn4/5YFeT62mWKDnQpd5xwCe30y8tfInp5I5eP 0kkb0POthwvq6ghf6c5vw2wftNEKUpGYAduNk9i0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Sasha Levin Subject: [PATCH 5.14 091/172] mac80211: mesh: fix potentially unaligned access Date: Mon, 4 Oct 2021 14:52:21 +0200 Message-Id: <20211004125047.933592327@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@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: Johannes Berg [ Upstream commit b9731062ce8afd35cf723bf3a8ad55d208f915a5 ] The pointer here points directly into the frame, so the access is potentially unaligned. Use get_unaligned_le16 to avoid that. Fixes: 3f52b7e328c5 ("mac80211: mesh power save basics") Link: https://lore.kernel.org/r/20210920154009.3110ff75be0c.Ib6a2ff9e9cc9bc6fca50fce631ec1ce725cc926b@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mesh_ps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/mesh_ps.c b/net/mac80211/mesh_ps.c index 204830a55240..3fbd0b9ff913 100644 --- a/net/mac80211/mesh_ps.c +++ b/net/mac80211/mesh_ps.c @@ -2,6 +2,7 @@ /* * Copyright 2012-2013, Marco Porsch * Copyright 2012-2013, cozybit Inc. + * Copyright (C) 2021 Intel Corporation */ #include "mesh.h" @@ -588,7 +589,7 @@ void ieee80211_mps_frame_release(struct sta_info *sta, /* only transmit to PS STA with announced, non-zero awake window */ if (test_sta_flag(sta, WLAN_STA_PS_STA) && - (!elems->awake_window || !le16_to_cpu(*elems->awake_window))) + (!elems->awake_window || !get_unaligned_le16(elems->awake_window))) return; if (!test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) -- 2.33.0