From: Guenter Roeck <[email protected]>
To: Geert Uytterhoeven <[email protected]>
Cc: Christoph Lameter <[email protected]>,
Pekka Enberg <[email protected]>,
David Rientjes <[email protected]>,
Joonsoo Kim <[email protected]>,
Andrew Morton <[email protected]>,
Vlastimil Babka <[email protected]>,
Roman Gushchin <[email protected]>,
Hyeonggon Yoo <[email protected]>, Jens Axboe <[email protected]>,
Pavel Begunkov <[email protected]>,
[email protected], [email protected],
Christian Brauner <[email protected]>,
Kees Cook <[email protected]>, Jann Horn <[email protected]>,
[email protected], [email protected],
[email protected], [email protected]
Subject: Re: [PATCH] slab: Fix too strict alignment check in create_cache()
Date: Wed, 20 Nov 2024 07:00:26 -0800 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <80c767a5d5927c099aea5178fbf2c897b459fa90.1732106544.git.geert@linux-m68k.org>
On Wed, Nov 20, 2024 at 01:46:21PM +0100, Geert Uytterhoeven wrote:
> On m68k, where the minimum alignment of unsigned long is 2 bytes:
>
> Kernel panic - not syncing: __kmem_cache_create_args: Failed to create slab 'io_kiocb'. Error -22
> CPU: 0 UID: 0 PID: 1 Comm: swapper Not tainted 6.12.0-atari-03776-g7eaa1f99261a #1783
> Stack from 0102fe5c:
> 0102fe5c 00514a2b 00514a2b ffffff00 00000001 0051f5ed 00425e78 00514a2b
> 0041eb74 ffffffea 00000310 0051f5ed ffffffea ffffffea 00601f60 00000044
> 0102ff20 000e7a68 0051ab8e 004383b8 0051f5ed ffffffea 000000b8 00000007
> 01020c00 00000000 000e77f0 0041e5f0 005f67c0 0051f5ed 000000b6 0102fef4
> 00000310 0102fef4 00000000 00000016 005f676c 0060a34c 00000010 00000004
> 00000038 0000009a 01000000 000000b8 005f668e 0102e000 00001372 0102ff88
> Call Trace: [<00425e78>] dump_stack+0xc/0x10
> [<0041eb74>] panic+0xd8/0x26c
> [<000e7a68>] __kmem_cache_create_args+0x278/0x2e8
> [<000e77f0>] __kmem_cache_create_args+0x0/0x2e8
> [<0041e5f0>] memset+0x0/0x8c
> [<005f67c0>] io_uring_init+0x54/0xd2
>
> The minimal alignment of an integral type may differ from its size,
> hence is not safe to assume that an arbitrary freeptr_t (which is
> basically an unsigned long) is always aligned to 4 or 8 bytes.
>
> As nothing seems to require the additional alignment, it is safe to fix
> this by relaxing the check to the actual minimum alignment of freeptr_t.
>
> Fixes: aaa736b186239b7d ("io_uring: specify freeptr usage for SLAB_TYPESAFE_BY_RCU io_kiocb cache")
> Fixes: d345bd2e9834e2da ("mm: add kmem_cache_create_rcu()")
> Reported-by: Guenter Roeck <[email protected]>
> Closes: https://lore.kernel.org/[email protected]
> Signed-off-by: Geert Uytterhoeven <[email protected]>
On m68k:
Tested-by: Guenter Roeck <[email protected]>
next prev parent reply other threads:[~2024-11-20 15:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-20 12:46 [PATCH] slab: Fix too strict alignment check in create_cache() Geert Uytterhoeven
2024-11-20 12:49 ` Geert Uytterhoeven
2024-11-20 15:00 ` Guenter Roeck [this message]
2024-11-20 15:01 ` Jens Axboe
2024-11-20 15:03 ` Vlastimil Babka
2024-11-20 15:14 ` Guenter Roeck
2024-11-20 15:44 ` Vlastimil Babka
2024-11-20 15:50 ` Geert Uytterhoeven
2024-11-20 17:50 ` Christoph Lameter (Ampere)
2024-11-21 3:51 ` Matthew Wilcox
2024-11-21 8:15 ` Geert Uytterhoeven
2024-11-21 10:19 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox