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: <53BD8398.6020507@codeaurora.org>
Date:	Wed, 09 Jul 2014 11:02:00 -0700
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
CC:	David Brown <davidb@...eaurora.org>,
	Daniel Walker <dwalker@...o99.com>,
	Bryan Huntsman <bryanh@...eaurora.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.cz>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <robh+dt@...nel.org>,
	linux-arm-msm@...r.kernel.org, linux-serial@...r.kernel.org,
	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v2] tty: serial: msm_serial.c:  Cleaning up uninitialized
 variables

On 07/06/14 09:47, Rickard Strandqvist wrote:
> Set reasonable initial value of some variables, in case
> they do not get set to something otherwise.
> And I've also added a plausibility control of the values.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
> ---

This patch doesn't look right...

> @@ -930,17 +930,21 @@ static int __init msm_console_setup(struct console *co, char *options)
>  
>  	msm_init_clock(port);
>  
> -	if (options)
> +	if (options) {
>  		uart_parse_options(options, &baud, &parity, &bits, &flow);
> +		if (baud < 300 || baud > 115200)
> +			baud = 115200;
> +		if (NULL == strchr("noeNOE", parity))
> +			parity = 'n';
> +		if (bits != 7)
> +			bits = 8;
> +		if (flow != 'r')
> +			flow = 'n';
> +	}
>  
> -	bits = 8;
> -	parity = 'n';
> -	flow = 'n';
>  	msm_write(port, UART_MR2_BITS_PER_CHAR_8 | UART_MR2_STOP_BIT_LEN_ONE,
>  		  UART_MR2);	/* 8N1 */
>  

because this code is overriding whatever is parsed from
uart_parse_options() on purpose. The hardware is configured for 8 bits,
no parity, no flow control with this msm_write() statement. Maybe we
should extend the code to configure the parity and flow control bits
instead.

> -	if (baud < 300 || baud > 115200)
> -		baud = 115200;
>  	msm_set_baud_rate(port, baud);
>  
>  	msm_reset(port);


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

--
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