[PATCH v2] media: meson: vdec: Fix a NULL pointer dereference in amvdec_add_ts()

Dan Carpenter dan.carpenter at oracle.com
Fri Dec 3 05:30:13 PST 2021


On Fri, Dec 03, 2021 at 12:03:57AM +0800, Zhou Qingyang wrote:
> In amvdec_add_ts(), there is a dereference of kzalloc(), which could lead
> to a NULL pointer dereference on failure of kzalloc().
> 
> I fix this bug by adding a NULL check of new_ts.
> 
> This bug was found by a static analyzer. The analysis employs
> differential checking to identify inconsistent security operations
> (e.g., checks or kfrees) between two code paths and confirms that the
> inconsistent operations are not recovered in the current function or
> the callers, so they constitute bugs.
> 
> Note that, as a bug found by static analysis, it can be a false
> positive or hard to trigger. Multiple researchers have cross-reviewed
> the bug.
> 
> Builds with CONFIG_VIDEO_MESON_VDEC=m show no new warnings,
> and our static analyzer no longer warns about this code.
> 
> Fixes: 876f123b8956 ("media: meson: vdec: bring up to compliance")
> Signed-off-by: Zhou Qingyang <zhou1615 at umn.edu>
> ---
  ^^^
Thanks.  Next time put the meta commentary about how the bug was found
and the QC process under the the --- cut off line.  We don't need to
have that drama stored in the permanent git log.

Reviewed-by: Dan Carpenter <dan.carpenter at oracle.com>

regards,
dan carpenter




More information about the linux-amlogic mailing list