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]
Message-ID: <23d788bb-8e96-0d00-34e6-211c75c391ab@suse.cz>
Date:   Thu, 20 Feb 2020 09:25:56 +0100
From:   Jiri Slaby <jslaby@...e.cz>
To:     Kees Cook <keescook@...omium.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Alexander Potapenko <glider@...gle.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] n_tty: Distribute switch variables for initialization

On 20. 02. 20, 7:23, Kees Cook wrote:
> Note that these warnings (or silent
> skipping) happen before the dead-store elimination optimization phase,
> so even when the automatic initializations are later elided in favor of
> direct initializations, the warnings remain.

That is a compiler bug IMO, but OK, the move makes sense anyway.

> To avoid these problems, move such variables into the "case" where
> they're used or lift them up into the main function body.
...
> Signed-off-by: Kees Cook <keescook@...omium.org>

Reviewed-by: Jiri Slaby <jslaby@...e.cz>

> ---
>  drivers/tty/n_tty.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
> index f9c584244f72..1d1a398f4981 100644
> --- a/drivers/tty/n_tty.c
> +++ b/drivers/tty/n_tty.c
> @@ -654,9 +654,9 @@ static size_t __process_echoes(struct tty_struct *tty)
>  			op = echo_buf(ldata, tail + 1);
>  
>  			switch (op) {
> +			case ECHO_OP_ERASE_TAB: {
>  				unsigned int num_chars, num_bs;
>  
> -			case ECHO_OP_ERASE_TAB:
>  				if (MASK(ldata->echo_commit) == MASK(tail + 2))
>  					goto not_yet_stored;
>  				num_chars = echo_buf(ldata, tail + 2);
> @@ -687,7 +687,7 @@ static size_t __process_echoes(struct tty_struct *tty)
>  				}
>  				tail += 3;
>  				break;
> -
> +			}
>  			case ECHO_OP_SET_CANON_COL:
>  				ldata->canon_column = ldata->column;
>  				tail += 2;
> 

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ