From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795995279; b=lhjQ3bY75uSgRMMDwydIx9JolT3ox6KHFkQCoDvvw/4BhyrPvQe5zNcPriV5IyZ2i8AL MQ01L9N7HlgWt0+fsVEdHqLgw2Nrmk8A4PZtdmkZVKMVCRPL51QlHFjjz1EM24JM0GWl8 A3DGfR8T/irJPVNkBMZjxNf7mNdwYCpHLgPlQHs4//mgmS/xbVLQI+qghJpw9FJjaL6/M aMdtqjFRVEj6jPUbffptyEZKcZFEGF4JnYCJ0IEoq8yM/XdBHb/P3FtKGxter/L6PUEbH Zi7aFqlWYLM6UD30O3nCgKHCoObWCWAJQd9lyfzCswt1Ukdat5MYAsK/EKUkd7PVGEw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795995279; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=lJz2PaBAeQe+EvcLed8jvVjAuiaV+2kQUdbWurt6llM=; b=SlLjZT7LikVhGDIOf+O9XxyaEhJd/84B8phv7m0lc737Dvsf9FpRACe4Rhe72/I2nxNz jCxOV+Yhvgx0B6afPG91j3IfG4lxhssw4bqkHNnax2L6x+U7YNnxs50ImFRXHtw7sZWkG A/xnS419+Kg/sFmL0lzcSRDepuISHlAyGk7bt39kvl3xwRZi5usKI+I3RYRDMijUEzKQc 2IXfoqqBaLEqMAXa9AVUYFdQ+nSZO307xiDdp21l/rEjkAJkmxttlrGp3pzqLRtY6U61Z l9gRvh/Yr8Z1m5NTJuOMsZEUHf4X991DWASrrnWm3Ezkx6bqvBPq3J3MZkop6UpheMw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fBHDSTDB; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9D09606A31C; Sun, 29 Nov 2026 23:34:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fBHDSTDB Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14EBD1F00896; Sun, 29 Nov 2026 23:34:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795995279; bh=lJz2PaBAeQe+EvcLed8jvVjAuiaV+2kQUdbWurt6llM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=fBHDSTDB8KNTSiHWO8JcCklbK7cUOE5lVXJmJ9jM5MVnkRWn6g3Qze9e2Q1OmCq+5 jK/unoghHa2M92PyujnEPBosRd+mabKacZ962r2jObIFzH0jprP/At5dbNF7ji3uik d7/BaXTiqscDoDoDrniS6TkMPKBvtwC342kfzvF+tS+NOlOVPb7ms27nrRTPM4x8Cl 1Uq2dk8JRSXTXNWHHbkTKLAiYD8SS04a+8aN4dxUwFN9xaArdMsBc6Fcs/SJamASQg rn0xJn3TAz9LUpyJ7ChUQc1twTATKw9d+Dv4jyK6HR47rfbv2e4ABkOXLrZWSek1Fy 2aU6b4Xb9y9LQ== Date: Sun, 29 Nov 2026 15:34:37 -0800 From: Eric Biggers To: Vasiliy Kovalev Cc: Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Benjamin Marzinski , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH] dm-verity: give each FEC buffer slab cache a unique name Message-ID: <20261129233437.GE2118@sol> References: <20261120185123.614550-1-kovalev@altlinux.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261120185123.614550-1-kovalev@altlinux.org> On Fri, Nov 20, 2026 at 09:51:23PM +0300, Vasiliy Kovalev wrote: > verity_fec_ctr() creates a slab cache for the FEC buffers of every > verity target that uses FEC, always under the name > "dm_verity_fec_buffers". With CONFIG_DEBUG_VM=y, as soon as two such > targets exist at the same time, for example two FEC-enabled devices or > a table reload of one, the second kmem_cache_create() trips the > duplicate name check: > > kmem_cache of name 'dm_verity_fec_buffers' already exists > WARNING: mm/slab_common.c:111 at kmem_cache_sanity_check mm/slab_common.c:111 [inline], CPU#2: syz.1.18/4545 > WARNING: mm/slab_common.c:111 at __kmem_cache_create_args+0xab/0x450 mm/slab_common.c:352, CPU#2: syz.1.18/4545 > Modules linked in: > CPU: 2 UID: 0 PID: 4545 Comm: syz.1.18 Not tainted 7.4.0-rc1-next-20261104-alt-syz-box-drivers_md_bcache #1 PREEMPT(lazy) > RIP: 0010:kmem_cache_sanity_check mm/slab_common.c:111 [inline] > RIP: 0010:__kmem_cache_create_args+0xae/0x450 mm/slab_common.c:352 > Call Trace: > > __kmem_cache_create include/linux/slab.h:402 [inline] > verity_fec_ctr+0x9eb/0x1070 drivers/md/dm-verity-fec.c:709 > verity_ctr+0x1a6a/0x1ed0 drivers/md/dm-verity-target.c:1650 > dm_table_add_target+0x7c2/0xf30 drivers/md/dm-table.c:749 > populate_table drivers/md/dm-ioctl.c:1602 [inline] > table_load+0x38b/0x910 drivers/md/dm-ioctl.c:1645 > ctl_ioctl+0x4d2/0xd70 drivers/md/dm-ioctl.c:2221 > dm_ctl_ioctl+0x1e/0x30 drivers/md/dm-ioctl.c:2243 > vfs_ioctl fs/ioctl.c:51 [inline] > __do_sys_ioctl fs/ioctl.c:597 [inline] > __se_sys_ioctl fs/ioctl.c:583 [inline] > __x64_sys_ioctl+0x18a/0x210 fs/ioctl.c:583 > do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] > do_syscall_64+0x112/0x630 arch/x86/entry/syscall_64.c:89 > entry_SYSCALL_64_after_hwframe+0x77/0x7f > RIP: 0033:0x00007f213c87a829 > > > The buffer size depends on the number of RS roots of each target, so a > single cache can't be created at module init. Append a unique sequence > number to the name, as dm-bufio does. The slab core copies the name, so > a stack buffer is enough. > > Found by Linux Verification Center (linuxtesting.org) with Syzkaller. > > Fixes: 4c39529663b9 ("slab: Warn on duplicate cache names when DEBUG_VM=y") > Cc: stable@vger.kernel.org > Signed-off-by: Vasiliy Kovalev > --- > With panic_on_warn the warning panics the kernel. > > drivers/md/dm-verity-fec.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Eric Biggers - Eric