On Tue, Oct 24, 2023 at 04:39:36PM -0700, Kees Cook wrote:
> As the replacements get longer, I would encourage you to use seq_buf
> instead -- it does all the length math internally. For example:

There's some ongoing work to make seq_buf easier to use:
https://lore.kernel.org/lkml/[email protected]/

Perhaps we can add an "alloc" and "free" pair too, to handle this case:

>       msg = kmalloc(OCX_MESSAGE_SIZE, GFP_KERNEL);
>       seq_buf_init(&s, msg, OCX_MESSAGE_SIZE);

But perhaps it's overkill...

-- 
Kees Cook

Reply via email to