]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: rtw89: fw: get sb_sel_ver via get_unaligned_le32()
authorPing-Ke Shih <pkshih@realtek.com>
Mon, 17 Feb 2025 06:43:05 +0000 (14:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:13:13 +0000 (11:13 +0200)
[ Upstream commit 2f9da853f4d848d23bade4c22931ea0f5a011674 ]

The sb_sel_ver is selection version for secure boot recorded in firmware
binary data, and its size is 4 and offset is 58 (not natural alignment).
Use get_unaligned_le32() to get this value safely. Find this by reviewing.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250217064308.43559-3-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/realtek/rtw89/fw.c

index 4727eeb55b486b34d0dcc56ee7a978fdda812027..3164ff69803a123b716167af4c6b37df30cbb87a 100644 (file)
@@ -314,7 +314,7 @@ static int __parse_formatted_mssc(struct rtw89_dev *rtwdev,
        if (!sec->secure_boot)
                goto out;
 
-       sb_sel_ver = le32_to_cpu(section_content->sb_sel_ver.v);
+       sb_sel_ver = get_unaligned_le32(&section_content->sb_sel_ver.v);
        if (sb_sel_ver && sb_sel_ver != sec->sb_sel_mgn)
                goto ignore;