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:	Tue, 9 Sep 2008 14:19:32 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Joe Peterson <joe@...rush.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] TTY: Fix loss of echoed characters (2nd follow-on PATCH
 attached)

> 1) Now that column state is confined to the process_out/echo funcs in
> n_tty, would using tty_write_lock() (the defined atomic write lock
> mutex) be a good replacement for lock_kernel(), even though interruptible?

That lock orders writes to the ldisc so you would often be called with it
held anyway.

> 2) To protect echo buffer operations, I would lean toward using a
> separate echo lock mutex so it does not lock against non-echo-buffer
> output.  Would nesting this with #1 be advisable?  Should it be
> interruptable?

I would start with a lock for each object you need to get the locking
right for. If you ever take more than one at once it must be in the same
order (a lock heirarchy) to avoid deadlocks.

After that works then worry about whether you have too many locks.

> 3) tty_write() mentions refers to ldisc use of the BKL.  If we change
> this, are there any considerations for the tty_io or driver code?

Shouldn't be. n_tty is the last real user of the BKL in the ldisc layer.
I've been over the driver write methods already and they *should* now be
sorted and safe.

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