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: <20170515103118.GA10885@kroah.com>
Date:   Mon, 15 May 2017 12:31:18 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Okash Khawaja <okash.khawaja@...il.com>
Cc:     Jiri Slaby <jslaby@...e.com>,
        Samuel Thibault <samuel.thibault@...-lyon.org>,
        linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
        Kirk Reiser <kirk@...sers.ca>,
        Chris Brannon <chris@...-brannons.com>,
        speakup@...ux-speakup.org
Subject: Re: [patch 2/6] tty: export tty_open_by_driver

On Sat, Apr 29, 2017 at 08:52:59PM +0100, Okash Khawaja wrote:
> This applies on top of the changes already in staging-next branch which allow
> kernel access to TTY dev.
> 
> Signe-doff-by: Okash Khawaja <okash.khawaja@...il.com>
> Reviewed-by: Samuel Thibault <samuel.thibault@...-lyon.org>
> 
> Index: linux-staging/drivers/tty/tty_io.c
> ===================================================================
> --- linux-staging.orig/drivers/tty/tty_io.c
> +++ linux-staging/drivers/tty/tty_io.c
> @@ -1369,7 +1369,10 @@ static struct tty_struct *tty_driver_loo
>  	struct tty_struct *tty;
>  
>  	if (driver->ops->lookup)
> -		tty = driver->ops->lookup(driver, file, idx);
> +		if (!file)
> +			tty = ERR_PTR(-EIO);
> +		else
> +			tty = driver->ops->lookup(driver, file, idx);

Why make this change?  Shouldn't the lookup function allow a NULL file
pointer?  Or is the problem that they do not?

>  	else
>  		tty = driver->ttys[idx];
>  
> @@ -2001,7 +2004,7 @@ static struct tty_driver *tty_lookup_dri
>  		struct tty_driver *console_driver = console_device(index);
>  		if (console_driver) {
>  			driver = tty_driver_kref_get(console_driver);
> -			if (driver) {
> +			if (driver && filp) {

Why change this too?

Your changelog does not explain any of this, please do so.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ