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: <20180914162352.GC3443@localhost>
Date:   Fri, 14 Sep 2018 18:23:52 +0200
From:   Johan Hovold <johan@...nel.org>
To:     Al Viro <viro@...IV.linux.org.uk>
Cc:     Johan Hovold <johan@...nel.org>, Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/50] tty_ioctl(): start taking TIOC[SG]SERIAL into
 separate methods

On Fri, Sep 14, 2018 at 04:18:54PM +0100, Al Viro wrote:
> On Fri, Sep 14, 2018 at 03:22:16PM +0200, Johan Hovold wrote:
> > On Thu, Sep 13, 2018 at 03:40:04AM +0100, Al Viro wrote:
> > > From: Al Viro <viro@...iv.linux.org.uk>
> > > 
> > > ->set_serial() and ->get_serial() resp., both taking tty and
> > > a kernel pointer to serial_struct.
> > > 
> > > Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
> > > ---
> > >  drivers/tty/tty_io.c       | 36 ++++++++++++++++++++++++++++++------
> > >  include/linux/tty_driver.h |  3 +++
> > >  2 files changed, 33 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> > > index 2b34ccf269e0..91d73732e11c 100644
> > > --- a/drivers/tty/tty_io.c
> > > +++ b/drivers/tty/tty_io.c

> > > +	memset(&v, 0, sizeof(struct serial_struct));
> > > +
> > > +	if (!tty->ops->set_serial)
> > 
> > You want get_serial here.
> 
> Nice catch.  Fixed.
> 
> > > +		return -ENOIOCTLCMD;
> > > +	err = tty->ops->get_serial(tty, &v);
> > > +	if (!err && copy_to_user(ss, &v, sizeof(struct serial_struct)))
> > > +		err = -EFAULT;
> > > +	return err;
> > >  }
> > >  
> > >  /*
> > > @@ -2602,8 +2621,13 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> > >  		}
> > >  		break;
> > >  	case TIOCSSERIAL:
> > > -		tty_warn_deprecated_flags(p);
> > > -		break;
> > > +		retval = tty_tiocsserial(tty, p);
> > > +		if (retval != -ENOIOCTLCMD)
> > > +			return retval;
> > 
> > Missing break.
> 
> *blink*
> Right you are... that's a bisect hazard (in the end of the series returns
> become unconditional anyway).  Fixed.

What's in your work branch now looks good, so feel free to add:

Reviewed-by: Johan Hovold <johan@...nel.org>

Thanks,
Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ