<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/char/vt_ioctl.c, branch linux-2.6.23.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.23.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.23.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2007-10-07T23:02:55Z</updated>
<entry>
<title>VT_WAITACTIVE: Avoid returning EINTR when not necessary</title>
<updated>2007-10-07T23:02:55Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2007-10-07T23:02:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=70cb97935b8859f27296772885104b599f560576'/>
<id>urn:sha1:70cb97935b8859f27296772885104b599f560576</id>
<content type='text'>
We should generally prefer to return ERESTARTNOHAND rather than EINTR,
so that processes with unhandled signals that get ignored don't return
EINTR.

This can help with X startup issues:

    Fatal server error:
    xf86OpenConsole: VT_WAITACTIVE failed: Interrupted system call

although the real fix is having the X server always retry EINTR
regardless (since EINTR does happen for signals that have handlers
installed). Keithp has a patch for that.

Regardless, ERESTARTNOHAND is the correct thing to use.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>VT ioctl race fix</title>
<updated>2007-10-01T14:52:23Z</updated>
<author>
<name>Samuel Ortiz</name>
</author>
<published>2007-10-01T08:20:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8792f961ba8057d9f27987def3600253a3ba060f'/>
<id>urn:sha1:8792f961ba8057d9f27987def3600253a3ba060f</id>
<content type='text'>
When calling the RELDISP VT ioctl, we are reading vt_newvt while the
console workqueue could be messing with it (through change_console()).  We
fix this race by taking the console semaphore before reading vt_newvt.

Signed-off-by: Samuel Ortiz &lt;sameo@openedhand.com&gt;
Acked-by: Antonino Daplas &lt;adaplas@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fix console change race exposed by CFS</title>
<updated>2007-09-29T17:00:15Z</updated>
<author>
<name>Jan Lübbe</name>
</author>
<published>2007-09-29T16:47:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a64314e62d89562b6fc77593648bec3acc35bf61'/>
<id>urn:sha1:a64314e62d89562b6fc77593648bec3acc35bf61</id>
<content type='text'>
The new behaviour of CFS exposes a race which occurs if a switch is
requested when vt_mode.mode is VT_PROCESS.

The process with vc-&gt;vt_pid is signaled before vc-&gt;vt_newvt is set.
This causes the switch to fail when triggered by the monitoing process
because the target is still -1.

[ If the signal sending fails, the subsequent "reset_vc(vc)" will then
  reset vt_newvt to -1, so this works for that case too.   - Linus ]

Signed-off-by: Jan Lübbe &lt;jluebbe@lasnet.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drivers/char: use __set_current_state()</title>
<updated>2007-05-08T18:15:13Z</updated>
<author>
<name>Milind Arun Choudhary</name>
</author>
<published>2007-05-08T07:30:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc0a8fbb7ce00f65dc337dd91389b7151f44ed30'/>
<id>urn:sha1:cc0a8fbb7ce00f65dc337dd91389b7151f44ed30</id>
<content type='text'>
use __set_current_state(TASK_*) instead of current-&gt;state = TASK_*,

Signed-off-by: Milind Arun Choudhary &lt;milindchoudhary@gmail.com&gt;
Cc: Jiri Slaby &lt;jirislaby@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] vt: fix potential race in VT_WAITACTIVE handler</title>
<updated>2007-04-02T17:06:09Z</updated>
<author>
<name>Michal Januszewski</name>
</author>
<published>2007-04-02T06:49:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f991519c197534811046e5e47389b6fafcdf1e48'/>
<id>urn:sha1:f991519c197534811046e5e47389b6fafcdf1e48</id>
<content type='text'>
On a multiprocessor machine the VT_WAITACTIVE ioctl call may return 0 if
fg_console has already been updated in redraw_screen() but the console
switch itself hasn't been completed.  Fix this by checking fg_console in
vt_waitactive() with the console sem held.

Signed-off-by: Michal Januszewski &lt;spock@gentoo.org&gt;
Acked-by: Antonino Daplas &lt;adaplas@pol.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] swsusp: fix suspend when console is in VT_AUTO+KD_GRAPHICS mode</title>
<updated>2007-03-17T02:25:05Z</updated>
<author>
<name>Andrew Johnson</name>
</author>
<published>2007-03-16T21:38:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b257bc051f06607beb3004d9a1c297085e728bec'/>
<id>urn:sha1:b257bc051f06607beb3004d9a1c297085e728bec</id>
<content type='text'>
When the console is in VT_AUTO+KD_GRAPHICS mode, switching to the
SUSPEND_CONSOLE fails, resulting in vt_waitactive() waiting indefinitely or
until the task is interrupted.  This patch tests if a console switch can
occur in set_console() and returns early if a console switch is not
possible.

[akpm@linux-foundation.org: cleanup]
Signed-off-by: Andrew Johnson &lt;ajohnson@intrinsyc.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: "Antonino A. Daplas" &lt;adaplas@pol.net&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] vt: refactor console SAK processing</title>
<updated>2007-02-11T18:51:24Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2007-02-10T09:44:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b6312f4dcc1efe7975731b6c47dd134282bd9ac'/>
<id>urn:sha1:8b6312f4dcc1efe7975731b6c47dd134282bd9ac</id>
<content type='text'>
This does several things.
- It moves looking up of the current foreground console into process
  context where we can safely take the semaphore that protects this
  operation.
- It uses the new flavor of work queue processing.
- This generates a factor of do_SAK, __do_SAK that runs immediately.
- This calls __do_SAK with the console semaphore held ensuring nothing
  else happens to the console while we process the SAK operation.
- With the console SAK processing moved into process context this
  patch removes the xchg operations that I used to attempt to attomically
  update struct pid, because of the strange locking used in the SAK processing.
  With SAK using the normal console semaphore nothing special is needed.

Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] getting rid of all casts of k[cmz]alloc() calls</title>
<updated>2006-12-13T17:05:58Z</updated>
<author>
<name>Robert P. J. Day</name>
</author>
<published>2006-12-13T08:35:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5cbded585d129d0226cb48ac4202b253c781be26'/>
<id>urn:sha1:5cbded585d129d0226cb48ac4202b253c781be26</id>
<content type='text'>
Run this:

	#!/bin/sh
	for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
	  echo "De-casting $f..."
	  perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
	done

And then go through and reinstate those cases where code is casting pointers
to non-pointers.

And then drop a few hunks which conflicted with outstanding work.

Cc: Russell King &lt;rmk@arm.linux.org.uk&gt;, Ian Molton &lt;spyro@f2s.com&gt;
Cc: Mikael Starvik &lt;starvik@axis.com&gt;
Cc: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Cc: Roman Zippel &lt;zippel@linux-m68k.org&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Cc: Paul Fulghum &lt;paulkf@microgate.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: Karsten Keil &lt;kkeil@suse.de&gt;
Cc: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
Cc: Jeff Garzik &lt;jeff@garzik.org&gt;
Cc: James Bottomley &lt;James.Bottomley@steeleye.com&gt;
Cc: Ian Kent &lt;raven@themaw.net&gt;
Cc: Steven French &lt;sfrench@us.ibm.com&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Neil Brown &lt;neilb@cse.unsw.edu.au&gt;
Cc: Jaroslav Kysela &lt;perex@suse.cz&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] vt: fix comments to not refer to kill_proc</title>
<updated>2006-12-13T17:05:47Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2006-12-13T08:34:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3dfcaf16135150d0f025047a7525664a41bb2adf'/>
<id>urn:sha1:3dfcaf16135150d0f025047a7525664a41bb2adf</id>
<content type='text'>
The code has been fixed to use kill_pid instead of kill_proc fix the
comments as well.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] vt: Make vt_pid a struct pid (making it pid wrap around safe).</title>
<updated>2006-10-02T14:57:14Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2006-10-02T09:17:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bde0d2c98bcfc9acc83ac79c33a6ac1335b95a92'/>
<id>urn:sha1:bde0d2c98bcfc9acc83ac79c33a6ac1335b95a92</id>
<content type='text'>
I took a good hard look at the locking and it appears the locking on vt_pid
is the console semaphore.  Every modified path is called under the console
semaphore except reset_vc when it is called from fn_SAK or do_SAK both of
which appear to be in interrupt context.  In addition I need to be careful
because in the presence of an oops the console_sem may be arbitrarily
dropped.

Which leads me to conclude the current locking is inadequate for my needs.

Given the weird cases we could hit because of oops printing instead of
introducing an extra spin lock to protect the data and keep the pid to
signal and the signal to send in sync, I have opted to use xchg on just the
struct pid * pointer instead.

Due to console_sem we will stay in sync between vt_pid and vt_mode except
for a small window during a SAK, or oops handling.  SAK handling should
kill any user space process that care, and oops handling we are broken
anyway.  Besides the worst that can happen is that I try to send the wrong
signal.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
