Hi Lance,
On Tue, 2 Sept 2025 at 15:31, Lance Yang lance.yang@linux.dev wrote:
On 2025/9/1 16:45, Geert Uytterhoeven wrote:
On Thu, 28 Aug 2025 at 04:05, Lance Yang lance.yang@linux.dev wrote:
This proves the problem can happen in practice (e.g., with packed structs), so we need to ignore the unaligned pointers on the architectures that don't trap for now.
Putting locks inside a packed struct is definitely a Very Bad Idea and a No Go. Packed structs are meant to describe memory data and
Right. That's definitely not how packed structs should be used ;)
MMIO register layouts, and must not contain control data for critical sections.
Unfortunately, this patten was found in an in-tree driver, as reported[1] by kernel test robot, and there might be other undiscovered instances ...
[1] https://lore.kernel.org/oe-kbuild-all/202508240539.ARmC1Umu-lkp@intel.com
That one is completely bogus, and should be removed. Currently it would crash on any platform that does not support unaligned accesses.
Gr{oetje,eeting}s,
Geert