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: <ZB1xWRo0rkhku2BS@phenom.ffwll.local>
Date:   Fri, 24 Mar 2023 10:46:01 +0100
From:   Daniel Vetter <daniel@...ll.ch>
To:     Jon Hunter <jonathanh@...dia.com>
Cc:     Nathan Chancellor <nathan@...nel.org>,
        Thierry Reding <thierry.reding@...il.com>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>, Arnd Bergmann <arnd@...db.de>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Tom Rix <trix@...hat.com>,
        Mikko Perttunen <mperttunen@...dia.com>,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Robin Murphy <robin.murphy@....com>,
        dri-devel@...ts.freedesktop.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] gpu: host1x: fix uninitialized variable use

On Wed, Mar 08, 2023 at 05:28:06PM +0000, Jon Hunter wrote:
> 
> 
> On 08/03/2023 16:56, Nathan Chancellor wrote:
> > Ping? This warning is now in 6.3-rc1.
> 
> Thierry is away at the moment.
> 
> David, Daniel, do you want to pick this up directly in the meantime as a fix
> for 6.3? Mikko has already reviewed and FWIW ...

Generally first fallback should be drm-misc maintainers (or anyone else
with commit rights), but since this fell through cracks for weeks it seems
I'll pick it up to drm-fixes now directly.
-Daniel

> 
> Reviewed-by: Jon Hunter <jonathanh@...dia.com>
> 
> Thanks
> Jon
> 
> 
> > On Thu, Feb 23, 2023 at 09:28:28AM -0700, Nathan Chancellor wrote:
> > > Hi Thierry, Daniel, and David,
> > > 
> > > On Fri, Jan 27, 2023 at 11:14:00PM +0100, Arnd Bergmann wrote:
> > > > From: Arnd Bergmann <arnd@...db.de>
> > > > 
> > > > The error handling for platform_get_irq() failing no longer
> > > > works after a recent change, clang now points this out with
> > > > a warning:
> > > > 
> > > > drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
> > > >          if (syncpt_irq < 0)
> > > >              ^~~~~~~~~~
> > > > 
> > > > Fix this by removing the variable and checking the correct
> > > > error status.
> > > > 
> > > > Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
> > > > Signed-off-by: Arnd Bergmann <arnd@...db.de>
> > > > ---
> > > >   drivers/gpu/host1x/dev.c | 5 ++---
> > > >   1 file changed, 2 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> > > > index 4872d183d860..aae2efeef503 100644
> > > > --- a/drivers/gpu/host1x/dev.c
> > > > +++ b/drivers/gpu/host1x/dev.c
> > > > @@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
> > > >   static int host1x_probe(struct platform_device *pdev)
> > > >   {
> > > >   	struct host1x *host;
> > > > -	int syncpt_irq;
> > > >   	int err;
> > > >   	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
> > > > @@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
> > > >   	}
> > > >   	host->syncpt_irq = platform_get_irq(pdev, 0);
> > > > -	if (syncpt_irq < 0)
> > > > -		return syncpt_irq;
> > > > +	if (host->syncpt_irq < 0)
> > > > +		return host->syncpt_irq;
> > > >   	mutex_init(&host->devices_lock);
> > > >   	INIT_LIST_HEAD(&host->devices);
> > > > -- 
> > > > 2.39.0
> > > > 
> > > 
> > > Apologies if this has been reported already or has a solution in
> > > progress but mainline is now broken because this change got separated
> > > from the change it is fixing:
> > > 
> > > https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/4249931209/jobs/7391912774
> > > https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2M7y9HpiXB13qiC2mkHMyeZOcLW/build.log
> > > 
> > > I see this change sitting in the drm-tegra tree [1], which is getting
> > > merged into -next, so it is fixed there, which is why we did not notice
> > > any issues until the drm-next tree was merged into mainline. Can this be
> > > fast tracked to Linus to unbreak clang builds with -Werror?
> > > 
> > > [1]: https://gitlab.freedesktop.org/drm/tegra/-/commit/b9930311641cf2ed905a84aabe27e8f3868aee4a
> 
> -- 
> nvpublic

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ