Skip to content

tty: release_one_tty() forgets to put pids

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1tty: release_one_tty() forgets to put pidsdrivers/char/tty_io.c+2 -06 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] tty: release_one_tty() forgets to put pids

Add cc's.

Quoted 12 lines · Andrew Morton
Quoted 8 lines · On Tue, 30 Mar 2010 16:31:13 +0100 Catalin Marinas <[email protected]>…
Quoted 4 lines · Tetsuo Handa

I got below report with 2.6.33.1 .

unreferenced object 0xde144600 (size 64):
comm "init", pid 1, jiffies 4294678101 (age 291.508s)

[... snip ...]

Quoted 8 lines
Quoted 8 lines

I reported similar leaks last year -
http://lkml.org/lkml/2009/7/8/422. There is some analysis in the thread above of the reference counting but I couldn't figure out where it goes wrong. It looks to me like there isn't any reference to a struct pid block but its reference count is 2.

There is a bugzilla entry as well -
https://bugzilla.kernel.org/show_bug.cgi?id=13868

OK. I do not undertand ttys, absolutely. This means the patch should not be applied without acks. And in fact I feel the patch probably fixes the symptom, not the problem. But the logic in disassociate_ctty() is beyond my understanding.

However, I think it is easy to explain the leak.

Catalin, Tetsuo, could you try this patch?

Oleg.