Re: [PATCH 1/2] smb: client: fix off-by-8 bounds check in check_wsl_eas()

ChenXiaoSong
2026-04-09T03:11:45Z

Hi Steve,

Should we use `get_unaligned_le32()` to get unaligned data?

> static inline kuid_t wsl_make_kuid(struct cifs_sb_info *cifs_sb,
> void *ptr)
> {
> u32 uid = le32_to_cpu(*(__le32 *)ptr);
> ...
> }

>
> Additionally, does parsing these extended attributes cause unaligned memory
> accesses?
> When parsing WSL extended attributes, the code derives the value pointer
> at an offset of ea_name_length (which is 6) plus 1 from ea_data. Since
> ea is a 4-byte aligned structure, the value sits at an unaligned offset.
> Helper functions like wsl_make_kuid() explicitly cast this unaligned
> pointer to a 32-bit type and dereference it:
> le32_to_cpu(*(__le32 *)v);
>
> Could this trigger an unaligned access exception and crash the kernel on
> architectures with strict alignment requirements?

--
ChenXiaoSong <chenxiaosong@kylinos.cn>
Chinese Homepage: chenxiaosong.com
English Homepage: chenxiaosong.com/en