|Kay Sievers||Nov 16, 2010 7:46 am|
|Alan Cox||Nov 16, 2010 7:56 am|
|Kay Sievers||Nov 16, 2010 8:12 am|
|Alan Cox||Nov 16, 2010 9:14 am|
|Kay Sievers||Nov 16, 2010 10:51 am|
|Alan Cox||Nov 16, 2010 11:55 am|
|Kay Sievers||Nov 16, 2010 12:15 pm|
|Alan Cox||Nov 16, 2010 12:48 pm|
|Kay Sievers||Nov 16, 2010 1:28 pm|
|Lennart Poettering||Nov 16, 2010 1:35 pm|
|Lennart Poettering||Nov 16, 2010 1:42 pm|
|Alan Cox||Nov 16, 2010 2:51 pm|
|Alan Cox||Nov 16, 2010 2:55 pm|
|Lennart Poettering||Nov 16, 2010 2:58 pm|
|Alan Cox||Nov 16, 2010 3:04 pm|
|Lennart Poettering||Nov 16, 2010 3:10 pm|
|Lennart Poettering||Nov 16, 2010 3:18 pm|
|Alan Cox||Nov 16, 2010 3:45 pm|
|Etched Pixels||Nov 16, 2010 3:49 pm|
|John Stoffel||Nov 17, 2010 8:31 am|
|Vald...@vt.edu||Nov 17, 2010 2:00 pm|
|Kay Sievers||Nov 17, 2010 3:39 pm|
|Alan Cox||Nov 17, 2010 3:56 pm|
|Greg KH||Nov 17, 2010 5:27 pm|
|Lennart Poettering||Nov 17, 2010 5:48 pm|
|Greg KH||Nov 17, 2010 5:52 pm|
|Lennart Poettering||Nov 17, 2010 6:28 pm|
|Alan Cox||Nov 18, 2010 2:14 am|
|Dr. Werner Fink||Nov 18, 2010 2:59 am|
|Alan Cox||Nov 18, 2010 3:23 am|
|Kay Sievers||Nov 18, 2010 3:54 am|
|Kay Sievers||Nov 18, 2010 4:03 am|
|Dr. Werner Fink||Nov 18, 2010 4:12 am|
|Alan Cox||Nov 18, 2010 4:57 am|
|Alan Cox||Nov 18, 2010 5:00 am|
|Dr. Werner Fink||Nov 18, 2010 5:13 am|
|Alan Cox||Nov 18, 2010 6:41 am|
|Dr. Werner Fink||Nov 19, 2010 5:21 am|
|Alan Cox||Nov 19, 2010 7:46 am|
|Dr. Werner Fink||Nov 19, 2010 9:06 am||.tiocgdev|
|Greg KH||Nov 19, 2010 10:02 am|
|Dr. Werner Fink||Nov 19, 2010 10:41 am|
|Alan Cox||Nov 20, 2010 4:39 am|
|Dr. Werner Fink||Dec 1, 2010 3:15 am|
|Dr. Werner Fink||Dec 1, 2010 4:31 am||.tiocgdev|
|Dr. Werner Fink||Dec 3, 2010 3:47 am||.Other|
|Subject:||Re: tty: add 'active' sysfs attribute to tty0 and console device|
|From:||Alan Cox (al...@lxorguk.ukuu.org.uk)|
|Date:||Nov 18, 2010 2:14:56 am|
- the existing ioctl is broken and no userspace program can use it properly, so it might as well be removed.
You can use it happily for various things providing you hold the vt switch lock. It's not a very good API and wants something doing about it. However we can't deprecate it using either of the proposed patches because neither of them cover the needed functionality.
- Kay's patch is one proposed solution for what userspace is wanting to learn about ttys. Werner's is another one.
Kay's patch is useless. As we've demonstrated by as you call it "going off topic" it can't actually provide a credible security model. Its providing a variable without holding the locks that make the value meaningful. Thats as basic an error I can think of.
We wouldn't accept kernel code which did
mutex_lock(&foo->lock) temp = foo->only_valid_under_lock; mutex_unlock(&foo->lock); return temp; /* ma invalid by now */
especially when it was going to be used for permission management. We'd call it a bug. So why are we proposing to add an API that does exactly that ?
I can do any one, or multiple things from the following options:
- disable the existing ioctl to return an error so that no new userspace program starts to use it thinking it is valid - accept Werner's patch for those who like proc files - accept Kay's patch
None of the above. In fact the current situation is better than either of the patches because it's equally broken and involves no more broken APIs !
Doing it right means: - deprecating the existing ioctl (because it's a dumb interface and Kay is right about that) - adding a proper event device which is pollable and returns the same events (and more) using a small kfifo queue. Trivial to code and will not add another API we'll need to deprecate again the moment anyone wants to use it. - support synchronous switching by that interface or verify the existing vt locking interfaces will do the job in conjunction with it.
Kay's approach doesn't solve three things
- You can't use the data to implement proper secure desktop switching - It doesn't support moving to multiple active vts at a time - You can't deprecate the wait event interface unless you replace all the features of it that people use (eg resize events)
So we will be back here again doing the same thing deprecating Kay's interface if we go that way. Having an event device actually lets us solve the problem properly, and if we are careful about the message formats cover the fact the KMS folks and others want multiple "live" virtual consoles at a time.
If you have a /dev/vtmanager or similar and opening it allocates a kfifo of a page into which we stuff the events we currently post for waitevent then the code is trivial and it does what Kay needs as well as being able to cover the rest of the WAITEVENT interface and future multi-desktop stuff.
So its trivial to do the job properly, which makes the existing patches all the wrong thing to do.