linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/4] Enable strict percpu address space checks
@ 2024-08-12 11:57 Uros Bizjak
  2024-08-12 11:57 ` [RFC PATCH v2 1/4] percpu: Define pcpu_typeof() Uros Bizjak
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Uros Bizjak @ 2024-08-12 11:57 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: Uros Bizjak, Dennis Zhou, Tejun Heo, Christoph Lameter,
	Andy Lutomirski, Ingo Molnar, Nadav Amit, Brian Gerst,
	Denys Vlasenko, H. Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Thomas Gleixner, Borislav Petkov, Luc Van Oostenryck

This patchset enables strict percpu address space checks via x86 named 
address space qualifiers. Percpu variables are declared in
__seg_gs/__seg_fs named AS and kept named AS qualified until they
are dereferenced via percpu accessor. This approach enables various
compiler checks for cross-namespace variable assignments.

Please note that sparse doesn't know anything about __typeof_unqual__()
operator, so the usage of __typeof_unqual__() breaks sparse checking.

Cc: Dennis Zhou <dennis@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

Uros Bizjak (4):
  percpu: Define pcpu_typeof()
  percpu: Assorted fixes found by strict percpu address space checks
  percpu: Repurpose __percpu tag as a named address space qualifier
  percpu/x86: Enable strict percpu checks via named AS qualifiers

 arch/x86/include/asm/percpu.h  | 53 ++++++++++++++++++++++++----------
 arch/x86/kernel/head64.c       |  3 +-
 drivers/base/devres.c          |  2 +-
 fs/aio.c                       |  2 +-
 include/asm-generic/percpu.h   | 41 +++++++++++++++++---------
 include/linux/cleanup.h        |  4 +--
 include/linux/compiler_types.h |  2 +-
 include/linux/part_stat.h      |  2 +-
 include/linux/percpu-defs.h    | 39 ++++++++++++++++++++-----
 include/linux/prandom.h        |  1 +
 init/Kconfig                   |  3 ++
 kernel/events/hw_breakpoint.c  |  4 +--
 kernel/locking/percpu-rwsem.c  |  2 +-
 kernel/workqueue.c             |  2 +-
 lib/percpu_counter.c           |  2 +-
 net/core/dev.c                 |  2 +-
 16 files changed, 115 insertions(+), 49 deletions(-)

-- 
2.46.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-08-12 20:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-12 11:57 [RFC PATCH v2 0/4] Enable strict percpu address space checks Uros Bizjak
2024-08-12 11:57 ` [RFC PATCH v2 1/4] percpu: Define pcpu_typeof() Uros Bizjak
2024-08-12 11:57 ` [RFC PATCH v2 2/4] percpu: Assorted fixes found by strict percpu address space checks Uros Bizjak
2024-08-12 19:09   ` Nadav Amit
2024-08-12 20:36     ` Uros Bizjak
2024-08-12 11:57 ` [RFC PATCH v2 3/4] percpu: Repurpose __percpu tag as a named address space qualifier Uros Bizjak
2024-08-12 19:12   ` Nadav Amit
2024-08-12 20:01     ` Uros Bizjak
2024-08-12 11:57 ` [RFC PATCH v2 4/4] percpu/x86: Enable strict percpu checks via named AS qualifiers Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox