<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/char/vt.c, branch v2.6.13</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>[PATCH] Remove race between con_open and con_close</title>
<updated>2005-08-28T01:03:42+00:00</updated>
<author>
<name>Paul Mackerras</name>
<email>paulus@samba.org</email>
</author>
<published>2005-08-27T23:40:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f786648b89f00d4e66fe6b19beffd30e764651fc'/>
<id>f786648b89f00d4e66fe6b19beffd30e764651fc</id>
<content type='text'>
[ Same race and same patch also by Steven Rostedt &lt;rostedt@goodmis.org&gt; ]

I have a laptop (G3 powerbook) which will pretty reliably hit a race
between con_open and con_close late in the boot process and oops in
vt_ioctl due to tty-&gt;driver_data being NULL.

What happens is this: process A opens /dev/tty6; it comes into
con_open() (drivers/char/vt.c) and assign a non-NULL value to
tty-&gt;driver_data.  Then process A closes that and concurrently process
B opens /dev/tty6.  Process A gets through con_close() and clears
tty-&gt;driver_data, since tty-&gt;count == 1.  However, before process A
can decrement tty-&gt;count, we switch to process B (e.g. at the
down(&amp;tty_sem) call at drivers/char/tty_io.c line 1626).

So process B gets to run and comes into con_open with tty-&gt;count == 2,
as tty-&gt;count is incremented (in init_dev) before con_open is called.
Because tty-&gt;count != 1, we don't set tty-&gt;driver_data.  Then when the
process tries to do anything with that fd, it oopses.

The simple and effective fix for this is to test tty-&gt;driver_data
rather than tty-&gt;count in con_open.  The testing and setting of
tty-&gt;driver_data is serialized with respect to the clearing of
tty-&gt;driver_data in con_close by the console_sem.  We can't get a
situation where con_open sees tty-&gt;driver_data != NULL and then
con_close on a different fd clears tty-&gt;driver_data, because
tty-&gt;count is incremented before con_open is called.  Thus this patch
eliminates the race, and in fact with this patch my laptop doesn't
oops.

Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
[ Same patch
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
  in http://marc.theaimsgroup.com/?l=linux-kernel&amp;m=112450820432121&amp;w=2 ]
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Same race and same patch also by Steven Rostedt &lt;rostedt@goodmis.org&gt; ]

I have a laptop (G3 powerbook) which will pretty reliably hit a race
between con_open and con_close late in the boot process and oops in
vt_ioctl due to tty-&gt;driver_data being NULL.

What happens is this: process A opens /dev/tty6; it comes into
con_open() (drivers/char/vt.c) and assign a non-NULL value to
tty-&gt;driver_data.  Then process A closes that and concurrently process
B opens /dev/tty6.  Process A gets through con_close() and clears
tty-&gt;driver_data, since tty-&gt;count == 1.  However, before process A
can decrement tty-&gt;count, we switch to process B (e.g. at the
down(&amp;tty_sem) call at drivers/char/tty_io.c line 1626).

So process B gets to run and comes into con_open with tty-&gt;count == 2,
as tty-&gt;count is incremented (in init_dev) before con_open is called.
Because tty-&gt;count != 1, we don't set tty-&gt;driver_data.  Then when the
process tries to do anything with that fd, it oopses.

The simple and effective fix for this is to test tty-&gt;driver_data
rather than tty-&gt;count in con_open.  The testing and setting of
tty-&gt;driver_data is serialized with respect to the clearing of
tty-&gt;driver_data in con_close by the console_sem.  We can't get a
situation where con_open sees tty-&gt;driver_data != NULL and then
con_close on a different fd clears tty-&gt;driver_data, because
tty-&gt;count is incremented before con_open is called.  Thus this patch
eliminates the race, and in fact with this patch my laptop doesn't
oops.

Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
[ Same patch
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
  in http://marc.theaimsgroup.com/?l=linux-kernel&amp;m=112450820432121&amp;w=2 ]
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] vt.c build fix</title>
<updated>2005-07-15T16:54:50+00:00</updated>
<author>
<name>Nishanth Aravamudan</name>
<email>nacc@us.ibm.com</email>
</author>
<published>2005-07-15T10:56:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=030babac6ae54df64ae3bba4685ecb1d8d8dd8c3'/>
<id>030babac6ae54df64ae3bba4685ecb1d8d8dd8c3</id>
<content type='text'>
Signed-off-by: Nishanth Aravamudan &lt;nacc@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Nishanth Aravamudan &lt;nacc@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] console blanking oops fix</title>
<updated>2005-06-18T20:33:01+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@novell.com</email>
</author>
<published>2005-06-17T20:20:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cc63b1e12b378c44e074571d5688c23be823b04c'/>
<id>cc63b1e12b378c44e074571d5688c23be823b04c</id>
<content type='text'>
When significant delays happen during boot (e.g.  with a kernel debugger,
but the problem has also seen in other cases) the timeout for blanking the
console may trigger, but the work scheduler may not have been initialized,
yet.  schedule_work() will oops over the null keventd_wq.

Signed-off-by: Jan Beulich &lt;jbeulich@novell.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When significant delays happen during boot (e.g.  with a kernel debugger,
but the problem has also seen in other cases) the timeout for blanking the
console may trigger, but the work scheduler may not have been initialized,
yet.  schedule_work() will oops over the null keventd_wq.

Signed-off-by: Jan Beulich &lt;jbeulich@novell.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Linux-2.6.12-rc2</title>
<updated>2005-04-16T22:20:36+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@ppc970.osdl.org</email>
</author>
<published>2005-04-16T22:20:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2'/>
<id>1da177e4c3f41524e886b7f1b8a0c1fc7321cac2</id>
<content type='text'>
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
</pre>
</div>
</content>
</entry>
</feed>
