lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABCJKud9RCJzVZ2VuTRoaBavOC9bnyTv_W_-AC3mGOy9AY7dWA@mail.gmail.com>
Date: Tue, 14 Jan 2025 22:37:16 +0000
From: Sami Tolvanen <samitolvanen@...gle.com>
To: Mikulas Patocka <mpatocka@...hat.com>
Cc: Luis Chamberlain <mcgrof@...nel.org>, Petr Pavlu <petr.pavlu@...e.com>, 
	Daniel Gomez <da.gomez@...sung.com>, 
	"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>, Helge Deller <deller@....de>, 
	linux-modules@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-parisc@...r.kernel.org
Subject: Re: Unaligned accesses when loading modules

Hi Mikulas,

On Tue, Jan 14, 2025 at 6:07 PM Mikulas Patocka <mpatocka@...hat.com> wrote:
>
> Hi
>
> On PA-RISC, with the kernel 6.12.9, I get unaligned pointer warnings when
> a module is loaded. The warnings are caused by the fact that the
> .gnu.linkonce.this_module section is not aligned to the appropriate
> boundary. If I dump the module content with "objdump -h configs.ko", I get
> this. Note that the .gnu.linkonce.this_module has "File off 000042d2" and
> "Algn 2**4".
>
> On x86-64, the same misalignment can be seen, but it doesn't cause
> warnings because unaligned pointers are handled in hardware.
>
> This seems to be a bug in the linker, because when I compile an old kernel
> with a new linker, I also get the misalignment. Do you have an idea how to
> work around this bug?

Does explicitly specifying section alignment in the module linker
script fix this by any chance?

> kernel-6.12.9, binutils from Debian ports:
> [...]
> kernel 6.10, older binutils:

Which exact versions of binutils were used here? I don't see the
alignment issue with binutils 2.42 on either x86_64 or parisc64, so I
assume you're testing with something newer?

$ hppa64-linux-gnu-ld.bfd --version
GNU ld (GNU Binutils for Debian) 2.42.50.20240625

$ hppa64-linux-gnu-objdump -h configs.ko | grep -E '(format|this_module)'
configs.ko:     file format elf64-hppa-linux
 17 .gnu.linkonce.this_module 00000300  0000000000000000
0000000000000000  00005c50  2**4

Sami

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ