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]
Date:	Sun, 08 May 2011 19:37:19 +0200
From:	Oliver Hartkopp <socketcan@...tkopp.net>
To:	matvejchikov@...il.com, Alan Cox <alan@...rguk.ukuu.org.uk>,
	Jeff Dike <jdike@...toit.com>
CC:	Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH] NET: slip, fix ldisc->open retval

On 06.05.2011 18:23, Matvejchikov Ilya wrote:
> TTY layer expects 0 if the ldisc->open operation succeeded.
> 
> Signed-off-by : Matvejchikov Ilya <matvejchikov@...il.com>
> ---
>  drivers/net/slip.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/slip.c b/drivers/net/slip.c
> index 86cbb9e..8ec1a9a 100644
> --- a/drivers/net/slip.c
> +++ b/drivers/net/slip.c
> @@ -853,7 +853,9 @@ static int slip_open(struct tty_struct *tty)
>  	/* Done.  We have linked the TTY line to a channel. */
>  	rtnl_unlock();
>  	tty->receive_room = 65536;	/* We don't flow control */
> -	return sl->dev->base_addr;
> +
> +	/* TTY layer expects 0 on success */
> +	return 0;
> 
>  err_free_bufs:
>  	sl_free_bufs(sl);

sl->dev->base_addr holds the index into the pointer array of the slip devices.
This is a value >= 0.

The return values of tty_ldisc_open in drivers/tty/tty_ldisc.c are checking
for errors with '< 0' but in some cases they check for '!= 0' which is
correctly addressed in this patch.

Looks reasonable to me.

Acked-by: Oliver Hartkopp <socketcan@...tkopp.net>

Alan?

There is also a slip_open() in arch/um/drivers/slip_user.c which also returns
positive numbers (filedescriptors) having the same issue ... Jeff?

Once this patch is accepted, i would send a similar patch for
drivers/net/can/slcan.c too.

Regards,
Oliver
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ