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: <20250321-xarray-fix-destroy-v1-1-7154bed93e84@gmail.com>
Date: Fri, 21 Mar 2025 22:17:08 -0400
From: Tamir Duberstein <tamird@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>, 
 Matthew Wilcox <willy@...radead.org>, 
 Stephen Rothwell <sfr@...b.auug.org.au>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org, 
 linux-mm@...ck.org, Tamir Duberstein <tamird@...il.com>
Subject: [PATCH] XArray: revert (unintentional?) behavior change

Partially revert commit 6684aba0780d ("XArray: Add extra debugging check
to xas_lock and friends"), fixing test failures in check_xa_alloc.

Fixes: 6684aba0780d ("XArray: Add extra debugging check to xas_lock and friends")
Signed-off-by: Tamir Duberstein <tamird@...il.com>
---
Before this change:

  BUG at xa_alloc_index:57
  CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.14.0-rc7-next-20250321-00001-gf45bb5d4b2e8 #854 NONE
  Hardware name: linux,dummy-virt (DT)
  Call trace:
   show_stack+0x18/0x24 (C)
   dump_stack_lvl+0x40/0x84
   dump_stack+0x18/0x24
   xa_alloc_index+0x118/0x15c
   check_xa_alloc_1+0x114/0x6e8
   check_xa_alloc+0x24/0x78
   xarray_checks+0x58/0xd4
   do_one_initcall+0x74/0x168
   do_initcall_level+0x8c/0xac
   do_initcalls+0x54/0x94
   do_basic_setup+0x18/0x24
   kernel_init_freeable+0xb8/0x120
   kernel_init+0x20/0x198
   ret_from_fork+0x10/0x20
  BUG at xa_alloc_index:57
  CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.14.0-rc7-next-20250321-00001-gf45bb5d4b2e8 #854 NONE
  Hardware name: linux,dummy-virt (DT)
  Call trace:
   show_stack+0x18/0x24 (C)
   dump_stack_lvl+0x40/0x84
   dump_stack+0x18/0x24
   xa_alloc_index+0x118/0x15c
   check_xa_alloc_1+0x120/0x6e8
   check_xa_alloc+0x24/0x78
   xarray_checks+0x58/0xd4
   do_one_initcall+0x74/0x168
   do_initcall_level+0x8c/0xac
   do_initcalls+0x54/0x94
   do_basic_setup+0x18/0x24
   kernel_init_freeable+0xb8/0x120
   kernel_init+0x20/0x198
   ret_from_fork+0x10/0x20
  BUG at xa_erase_index:62
  CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.14.0-rc7-next-20250321-00001-gf45bb5d4b2e8 #854 NONE
  Hardware name: linux,dummy-virt (DT)
  Call trace:
   show_stack+0x18/0x24 (C)
   dump_stack_lvl+0x40/0x84
   dump_stack+0x18/0x24
   xa_erase_index+0xb0/0xd8
   check_xa_alloc_1+0x12c/0x6e8
   check_xa_alloc+0x24/0x78
   xarray_checks+0x58/0xd4
   do_one_initcall+0x74/0x168
   do_initcall_level+0x8c/0xac
   do_initcalls+0x54/0x94
   do_basic_setup+0x18/0x24
   kernel_init_freeable+0xb8/0x120
   kernel_init+0x20/0x198
   ret_from_fork+0x10/0x20
  BUG at xa_erase_index:62
  CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.14.0-rc7-next-20250321-00001-gf45bb5d4b2e8 #854 NONE
  Hardware name: linux,dummy-virt (DT)
  Call trace:
   show_stack+0x18/0x24 (C)
   dump_stack_lvl+0x40/0x84
   dump_stack+0x18/0x24
   xa_erase_index+0xb0/0xd8
   check_xa_alloc_1+0x160/0x6e8
   check_xa_alloc+0x24/0x78
   xarray_checks+0x58/0xd4
   do_one_initcall+0x74/0x168
   do_initcall_level+0x8c/0xac
   do_initcalls+0x54/0x94
   do_basic_setup+0x18/0x24
   kernel_init_freeable+0xb8/0x120
   kernel_init+0x20/0x198
   ret_from_fork+0x10/0x20
  XArray: 6782365 of 6782369 tests passed
---
 lib/xarray.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/xarray.c b/lib/xarray.c
index 261814d170d8..638c4c90e5b2 100644
--- a/lib/xarray.c
+++ b/lib/xarray.c
@@ -2380,6 +2380,7 @@ void xa_destroy(struct xarray *xa)
 	unsigned long flags;
 	void *entry;
 
+	xas.xa_node = NULL;
 	xas_lock_irqsave(&xas, flags);
 	entry = xa_head_locked(xa);
 	RCU_INIT_POINTER(xa->xa_head, NULL);

---
base-commit: 9388ec571cb1adba59d1cded2300eeb11827679c
change-id: 20250321-xarray-fix-destroy-274090a7a18b

Best regards,
-- 
Tamir Duberstein <tamird@...il.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ