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: <87y0wrk1o1.fsf@all.your.base.are.belong.to.us>
Date: Wed, 26 Mar 2025 20:54:54 +0100
From: Björn Töpel <bjorn@...nel.org>
To: Yao Zi <ziyao@...root.org>, Paul Walmsley <paul.walmsley@...ive.com>,
 Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
 Alexandre Ghiti <alex@...ti.fr>, Pasha Tatashin
 <pasha.tatashin@...een.com>, Kent Overstreet <kent.overstreet@...ux.dev>,
 Petr Tesarik <petr@...arici.cz>, Ying Sun <sunying@...c.iscas.ac.cn>,
 Samuel Holland <samuel.holland@...ive.com>
Cc: linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org, Han Gao
 <rabenda.cn@...il.com>, Yao Zi <ziyao@...root.org>
Subject: Re: [PATCH] riscv/kexec_file: Handle R_RISCV_64 in purgatory relocator

Björn Töpel <bjorn@...nel.org> writes:

> Yao Zi <ziyao@...root.org> writes:
>
>> Commit 58ff537109ac ("riscv: Omit optimized string routines when
>> using KASAN") introduced calls to EXPORT_SYMBOL() in assembly string
>> routines, which result in R_RISCV_64 relocations against
>> .export_symbol section. As these rountines are reused by RISC-V
>> purgatory and our relocator doesn't recognize these relocations, this
>> fails kexec-file-load with dmesg like
>>
>> 	[   11.344251] kexec_image: Unknown rela relocation: 2
>> 	[   11.345972] kexec_image: Error loading purgatory ret=-8
>>
>> Let's support R_RISCV_64 relocation to fix kexec on 64-bit RISC-V.
>> 32-bit variant isn't covered since KEXEC_FILE and KEXEC_PURGATORY isn't
>> available.
>
> Hi!
>
> This patch does fix the vmlinux loading for kexec-file -- very nice!
> However, I haven't been able to get kexec to successfully boot a kernel
> from qemu, i.e.:
>
>   kexec -s -l /path/to/vmlinux # fixed w/ your patch
>   kexec -e # hangs after "Bye..."
>
> Same when I try vanilla kexec (kexec -c -l /path/to/vmlinux). kexec with
> an Image works for me in qemu.
>
> Before I start to bisect too much; What config/qemu did you use to test
> this?

Nevermind! Got it to work; Sorry for the noise.

Tested-by: Björn Töpel <bjorn@...osinc.com>
Reviewed-by: Björn Töpel <bjorn@...osinc.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ