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]
Date:   Mon, 11 Dec 2017 11:34:28 -0800
From:   Joe Perches <joe@...ches.com>
To:     Arnd Bergmann <arnd@...db.de>,
        Michael Krufky <mkrufky@...uxtv.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Cc:     linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tuners: tda8290: reduce stack usage with kasan

On Mon, 2017-12-11 at 13:06 +0100, Arnd Bergmann wrote:
> With CONFIG_KASAN enabled, we get a relatively large stack frame in one function
> 
> drivers/media/tuners/tda8290.c: In function 'tda8290_set_params':
> drivers/media/tuners/tda8290.c:310:1: warning: the frame size of 1520 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> With CONFIG_KASAN_EXTRA this goes up to
> 
> drivers/media/tuners/tda8290.c: In function 'tda8290_set_params':
> drivers/media/tuners/tda8290.c:310:1: error: the frame size of 3200 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
> 
> We can significantly reduce this by marking local arrays as 'static const', and
> this should result in better compiled code for everyone.
[]
> diff --git a/drivers/media/tuners/tda8290.c b/drivers/media/tuners/tda8290.c
[]
> @@ -63,8 +63,8 @@ static int tda8290_i2c_bridge(struct dvb_frontend *fe, int close)
>  {
>  	struct tda8290_priv *priv = fe->analog_demod_priv;
>  
> -	unsigned char  enable[2] = { 0x21, 0xC0 };
> -	unsigned char disable[2] = { 0x21, 0x00 };
> +	static unsigned char  enable[2] = { 0x21, 0xC0 };
> +	static unsigned char disable[2] = { 0x21, 0x00 };

Doesn't match commit message.

static const or just static?

> @@ -84,9 +84,9 @@ static int tda8295_i2c_bridge(struct dvb_frontend *fe, int close)
>  {
>  	struct tda8290_priv *priv = fe->analog_demod_priv;
>  
> -	unsigned char  enable[2] = { 0x45, 0xc1 };
> -	unsigned char disable[2] = { 0x46, 0x00 };
> -	unsigned char buf[3] = { 0x45, 0x01, 0x00 };
> +	static unsigned char  enable[2] = { 0x45, 0xc1 };
> +	static unsigned char disable[2] = { 0x46, 0x00 };

etc.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ