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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 2 Feb 2007 01:54:23 +0800
From:	"Aubrey Li" <aubreylee@...il.com>
To:	"Aubrey Li" <aubreylee@...il.com>, Alan <alan@...rguk.ukuu.org.uk>,
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Subject: Re: [BUG]: 2.6.19.2: Weird serial core issue

On 2/1/07, Russell King <rmk+lkml@....linux.org.uk> wrote:
> On Thu, Feb 01, 2007 at 06:09:24PM +0800, Aubrey Li wrote:
> > On 2/1/07, Russell King <rmk+lkml@....linux.org.uk> wrote:
> > >On Thu, Feb 01, 2007 at 10:33:40AM +0800, Aubrey Li wrote:
> > >> On 2/1/07, Alan <alan@...rguk.ukuu.org.uk> wrote:
> > >> >What code is running on that console at the time. Most likely that user
> > >> >code is also saving/restoring terminal settings so overwrite yours
> > >> >
> > >>
> > >> I implemented the serial driver by myself, :). See the attachment.
> > >> I didn't save/restore terminal setting in the my_set_termios().
> > >>
> > >> I trace this back till tty_tioctl(..., unsigned long arg), everytime I
> > >> type "ENTER" key,
> > >> the argument "arg" passed into tty_ioctl() is the address of a termios
> > >> structure, which include wrong c_cflag.
> > >
> > >If userspace is issuing an ioctl to re-enable crtscts, and the kernel
> > >is obliging, how can this be a kernel bug?
> >
> > But the fact is not.
> > 1) kernel boot up and enable crtscts by default
> > 2) issue an ioctl to disable crtscts.
> > 3) not do anything but type "ENTER", kernel re-enable crtscts.
> >
> > That's wrong. Terminal setting seems not be recorded by the serial core.
>
> serial core does not and should not "record" the terminal settings.
> That's the job of the tty layer.

OK, if tty layer save the new terminal settings to an old one properly,
How could this happen?

>
> > Is it clear?
>
> No.  You haven't analysed the call path causing tty_ioctl() to be
> invoked, so you have no basis to point the finger *anywhere* at the
> moment.
>
> Find out from where tty_ioctl() is called - maybe by adding a call
> to dump_stack().  I think you'll find it is coming from userspace.
>

If I recall correctly, the call path is as follows:

sys_ioctl->vfs_ioctl->do_ioctl->tty_ioctl->n_tty_ioctl->set_termios,

In set_termios, tmp_termios will be pointed to the argument "arg",
which includes the   wrong c_cflag.

Yes, from the back trace stack, it appears to come from userspace. But
I didn't startup any application. If there should be one, I think it's
shell.

But why shell remembers the initial terminal settings correctly, other
than last inital terminal settings? It must be passed from kernel
space, from tty layer, right?

I can't believe it's caused by the userspace, I'll go further to find
the root cause.

-Aubrey
-
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