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] [day] [month] [year] [list]
Date:	Fri, 27 Dec 2013 11:05:26 +0100
From:	"Roy Spliet" <rspliet@...ipso.eu>
To:	"Kees Cook" <keescook@...gle.com>
Cc:	<bskeggs@...hat.com>, <linux-kernel@...r.kernel.org>,
	<dri-devel@...ts.freedesktop.org>
Subject: Re: nouveau nvaa clock missing break?

Hello Kees,

Thanks for your feedback. Let me first reassure you that this fall-through is indeed intentional: vdiv should be set regardless of the clock source. A comment line would definitely be in place though for future nouveau hackers.
In read_pll, post_div can never be zero in valid execution. If the register-read returns zero, the GPU has either fallen off the bus, or crashed because someone set a divider of 0. I agree that this is not very robust and will probably lead to a divide-by-zero on hardware failure. Checking it doesn't harm I bet!
I will propose a patch addressing these issues as soon as I find some free time. Thanks again for the feedback. Yours,

Roy

--- Ursprüngliche Nachricht ---
Von: Kees Cook <keescook@...gle.com>
Datum: 20:51:22 26-12-2013
An: Roy Spliet <rspliet@...ipso.eu>
Betreff: nouveau nvaa clock missing break?

> Hi,
>
> Just curious if this code is missing a "break" or not...
>
> /drivers/gpu/drm/nouveau/core/subdev/clock/nvaa.c: 373 in nvaa_clock_prog()
>
>
>         switch (priv->vsrc) {
>         case nv_clk_src_cclk:
>                 mast |= 0x00400000;
>         default:
>                 nv_wr32(clk, 0x4600, priv->vdiv);
>         }
>
> Coverity noticed it as CID 1135671. If it's intentional, it might be
> nice to add a "fall through" comment there.
>
> Coverity also complained about read_pll (CID 1135670) where post_div
> could (unlikely) be 0 and used for a divide-by-zero.
>
> Thanks!
>
> -Kees
>
> --
> Kees Cook
> Chrome OS Security
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ