Re: [RFC PATCH] ipc/msg: Use dedicated slab buckets for msg_msgseg

From: Vlastimil Babka (SUSE)

Date: Fri May 22 2026 - 02:43:57 EST


On 5/18/26 20:26, Philipp Weber wrote:
> System V message queues already allocate struct msg_msg from dedicated
> kmem buckets, so user-controlled variable-sized message allocations do
> not share generic kmalloc buckets.
>
> Large messages allocate additional struct msg_msgseg objects for the
> remaining payload. These allocations are also user-controlled in size
> and contents, but still come from generic kmalloc-cg buckets.
>
> Allocate msg_msgseg objects from a dedicated bucket set as well, so the
> segmented payload path follows the same heap-isolation model as the
> main msg_msg allocation.
>
> The free path remains unchanged because these allocations are freed
> with kfree(), matching the existing msg_msg bucket allocation.
>
> Signed-off-by: Philipp Weber <kernel@xxxxxxx>

Acked-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>