public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] riscv: Assorted bug fixes
@ 2026-04-09  9:11 Michael Neuling
  2026-04-09  9:11 ` [PATCH 1/5] riscv: errata: Fix bitwise vs logical AND in MIPS errata patching Michael Neuling
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Michael Neuling @ 2026-04-09  9:11 UTC (permalink / raw)
  To: Björn Töpel, Mike Rapoport (Microsoft),
	Vishal Moola (Oracle), Albert Ou, Aleksa Paunovic,
	Aleksandar Rikalo, Alexandre Ghiti, Andrew Jones, Andrew Morton,
	Arnd Bergmann, David Hildenbrand, Djordje Todorovic, Guo Ren,
	Junhui Liu, Kevin Brodsky, Lorenzo Stoakes, Nam Cao,
	Oleg Nesterov, Oscar Salvador, Palmer Dabbelt, Paul Walmsley,
	Qinglin Pan, Raj Vishwanathan4, linux-kernel, linux-riscv
  Cc: Michael Neuling

This series contains five independent bug fixes across the RISC-V
architecture code, found with the help of Claude AI (claude-4.6-opus):

  1. riscv: errata: Fix bitwise vs logical AND in MIPS errata patching
     - Logical AND (&&) was used instead of bitwise AND (&) when checking
       errata flags, causing all errata patches to be applied when any
       single one was detected.

  2. riscv: ptrace: Fix register corruption in compat_riscv_gpr_set on error
     - On copyin failure, uninitialized stack data was written into the
       target task's pt_regs, corrupting registers and potentially
       leaking kernel stack contents.

  3. riscv: mm: Fix NULL pointer dereference in __set_memory
     - find_vm_area() can return NULL but was dereferenced without a check.

  4. riscv: mm: Fix NULL dereferences in napot hugetlb functions
     - huge_pte_offset() can return NULL in the napot path but was used
       without NULL checks in huge_ptep_set_access_flags() and
       huge_ptep_set_wrprotect().

  5. riscv: mm: Fix TOCTOU race in remove_pte_mapping
     - The PTE was read twice (once via ptep_get, once via *ptep),
       creating a race window where another CPU could modify the PTE
       between reads.

All patches are small and self-contained. These bugs were identified
through AI-assisted code review using Claude, which also assisted in
writing the fixes. Each patch has been manually reviewed for correctness.

Michael Neuling (5):
  riscv: errata: Fix bitwise vs logical AND in MIPS errata patching
  riscv: ptrace: Fix register corruption in compat_riscv_gpr_set on
    error
  riscv: mm: Fix NULL pointer dereference in __set_memory
  riscv: mm: Fix NULL dereferences in napot hugetlb functions
  riscv: mm: Fix TOCTOU race in remove_pte_mapping

 arch/riscv/errata/mips/errata.c | 2 +-
 arch/riscv/kernel/ptrace.c      | 4 ++--
 arch/riscv/mm/hugetlbpage.c     | 4 ++++
 arch/riscv/mm/init.c            | 2 +-
 arch/riscv/mm/pageattr.c        | 4 ++++
 5 files changed, 12 insertions(+), 4 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-04-10  8:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09  9:11 [PATCH 0/5] riscv: Assorted bug fixes Michael Neuling
2026-04-09  9:11 ` [PATCH 1/5] riscv: errata: Fix bitwise vs logical AND in MIPS errata patching Michael Neuling
2026-04-09  9:11 ` [PATCH 2/5] riscv: ptrace: Fix register corruption in compat_riscv_gpr_set on error Michael Neuling
2026-04-09  9:11 ` [PATCH 3/5] riscv: mm: Fix NULL pointer dereference in __set_memory Michael Neuling
2026-04-09 12:37   ` David Hildenbrand (Arm)
2026-04-10  6:23     ` Michael Neuling
2026-04-10  7:42       ` David Hildenbrand (Arm)
2026-04-10  7:53         ` Mike Rapoport
2026-04-10  7:59           ` David Hildenbrand (Arm)
2026-04-10  8:55             ` Michael Neuling
2026-04-09  9:11 ` [PATCH 4/5] riscv: mm: Fix NULL dereferences in napot hugetlb functions Michael Neuling
2026-04-09 12:36   ` David Hildenbrand (Arm)
2026-04-09  9:11 ` [PATCH 5/5] riscv: mm: Fix TOCTOU race in remove_pte_mapping Michael Neuling
2026-04-09 12:32   ` David Hildenbrand (Arm)

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