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: <Z6ydDD5uMMgLi2RO@J2N7QTR9R3>
Date: Wed, 12 Feb 2025 13:07:24 +0000
From: Mark Rutland <mark.rutland@....com>
To: "Luis Claudio R. Goncalves" <lgoncalv@...hat.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-rt-devel@...ts.linux.dev,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ryan Roberts <ryan.roberts@....com>,
	Mark Brown <broonie@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
	Joey Gouly <joey.gouly@....com>, linux-kernel@...r.kernel.org
Subject: Re: BUG: debug_exception_enter() disables preemption and may call
 sleeping functions on aarch64 with RT

On Wed, Feb 12, 2025 at 12:40:33PM +0000, Mark Rutland wrote:

> * In entry-common.c, add new el{1,0}_step() functions. Each of
>   el1h_64_sync_handler(), el0t_64_sync_handler(), and
>   el0t_32_sync_handler() should be updated to call those rather than
>   el{1,0}_dbg() for the corresponding EC values.
> 
>   In el0_step() it shouldn't be necessary to disable preemption, and
>   that should be able to be:
> 
>   | static void noinstr el0_step(struct pt_regs *regs, unsigned long esr)
>   | {
>   |         enter_from_user_mode(regs);
>   |         local_daif_restore(DAIF_PROCCTX);
>   |         do_el0_step(regs, esr);
>   |         exit_to_user_mode(regs);
>   | }
> 
>   In el1_step(), I'm not *immediately sure* whether it's necessary to
>   disable preemption, nor whether we need to treat this and use
>   arm64_enter_el1_dbg() and arm64_exit_el1_dbg() rather than
>   entry_from_kenrel_mode() and exit_to_kernel_mode().

>From another look, some care will need to be taken around
reinstall_suspended_bps(), which will also need to be reworked. That
definitely needs preemption disabled when poking the HW breakpoints, and
today those can't change under our feet between entry and handling, so
we'll need to think very hard about how that needs to work.

Note that care needs to be taken with *any* approach that doesn't
disable preemption.

Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ