Re: [PATCH] media: v4l2-isp: reject zero-sized parameter blocks
From: David CARLIER
Date: Mon Aug 17 2026 - 12:20:18 EST
On Mon, Aug 17, 2026 at 05:56:30PM +0200, Jacopo Mondi wrote:
> Should we instead deman that all entries provided by the driver are
> populated by failing validation if info->size == 0 ?
Good idea, and I'd rather keep both in v2 if you don't mind - they
guard different things.
info->size == 0 is about the driver table, and it lets us answer
"this driver doesn't handle that type" rather than carrying on with
an empty entry and a NULL block_validate.
block->size < sizeof(*block) is about the buffer coming from
userspace: a block's size includes its header, so anything smaller is
malformed no matter what the table says, and it keeps the loop moving
without depending on the table at all.
Both are a couple of lines, so dropping either one is no trouble if
you prefer.
> Right.. you might have seen ?
> https://patchwork.linuxtv.org/project/linux-media/list/?series=29170
I hadn't, thanks. That takes care of the rppx1 side, so there's
nothing left for me to send there and I'll stick to the core change.
I'll reword the commit message so it doesn't lean on rppx1, and keep
Cc: stable unless you disagree.
Cheers.