Re: [PATCH v2] media: v4l2-isp: reject zero-sized parameter blocks

David CARLIER <[email protected]>
Newsgroups org.kernel.vger.linux-media,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <CA+XhMqzZqLFeDfNLxmXUTpc_FauD9C2odaSQb9HfWxKMmpf6Sw@mail.gmail.com>
Hi Jacopo,

On Wed, Aug 19, 2026 at 04:56:33PM +0200, Jacopo Mondi wrote:
> shouldn't we refuse the whole parameters buffer right away instead of
> ignoring the 'type' block ?

Yes, let's do that. It costs nothing either: with the header size check
the walk always makes progress, so skipping is no longer needed to avoid
the stall.

v3 keeps that check and replaces the skip with:

      info = &type_info[block->type];
      if (!info->size) {
              dev_dbg(dev, "Unsupported block type %u at offset %zu\n",
                      block->type, block_offset);
              return -EINVAL;
      }

which also leaves the rest of the loop unindented.

Cheers.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.