All of lore.kernel.org
 help / color / mirror / Atom feed
* 18-year-old bug
@ 2016-01-06 14:37 Albert Cahalan
  2016-01-06 16:24 ` Jeff Merkey
  2016-01-07 21:37 ` Peter Hurley
  0 siblings, 2 replies; 3+ messages in thread
From: Albert Cahalan @ 2016-01-06 14:37 UTC (permalink / raw)
  To: linux-kernel

This bug was introduced with SE Linux, 18 years ago. People have been
adding hacks to work around it as the bug bites them, but really the
bug ought to be fixed. Signals related to a tty are supposed to come
from the kernel. This got broken for pty devices. We now act as if
the signal is sent from the process on the master side of the pty.
That isn't right; the signal is supposed to come from the tty itself
and thus have a kernel identity.

How to reproduce:

Copy /bin/sleep to /tmp/work and /tmp/fail. Start up xterm, run
/tmp/work in the window, close the window, and see the process gone.
Now repeat that for /tmp/fail, but run "su -" in the window first.
Meanwhile, to view the problem, run this in another window:

ps -Cwork -Cfail -o tty,pid,ppid,tpgid,pgid,sid,ruid,euid,comm

(so like "/tmp/fail 100" or however much time you need)

I first saw the problem when I was maintaining top. People would
run top as root, close the window, and then find that top got stuck
spinning on select. Eventually top was hacked up to work around the
kernel bug, but really we shouldn't have userspace trying to work
around kernel bugs. I tried to fix it back then, but got a bit lost
in the then-new code. Sorry. Since then, I've become insanely busy
with ten kids. I'd really appreciate if somebody could take a shot
at fixing this bug. It seems to have hit a coworker a few months back,
and he is just living with it. (ouch)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 18-year-old bug
  2016-01-06 14:37 18-year-old bug Albert Cahalan
@ 2016-01-06 16:24 ` Jeff Merkey
  2016-01-07 21:37 ` Peter Hurley
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Merkey @ 2016-01-06 16:24 UTC (permalink / raw)
  To: Albert Cahalan; +Cc: linux-kernel

On 1/6/16, Albert Cahalan <acahalan@gmail.com> wrote:
> This bug was introduced with SE Linux, 18 years ago. People have been
> adding hacks to work around it as the bug bites them, but really the
> bug ought to be fixed. Signals related to a tty are supposed to come
> from the kernel. This got broken for pty devices. We now act as if
> the signal is sent from the process on the master side of the pty.
> That isn't right; the signal is supposed to come from the tty itself
> and thus have a kernel identity.
>
> How to reproduce:
>
> Copy /bin/sleep to /tmp/work and /tmp/fail. Start up xterm, run
> /tmp/work in the window, close the window, and see the process gone.
> Now repeat that for /tmp/fail, but run "su -" in the window first.
> Meanwhile, to view the problem, run this in another window:
>
> ps -Cwork -Cfail -o tty,pid,ppid,tpgid,pgid,sid,ruid,euid,comm
>
> (so like "/tmp/fail 100" or however much time you need)
>
> I first saw the problem when I was maintaining top. People would
> run top as root, close the window, and then find that top got stuck
> spinning on select. Eventually top was hacked up to work around the
> kernel bug, but really we shouldn't have userspace trying to work
> around kernel bugs. I tried to fix it back then, but got a bit lost
> in the then-new code. Sorry. Since then, I've become insanely busy
> with ten kids. I'd really appreciate if somebody could take a shot
> at fixing this bug. It seems to have hit a coworker a few months back,
> and he is just living with it. (ouch)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

Point me to the code in kernel and I'll take stab at it.  There are a
bunch of old bugs lurking around the kernel.

Jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 18-year-old bug
  2016-01-06 14:37 18-year-old bug Albert Cahalan
  2016-01-06 16:24 ` Jeff Merkey
@ 2016-01-07 21:37 ` Peter Hurley
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Hurley @ 2016-01-07 21:37 UTC (permalink / raw)
  To: Albert Cahalan, linux-kernel

On 01/06/2016 06:37 AM, Albert Cahalan wrote:
> This bug was introduced with SE Linux, 18 years ago. People have been
> adding hacks to work around it as the bug bites them, but really the
> bug ought to be fixed. Signals related to a tty are supposed to come
> from the kernel. This got broken for pty devices. We now act as if
> the signal is sent from the process on the master side of the pty.
> That isn't right; the signal is supposed to come from the tty itself
> and thus have a kernel identity.

What problem do you observe and on what kernel version?


> How to reproduce:
> 
> Copy /bin/sleep to /tmp/work and /tmp/fail. Start up xterm, run
> /tmp/work in the window, close the window, and see the process gone.
> Now repeat that for /tmp/fail, but run "su -" in the window first.
> Meanwhile, to view the problem, run this in another window:
> 
> ps -Cwork -Cfail -o tty,pid,ppid,tpgid,pgid,sid,ruid,euid,comm
> 
> (so like "/tmp/fail 100" or however much time you need)
> 
> I first saw the problem when I was maintaining top. People would
> run top as root, close the window, and then find that top got stuck
> spinning on select. Eventually top was hacked up to work around the
> kernel bug, but really we shouldn't have userspace trying to work
> around kernel bugs. I tried to fix it back then, but got a bit lost
> in the then-new code. Sorry. Since then, I've become insanely busy
> with ten kids. I'd really appreciate if somebody could take a shot
> at fixing this bug. It seems to have hit a coworker a few months back,
> and he is just living with it. (ouch)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-07 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-06 14:37 18-year-old bug Albert Cahalan
2016-01-06 16:24 ` Jeff Merkey
2016-01-07 21:37 ` Peter Hurley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.