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-next>] [day] [month] [year] [list]
Message-ID: <20260125164016.331257-1-qq570070308@gmail.com>
Date: Mon, 26 Jan 2026 00:40:07 +0800
From: Xie Yuanbin <qq570070308@...il.com>
To: linux@...linux.org.uk,
	johannes@...solutions.net,
	masahiroy@...nel.org,
	jgross@...e.com,
	nsc@...nel.org,
	kees@...nel.org,
	tglx@...nel.org,
	mingo@...nel.org,
	frederic@...nel.org,
	paulmck@...nel.org,
	peterz@...radead.org,
	mathieu.desnoyers@...icios.com,
	luto@...nel.org,
	edumazet@...gle.com
Cc: linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	Xie Yuanbin <qq570070308@...il.com>
Subject: [PATCH 0/9] ARM: fix wrong lockdep hardirqs state

Hello, everyone!

For latest linux-next kernel, commit ca3a02fda4da8e2c1cb6 ("Add
linux-next specific files for 20260123"), using default
multi_v7_defconfig, setting CONFIG_PROVE_LOCKING=y,
CONFIG_NO_HZ_FULL=y, and then boot with valid `nohz_full=` cmdline, the
following WARNING will be triggered:
```log
[    4.763050] ------------[ cut here ]------------
[    4.763244] WARNING: kernel/context_tracking.c:450 at __ct_user_enter+0x180/0x184, CPU#0: bash/1
[    4.764815] Modules linked in:
[    4.765386] CPU: 0 UID: 0 PID: 1 Comm: bash Not tainted 6.19.0-rc6-next-20260123 #1 VOLUNTARY
[    4.765761] Hardware name: Generic DT based system
[    4.766105] Call trace:
[    4.766151]  unwind_backtrace from show_stack+0x10/0x14
[    4.766686]  show_stack from dump_stack_lvl+0x68/0x80
[    4.766919]  dump_stack_lvl from __warn+0xf0/0x270
[    4.767140]  __warn from warn_slowpath_fmt+0xc0/0x194
[    4.767542]  warn_slowpath_fmt from __ct_user_enter+0x180/0x184
[    4.767792]  __ct_user_enter from user_enter_callable+0x64/0x6c
[    4.768105]  user_enter_callable from no_work_pending+0x8/0x4c
[    4.768415] Exception stack(0xf0849fb0 to 0xf0849ff8)
[    4.768816] 9fa0:                                     00000000 00000000 00000000 00000000
[    4.769060] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    4.769335] 9fe0: 00000000 beaf2ef0 00000000 b6f10dec 00000010 00000000
[    4.769669] irq event stamp: 211021
[    4.770932] hardirqs last  enabled at (211021): [<c0300114>] no_work_pending+0x4/0x4c
[    4.771687] hardirqs last disabled at (211020): [<c032a064>] do_work_pending+0x48/0xa4
[    4.772290] softirqs last  enabled at (210994): [<c0371354>] handle_softirqs+0x434/0x4dc
[    4.772902] softirqs last disabled at (210987): [<c0371654>] __irq_exit_rcu+0xd0/0x204
[    4.773359] ---[ end trace 0000000000000000 ]---
```

When fixing this issue, I found that because the kernel entry of arm
hadn't kept pace with other architectures for a long time, there were
other issues at returning to user, such as missing statistics
of rseq exit: When CONFIG_RSEQ_STATS=y, the exit entry of
debugfs/rseq/status is always 0.

I think the best adaptation method is to call
syscall_enter_from_user_mode(), syscall_exit_to_user_mode(),
irqentry_enter_from_user_mode(), and irqentry_exit_to_user_mode()
directly. However, this requires too many modifications to the existing
code.

Therefore, I chose a compromise solution:
This series refers to the implementation of the four functions mentioned
above and undergoes minor refactoring.

Xie Yuanbin (9):
  ARM: assembler: add save argument to enable_irq macro
  ARM: entry: remove macros ct_user_enter() and ct_user_exit()
  ARM: entry: fix wrong lockdep hardirqs state
  ARM: entry: use exit_to_user_mode() instead of user_enter_callable()
  ARM: entry: fix missing statistics of rseq exit
  ARM: entry: add tick_nohz_user_enter_prepare() if CONFIG_GENERIC_ENTRY
  ARM: entry: call __exit_to_user_mode_validate() when returning to user
  ARM: entry: use enter_from_user_mode() instead of user_exit_callable()
  ARM: entry: remove redundant asm_trace_hardirqs_on()

 arch/arm/include/asm/assembler.h    |  4 +--
 arch/arm/include/asm/entry-common.h | 11 ++++++++
 arch/arm/kernel/Makefile            |  2 +-
 arch/arm/kernel/entry-armv.S        |  5 +---
 arch/arm/kernel/entry-common.S      | 23 +++++------------
 arch/arm/kernel/entry-header.S      | 28 --------------------
 arch/arm/kernel/entry.c             | 40 +++++++++++++++++++++++++++++
 arch/arm/kernel/signal.c            |  7 +----
 8 files changed, 63 insertions(+), 57 deletions(-)
 create mode 100644 arch/arm/include/asm/entry-common.h
 create mode 100644 arch/arm/kernel/entry.c

-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ