Re: [PATCH RESEND v2 07/23] proc: let procfs own the seq_file of seq_file entries

Kees Cook kees at kernel.org
Sat Nov 7 08:10:28 PST 2026



On November 4, 2026 11:30:58 AM PST, Christian Brauner <brauner at kernel.org> 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



More information about the kexec mailing list