linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
@ 2013-06-07 13:14 Lotfi Manseur
  2013-06-07 13:47 ` Willy Tarreau
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Lotfi Manseur @ 2013-06-07 13:14 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman, Wojciech M Zabolotny, Nicolas Palix,
	Lotfi Manseur, Willy Tarreau, linux-usb, linux-kernel

Handle null termios in ftdi_set_termios(), introduced in
commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
This has been corrected in the mainline by
commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
a816e3113b63753c330ca4751ea1d208e93e3015.

This is to be fixed in longterm 2.6.32.60 and 3.4.47.
This bug has been found with coccinelle.

Signed-off-by: Lotfi Manseur <lotfi.manseur@imag.fr>
Signed-off-by: Nicolas Palix <nicolas.palix@imag.fr>
---
 drivers/usb/serial/ftdi_sio.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index c374beb..615bd9e 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2364,7 +2364,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
 
 	cflag = termios->c_cflag;
 
-	if (old_termios->c_cflag == termios->c_cflag
+	if (old_termios
+	    && old_termios->c_cflag == termios->c_cflag
 	    && old_termios->c_ispeed == termios->c_ispeed
 	    && old_termios->c_ospeed == termios->c_ospeed)
 		goto no_c_cflag_changes;
@@ -2373,7 +2374,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
 	   ftdi_sio_read_bulk_callback  - need to examine what this means -
 	   don't see any problems yet */
 
-	if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
+	if (old_termios &&
+	    (old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
 	    (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)))
 		goto no_data_parity_stop_changes;
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
  2013-06-07 13:14 [PATCH] USB: serial/ftdi_sio.c Fix kernel oops Lotfi Manseur
@ 2013-06-07 13:47 ` Willy Tarreau
  2013-06-07 13:56 ` Sergei Shtylyov
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Willy Tarreau @ 2013-06-07 13:47 UTC (permalink / raw)
  To: Lotfi Manseur
  Cc: stable, Greg Kroah-Hartman, Wojciech M Zabolotny, Nicolas Palix,
	Lotfi Manseur, linux-usb, linux-kernel

On Fri, Jun 07, 2013 at 03:14:32PM +0200, Lotfi Manseur wrote:
> Handle null termios in ftdi_set_termios(), introduced in
> commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
> This has been corrected in the mainline by
> commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
> a816e3113b63753c330ca4751ea1d208e93e3015.
> 
> This is to be fixed in longterm 2.6.32.60 and 3.4.47.
> This bug has been found with coccinelle.

Thank you Lofti, I have queued it now.

Best regards,
Willy


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
  2013-06-07 13:14 [PATCH] USB: serial/ftdi_sio.c Fix kernel oops Lotfi Manseur
  2013-06-07 13:47 ` Willy Tarreau
@ 2013-06-07 13:56 ` Sergei Shtylyov
  2013-06-07 17:30 ` Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2013-06-07 13:56 UTC (permalink / raw)
  To: Lotfi Manseur
  Cc: stable, Greg Kroah-Hartman, Wojciech M Zabolotny, Nicolas Palix,
	Lotfi Manseur, Willy Tarreau, linux-usb, linux-kernel

Hello.

On 06/07/2013 05:14 PM, Lotfi Manseur wrote:

> Handle null termios in ftdi_set_termios(), introduced in
> commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
> This has been corrected in the mainline by
> commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
> a816e3113b63753c330ca4751ea1d208e93e3015.

    You should also give the summary lines of all mentioned commits in 
parens.

> This is to be fixed in longterm 2.6.32.60 and 3.4.47.
> This bug has been found with coccinelle.
>
> Signed-off-by: Lotfi Manseur <lotfi.manseur@imag.fr>
> Signed-off-by: Nicolas Palix <nicolas.palix@imag.fr>

WBR, Sergei


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
  2013-06-07 13:14 [PATCH] USB: serial/ftdi_sio.c Fix kernel oops Lotfi Manseur
  2013-06-07 13:47 ` Willy Tarreau
  2013-06-07 13:56 ` Sergei Shtylyov
@ 2013-06-07 17:30 ` Greg Kroah-Hartman
  2013-06-07 18:49   ` Willy Tarreau
  2013-06-10 21:03 ` Greg Kroah-Hartman
  2013-06-13  3:35 ` Ben Hutchings
  4 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2013-06-07 17:30 UTC (permalink / raw)
  To: Lotfi Manseur
  Cc: stable, Wojciech M Zabolotny, Nicolas Palix, Lotfi Manseur,
	Willy Tarreau, linux-usb, linux-kernel

On Fri, Jun 07, 2013 at 03:14:32PM +0200, Lotfi Manseur wrote:
> Handle null termios in ftdi_set_termios(), introduced in
> commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
> This has been corrected in the mainline by
> commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
> a816e3113b63753c330ca4751ea1d208e93e3015.

Then why shouldn't we just include those commit instead of your patch,
which looks much different from these?

I'd much rather take the originals, not something else.

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
  2013-06-07 17:30 ` Greg Kroah-Hartman
@ 2013-06-07 18:49   ` Willy Tarreau
  0 siblings, 0 replies; 8+ messages in thread
From: Willy Tarreau @ 2013-06-07 18:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Lotfi Manseur, stable, Wojciech M Zabolotny, Nicolas Palix,
	Lotfi Manseur, linux-usb, linux-kernel

On Fri, Jun 07, 2013 at 10:30:09AM -0700, Greg Kroah-Hartman wrote:
> On Fri, Jun 07, 2013 at 03:14:32PM +0200, Lotfi Manseur wrote:
> > Handle null termios in ftdi_set_termios(), introduced in
> > commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
> > This has been corrected in the mainline by
> > commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
> > a816e3113b63753c330ca4751ea1d208e93e3015.
> 
> Then why shouldn't we just include those commit instead of your patch,
> which looks much different from these?
> 
> I'd much rather take the originals, not something else.

Indeed. I've checked, and the second commit was just cosmetic (silence
a warning reported by sparse for ptr == 0 introduced in the first one).

The context is minimally different (original commit introduces a jump
to a label whose context has changed). I tend to think that the merged
fix has less changes of being incorrectly applied, but given their
triviality we could very well merge the original ones instead, and
keep initial authorship BTW.

Willy


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
  2013-06-07 13:14 [PATCH] USB: serial/ftdi_sio.c Fix kernel oops Lotfi Manseur
                   ` (2 preceding siblings ...)
  2013-06-07 17:30 ` Greg Kroah-Hartman
@ 2013-06-10 21:03 ` Greg Kroah-Hartman
  2013-06-13  3:35 ` Ben Hutchings
  4 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2013-06-10 21:03 UTC (permalink / raw)
  To: Lotfi Manseur
  Cc: stable, Wojciech M Zabolotny, Nicolas Palix, Lotfi Manseur,
	Willy Tarreau, linux-usb, linux-kernel

On Fri, Jun 07, 2013 at 03:14:32PM +0200, Lotfi Manseur wrote:
> Handle null termios in ftdi_set_termios(), introduced in
> commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
> This has been corrected in the mainline by
> commits c515598e0f5769916c31c00392cc2bfe6af74e55 and

This commit showed up in 3.3, so it can't go into 3.4 at all.  Please be
more careful when asking for stable patches to be applied.  That is why
I want the _exact_ same patch to apply, don't try going and being smart
by mushing them together into something else, this would have obviously
not been correct for the 3.4 kernel at all.

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
  2013-06-07 13:14 [PATCH] USB: serial/ftdi_sio.c Fix kernel oops Lotfi Manseur
                   ` (3 preceding siblings ...)
  2013-06-10 21:03 ` Greg Kroah-Hartman
@ 2013-06-13  3:35 ` Ben Hutchings
  2013-06-17 15:30   ` Nicolas Palix
  4 siblings, 1 reply; 8+ messages in thread
From: Ben Hutchings @ 2013-06-13  3:35 UTC (permalink / raw)
  To: Lotfi Manseur
  Cc: stable, Greg Kroah-Hartman, Wojciech M Zabolotny, Nicolas Palix,
	Lotfi Manseur, Willy Tarreau, linux-usb, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1958 bytes --]

On Fri, 2013-06-07 at 15:14 +0200, Lotfi Manseur wrote:
> Handle null termios in ftdi_set_termios(), introduced in
> commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
> This has been corrected in the mainline by
> commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
> a816e3113b63753c330ca4751ea1d208e93e3015.
> 
> This is to be fixed in longterm 2.6.32.60 and 3.4.47.
> This bug has been found with coccinelle.
> 
> Signed-off-by: Lotfi Manseur <lotfi.manseur@imag.fr>
> Signed-off-by: Nicolas Palix <nicolas.palix@imag.fr>

I've queued up those changes for 3.2.  This backported version seems
nicer, but we generally prefer to use patches that are as close as
possible to those in mainline.

Ben.

> ---
>  drivers/usb/serial/ftdi_sio.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> index c374beb..615bd9e 100644
> --- a/drivers/usb/serial/ftdi_sio.c
> +++ b/drivers/usb/serial/ftdi_sio.c
> @@ -2364,7 +2364,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
>  
>  	cflag = termios->c_cflag;
>  
> -	if (old_termios->c_cflag == termios->c_cflag
> +	if (old_termios
> +	    && old_termios->c_cflag == termios->c_cflag
>  	    && old_termios->c_ispeed == termios->c_ispeed
>  	    && old_termios->c_ospeed == termios->c_ospeed)
>  		goto no_c_cflag_changes;
> @@ -2373,7 +2374,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
>  	   ftdi_sio_read_bulk_callback  - need to examine what this means -
>  	   don't see any problems yet */
>  
> -	if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
> +	if (old_termios &&
> +	    (old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
>  	    (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)))
>  		goto no_data_parity_stop_changes;
>  

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
  2013-06-13  3:35 ` Ben Hutchings
@ 2013-06-17 15:30   ` Nicolas Palix
  0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Palix @ 2013-06-17 15:30 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Lotfi Manseur, stable, Greg Kroah-Hartman, Wojciech M Zabolotny,
	Lotfi Manseur, Willy Tarreau, linux-usb, LKML

Hi,

On Thu, Jun 13, 2013 at 5:35 AM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Fri, 2013-06-07 at 15:14 +0200, Lotfi Manseur wrote:
>> Handle null termios in ftdi_set_termios(), introduced in
>> commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
>> This has been corrected in the mainline by
>> commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
>> a816e3113b63753c330ca4751ea1d208e93e3015.
>>
>> This is to be fixed in longterm 2.6.32.60 and 3.4.47.
>> This bug has been found with coccinelle.
>>
>> Signed-off-by: Lotfi Manseur <lotfi.manseur@imag.fr>
>> Signed-off-by: Nicolas Palix <nicolas.palix@imag.fr>
>
> I've queued up those changes for 3.2.  This backported version seems
> nicer, but we generally prefer to use patches that are as close as
> possible to those in mainline.

Thank you all for your comments.
We will be more careful for upcoming reports and patches
about the stable branches, and we will privilege mainline
patches next time.

Regards.

>
> Ben.
>
>> ---
>>  drivers/usb/serial/ftdi_sio.c |    6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
>> index c374beb..615bd9e 100644
>> --- a/drivers/usb/serial/ftdi_sio.c
>> +++ b/drivers/usb/serial/ftdi_sio.c
>> @@ -2364,7 +2364,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
>>
>>       cflag = termios->c_cflag;
>>
>> -     if (old_termios->c_cflag == termios->c_cflag
>> +     if (old_termios
>> +         && old_termios->c_cflag == termios->c_cflag
>>           && old_termios->c_ispeed == termios->c_ispeed
>>           && old_termios->c_ospeed == termios->c_ospeed)
>>               goto no_c_cflag_changes;
>> @@ -2373,7 +2374,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
>>          ftdi_sio_read_bulk_callback  - need to examine what this means -
>>          don't see any problems yet */
>>
>> -     if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
>> +     if (old_termios &&
>> +         (old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
>>           (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)))
>>               goto no_data_parity_stop_changes;
>>
>
> --
> Ben Hutchings
> friends: People who know you well, but like you anyway.



--
Nicolas Palix
Tel: +33 4 76 51 46 27
http://membres-liglab.imag.fr/palix/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-06-17 15:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-07 13:14 [PATCH] USB: serial/ftdi_sio.c Fix kernel oops Lotfi Manseur
2013-06-07 13:47 ` Willy Tarreau
2013-06-07 13:56 ` Sergei Shtylyov
2013-06-07 17:30 ` Greg Kroah-Hartman
2013-06-07 18:49   ` Willy Tarreau
2013-06-10 21:03 ` Greg Kroah-Hartman
2013-06-13  3:35 ` Ben Hutchings
2013-06-17 15:30   ` Nicolas Palix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).