Re: [PATCH] media: v4l2-isp: reject zero-sized parameter blocks
Jacopo Mondi <[email protected]>
| Newsgroups | org.kernel.vger.linux-media,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <aoP7A6oYPkjmh3gv@zed> |
Hi David, On Mon, Aug 17, 2026 at 05:19:18PM +0100, David CARLIER wrote: > 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. Do you think we should fail validation because the info table has holes or we should simply skip entries with info->size == 0 ? I'm leaning towards the latter fwiw > > 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. > Yes thanks, as v4l2-isp went in in v6.19 this is worth a Fixes tag I think.. > Cheers.