Re: [PATCH RESEND v2 07/23] proc: let procfs own the seq_file of seq_file entries
From: Kees Cook
Date: Sat Nov 07 2026 - 13:31:55 EST
On November 4, 2026 11:30:58 AM PST, Christian Brauner <brauner@xxxxxxxxxx> wrote:
> [...]
>+static int pde_init_seq_direct(struct proc_dir_entry *pde)
>+{
>+ struct seq_operations *ops;
>+
>+ if (!pde_is_seq_file(pde))
>+ return 0;
>+ ops = kmalloc(sizeof(*ops), GFP_KERNEL);
Please use the new style typed allocation calls for objects:
ops = kmalloc_obj(*ops);
(This happened to jump out at me, but please check the other patches for this pattern.)
> dp->open = kzalloc(sizeof(*dp->open), GFP_KERNEL);
Same, etc.
--
Kees Cook