[Bug 486005] Re: init: don't hold /dev/console open

Bug Watch Updater 486005 at bugs.launchpad.net
Fri Oct 27 00:11:43 UTC 2017


Launchpad has imported 16 comments from the remote bug at
https://bugzilla.redhat.com/show_bug.cgi?id=491474.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2009-03-21T14:33:13+00:00 Volodymyr wrote:

Description of problem:

SAK (Alt-SysRq-K) is no longer working in X. When this combination is
pressed to restart X server, system just hangs, without even syncing to
disk, display is corrupted, magic key is not working.

Workaround:

If you need to login into server or workstation from graphical console,
you can switch to text console tty2..tty6, use SAK to clean console from
any malicious software, which is left by previous user, then login into
system, verify owner of GDM and X processes or just kill them, then
switch back to tty1 and login into system using graphical console.


How reproducible:

Always.


Steps to Reproduce:
1. Boot Fedora in graphic mode.
2. Press Alt-SysRq-K

  
Actual results:

System is hangs without syncing to disk due to kernel panic: "Kernel
panic - not syncing: Attempted to kill init!"


Expected results:

X server and GDM are restarted.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/0

------------------------------------------------------------------------
On 2009-11-18T11:34:22+00:00 Bug wrote:


This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/1

------------------------------------------------------------------------
On 2009-11-18T17:54:27+00:00 Jani wrote:

This still happens with F12, please see
https://bugzilla.redhat.com/show_bug.cgi?id=528260

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/2

------------------------------------------------------------------------
On 2009-11-19T11:19:03+00:00 Volodymyr wrote:

Nice example of racism in Open Source.

Yes, this bug is still exists in Fedora 11/12.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/3

------------------------------------------------------------------------
On 2009-11-19T18:40:14+00:00 Daniel wrote:

Strange. I didn't get any mails about being assigned this bug, never
seen it before.

First question: Are you really running initng? The bug is classified as
initng, but I see nothing in the description that indicates that initng
is really used. If you ARE using initng, I can recommend switching to
upstart as initng isn't maintained all that much anymore.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/4

------------------------------------------------------------------------
On 2009-11-20T00:52:16+00:00 Volodymyr wrote:

Currently, I use upstart-0.3.11-1.fc11.i586 on my notebook.

Problem is not in initialization subsystem itself: init, initng or
upstart. Problem in configuration of init subsystem and/or kernel
behaviour.

When SysRQ-K combination (SAK) is pressed on tty1, *kernel* kills *all*
processes on this tty, including all daemons, including init process,
and then hangs because init process is killed. It is *bad idea* to use
SAK on tty1.

In public environment (e.g. computer class in school) SAK is highly
recommended, otherwise smart child will leave slightly modified version
of GDM left running and will fool next user.

Unfortunately, X servers is moved from tty7 to tty1, so there is no
other protection from smart children except reboot.

To fix that problem, upstart must be configured to use any other tty
except tty1 for X server. Moreover, tty1 should not be used to login
into system at all and  SAK key should be disabled for tty1 in kernel.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/5

------------------------------------------------------------------------
On 2009-11-20T07:39:58+00:00 Daniel wrote:

Ok. I'll change asignee then to the one responsible for upstart.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/6

------------------------------------------------------------------------
On 2009-11-20T15:40:48+00:00 Bill wrote:

If SAK is killing *init* something else weird is going on, it has
nothing to do with where the X server is.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/7

------------------------------------------------------------------------
On 2009-11-20T16:25:02+00:00 Volodymyr wrote:

> If SAK is killing *init* something else weird is going on, it has nothing to do
with where the X server is.

SAK kills *all* processes on tty1, including all daemons, including
init.

Quote from kernel/Documentation/SAK.txt:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
On the PC keyboard, SAK kills all applications which have /dev/console opened. Unfortunately this includes a number of things which you don't actually want killed.

This is because these applications are incorrectly holding /dev/console open.  Be sure to complain to your Linux distributor about this!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


[vlisivka at apollo 1]$ sudo fuser -v /dev/console
                     USER        PID ACCESS COMMAND
/dev/console:        root          1 F.... init
                     root       1258 F.... rsyslogd
[vlisivka at apollo 1]$ sudo fuser -v /dev/tty1
                     USER        PID ACCESS COMMAND
/dev/tty1:           root       1878 F.... Xorg

SAK on tty1 will kill Xorg and /sbin/init with rsyslogd.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/8

------------------------------------------------------------------------
On 2009-11-20T18:12:28+00:00 Casey wrote:

Upstart definitely holds a /dev/console fd. Might be useful to just
preclude pid 1 from SAKing.

If notting agrees I'll move this to kernel and write the patch.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/9

------------------------------------------------------------------------
On 2009-11-20T18:34:40+00:00 Bill wrote:

Is there a real reason to hold a /dev/console fd?

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/10

------------------------------------------------------------------------
On 2009-11-20T18:35:01+00:00 Bill wrote:

Especially now that rhgb is dead and we don't need to do redirection in
that way.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/11

------------------------------------------------------------------------
On 2009-11-20T19:09:22+00:00 Casey wrote:

I'll move this into launchpad then and get Scott's input.

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/12

------------------------------------------------------------------------
On 2009-11-20T21:07:37+00:00 Bill wrote:

*** Bug 528260 has been marked as a duplicate of this bug. ***

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/15

------------------------------------------------------------------------
On 2010-03-23T19:14:16+00:00 Casey wrote:

This is fixed in 0.6.5. Can the reporter or anyone else verify its
absence on F13?

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/18

------------------------------------------------------------------------
On 2010-05-11T13:59:27+00:00 Petr wrote:

works as expected on my F13 with upstart-0.6.5-3.fc13.i686

Reply at: https://bugs.launchpad.net/upstart/+bug/486005/comments/19


** Changed in: upstart (Fedora)
       Status: Confirmed => Fix Released

** Changed in: upstart (Fedora)
   Importance: Unknown => Medium

** Bug watch added: Red Hat Bugzilla #528260
   https://bugzilla.redhat.com/show_bug.cgi?id=528260

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to upstart in Ubuntu.
https://bugs.launchpad.net/bugs/486005

Title:
  init: don't hold /dev/console open

Status in upstart :
  Fix Released
Status in upstart package in Ubuntu:
  Fix Released
Status in upstart package in Fedora:
  Fix Released

Bug description:
  The SAK key (mappable with loadkeys or Alt+Sysrq+K with magic sysrq
  enabled) can kill Upstart because Upstart maintains an open fd to
  /dev/console. As far as I know Upstart no longer needs to do this.

  Basically this means people using the SAK key to verify GDM before
  logging in get a kernel panic instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/upstart/+bug/486005/+subscriptions



More information about the foundations-bugs mailing list