[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1371094554.10688.42.camel@deadeye.wl.decadent.org.uk>
Date: Thu, 13 Jun 2013 04:35:54 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: Lotfi Manseur <lotfi.manseur@...il.com>
Cc: stable@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Wojciech M Zabolotny <W.Zabolotny@...a.pw.edu.pl>,
Nicolas Palix <nicolas.palix@...g.fr>,
Lotfi Manseur <lotfi.manseur@...g.fr>,
Willy Tarreau <w@....eu>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops
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@...g.fr>
> Signed-off-by: Nicolas Palix <nicolas.palix@...g.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.
Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)
Powered by blists - more mailing lists