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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220420085339.GA2969@kadam>
Date:   Wed, 20 Apr 2022 11:53:39 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Paul Kocialkowski <paul.kocialkowski@...tlin.com>
Cc:     linux-media@...r.kernel.org, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
        linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzk+dt@...nel.org>,
        Chen-Yu Tsai <wens@...e.org>,
        Jernej Skrabec <jernej.skrabec@...il.com>,
        Samuel Holland <samuel@...lland.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Hans Verkuil <hans.verkuil@...co.com>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v3 3/4] staging: media: Add support for the Allwinner A31
 ISP

On Wed, Apr 20, 2022 at 11:51:33AM +0300, Dan Carpenter wrote:
> On Wed, Apr 20, 2022 at 09:50:42AM +0200, Paul Kocialkowski wrote:
> > Hi Dan,
> > 
> > On Wed 20 Apr 22, 10:42, Dan Carpenter wrote:
> > > I ran Smatch on this patch.
> > 
> > Thanks for doing this!
> > 
> > > On Fri, Apr 15, 2022 at 05:37:07PM +0200, Paul Kocialkowski wrote:
> > > > +void sun6i_isp_capture_configure(struct sun6i_isp_device *isp_dev)
> > > > +{
> > > > +	unsigned int width, height;
> > > > +	unsigned int stride_luma, stride_chroma = 0;
> > > > +	unsigned int stride_luma_div4, stride_chroma_div4;
> > > > +	const struct sun6i_isp_capture_format *format;
> > > > +	const struct v4l2_format_info *info;
> > > > +	u32 pixelformat;
> > > > +
> > > > +	sun6i_isp_capture_dimensions(isp_dev, &width, &height);
> > > > +	sun6i_isp_capture_format(isp_dev, &pixelformat);
> > > > +
> > > > +	format = sun6i_isp_capture_format_find(pixelformat);
> > > > +	if (WARN_ON(!format))
> > > > +		return;
> > > > +
> > > > +	sun6i_isp_load_write(isp_dev, SUN6I_ISP_MCH_SIZE_CFG_REG,
> > > > +			     SUN6I_ISP_MCH_SIZE_CFG_WIDTH(width) |
> > > > +			     SUN6I_ISP_MCH_SIZE_CFG_HEIGHT(height));
> > > > +
> > > > +	info = v4l2_format_info(pixelformat);
> > > > +	if (WARN_ON(!info))
> > > > +		return;
> > > > +
> > > > +	stride_luma = width * info->bpp[0];
> > > > +	stride_luma_div4 = DIV_ROUND_UP(stride_luma, 4);
> > > > +
> > > > +	if (info->comp_planes > 1) {
> > > > +		stride_chroma = width * info->bpp[1] / info->hdiv;
> > > > +		stride_chroma_div4 = DIV_ROUND_UP(stride_chroma, 4);
> > > 
> > > stride_chroma_div4 is not intialized on the else path.
> > 
> > One could say it's not an issue to put an uninitialized value in this situation
> > since the hardware won't be taking it into account but I'll initialize the value
> > early in the next iteration.
> > 
> 
> My understanding is that it will trigger a KASAN warning at run time.

Or is it KMEMsan?  One of those.  The one that complains about
uninitialized memory.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ