Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74293 - kernels based on 2.6.7 fail to reallocate ptys that have been used causing wtmp file bloat
Summary: kernels based on 2.6.7 fail to reallocate ptys that have been used causing wt...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-13 08:47 UTC by Allen Parker
Modified: 2004-12-25 08:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Allen Parker 2004-12-13 08:47:42 UTC
Steps to reproduce:
Login to a 2.6.7 based kernel, g-d-s or h-d-s will work, login via ssh, use 'w' to check your current pty, run screen, run w, then logout of screen about 3-4 times then login again on a seperate terminal and check your new pty using 'w'.
Expected behavior:
Initial pty will be on pts/0, second ssh session, after screens are removed, will be on pts/1 instead of pts/5 or pts/6

Possible fixes can be found at:
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.7-rc2/2.6.7-rc2-mm2/broken-out/
as dynpty-fix.patch or pty-allocation-first-fit.patch

I would suggest or fix this myself, but I'm not good enough to figure out how 1404_CAN-2004-0814.patch exactly modifies the same codebase (drivers/char) in a way that doesn't solve the existing pty problem.


From Changelog-2.6.8:   (line 4217)
<hpa@zytor.com>
        [PATCH] Use first-fit for pty allocation
        (With Andrew Morton).
        The current dynamic pty allocation scheme has a few problems:
        - pty numbers grow to be very large, causing wtmp file bloat.
        - Seems to break libc5 and some old applications
        So change it to do first-fit.  An IDR tree is used to provide a
        logarithmic-time search.

        Signed-off-by: Andrew Morton <akpm@osdl.org>
        Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Comment 1 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-12-13 11:13:48 UTC
Please just upgrade to the 2.6.9 g-d-s kernel.  It should be taken care of there.
Comment 2 Daniel Drake (RETIRED) gentoo-dev 2004-12-13 12:27:05 UTC
Better just let the hardened guys know, I think they are still on 2.6.7

hardened: you may need to apply a patch to solve a memory leak, please read the body of this bug
Comment 3 Allen Parker 2004-12-13 19:48:37 UTC
Since h-d-s is still affected by this, I think it should remain open until such time as there is a reasonable fix for h-d-s (which is where I saw the problem in the first place)
Comment 4 Adam Mondl (RETIRED) gentoo-dev 2004-12-25 08:31:19 UTC
Fixed in hardened-dev-sources-r18
Comment 5 Tim Yamin (RETIRED) gentoo-dev 2004-12-25 08:52:29 UTC
Closing, please see comment #4...