]> 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)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 21 Feb 2025 01:50:44 +0000 (09:50 +0800)
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
drivers/net/wireless/realtek/rtw89/fw.c

index e4231dd620e6ea5b07ef4410335f86e914b3bb6e..0a129476171a1aa6cc9d6d78f5b3349ced382277 100644 (file)
@@ -324,7 +324,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;