Re: [PATCH 1/2] USB: serial/keyspan_pda, fix potential tty NULL dereferences

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 28 Feb 2011, Jiri Slaby wrote:

> Make sure that we check the return value of tty_port_tty_get.
> Sometimes it may return NULL and we later dereference that.
> 
> There are several places to check. For easier handling,
> tty_port_tty_get is moved directly to the palce where needed in
> keyspan_pda_rx_interrupt.
> 
> Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
> Cc: Alan Cox <alan@xxxxxxxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxx>

I wonder about these changes.  Does it makes sense to add this checking
everywhere?  A more reasonable approach might be to make sure that
tty_port_tty_get is never called in a context where it could return
NULL.  Or would that involve just as much effort, making work routines
and so on check to see whether there's an open TTY device before doing
anything else?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux