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:	Fri, 17 Oct 2008 12:40:04 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Tilman Schmidt <tilman@...p.cc>
Cc:	torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
	Hansjoerg Lipp <hjlipp@....de>
Subject: Re: [PATCH 72/80] tty: fix up gigaset a bit

> >  	/* prevent other callers from entering ldisc methods */
> > +	/* FIXME: should use the tty state flags */
> >  	tty->disc_data = NULL;
> >  
> >  	if (!cs->hw.ser)
> 
> Do you know of an example line discipline that has got this right?
> My model for this code was drivers/net/ppp_async.c but now it seems
> that this was not as exemplary as I had hoped.

If you want to know if the tty has been closed for further I/O then you
can use test_bit(TTY_IO_ERROR, &tty->flags). This gets set at the right
points on close/hangup/etc.

> > @@ -680,6 +675,8 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file,
> >  /*
> >   * Poll on the tty.
> >   * Unused, always return zero.
> > + *
> > + * FIXME: should probably return an exception - especially on hangup
> >   */
> >  static unsigned int
> >  gigaset_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
> 
> Looking around, I see that many LDs don't even provide a poll method.
> So I'm thinking of just dropping this one. Would that be ok?

PPP doesn't route characters via the tty interface while you seem to do
so for the AT emulation so you do need it. In the hangup case you want to
return an exception event too: probably you want

	POLLIN|POLLOUT|POLLERR|POLLHUP|POLLRDNORM|POLLWRNORM

for that case.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ