lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 21 Nov 2020 21:48:48 -0300
From:   Ezequiel Garcia <ezequiel@...labora.com>
To:     Hans Verkuil <hverkuil@...all.nl>, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     kernel@...labora.com, Jonas Karlman <jonas@...boo.se>,
        Nicolas Dufresne <nicolas.dufresne@...labora.com>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Maxime Ripard <mripard@...nel.org>,
        Paul Kocialkowski <paul.kocialkowski@...tlin.com>,
        Jernej Skrabec <jernej.skrabec@...l.net>
Subject: Re: [PATCH v3 07/13] media: controls: Validate H264 stateless
 controls

On Fri, 2020-11-20 at 10:30 +0100, Hans Verkuil wrote:
> On 18/11/2020 19:46, Ezequiel Garcia wrote:
> > Check that all the fields that correspond or are related
> > to a H264 specification syntax element have legal values.
> > 
> > Signed-off-by: Ezequiel Garcia <ezequiel@...labora.com>
> > ---
> >  drivers/media/v4l2-core/v4l2-ctrls.c | 83 ++++++++++++++++++++++++++++
> >  1 file changed, 83 insertions(+)
> > 
[..]
> >  	case V4L2_CTRL_TYPE_H264_DECODE_PARAMS:
> >  		p_h264_dec_params = p;
> >  
> > +		if (p_h264_dec_params->nal_ref_idc > 3)
> > +			return -EINVAL;
> >  		for (i = 0; i < V4L2_H264_NUM_DPB_ENTRIES; i++) {
> >  			struct v4l2_h264_dpb_entry *dpb_entry =
> >  				&p_h264_dec_params->dpb[i];
> > 
> 
> General question: I don't see anything in std_init_compound() for these
> controls. Is initializing these compound controls to 0 enough to make them
> pass std_validate_compound()? It probably is, otherwise you'd see errors
> in the compliance test, I guess.
> guess.
> 

Indeed. You can see all the checks are for fields to not
exceed some maximum value.

This is common in H264/HEVC: you'll see  spread of _minusN
syntax. This is so to make zero-valued syntax common,
which in turns creates more redundancy, and make headers
more compressed.

Thanks,
Ezequiel

Powered by blists - more mailing lists