Bug 201

Summary: telnetd in busybox1.13.3.
Product: Busybox Reporter: prash_2009 <prashanthnednoor>
Component: NetworkingAssignee: unassigned
Status: RESOLVED WORKSFORME    
Severity: enhancement CC: busybox-cvs
Priority: P5    
Version: 1.13.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: buysbox .config

Description prash_2009 2009-03-19 06:14:24 UTC
Hello All,

I am running busybox version 1.13.3 on an embedded system running linux-2.6.26.
and running an expect script that spawns telnet program in a loop.
1) Telnet into the embedded system
2) send the login/password
3) exit
4) go back to 1

The above causes my proc_inode_cache entries to keep increasing and never goes down.

Eventually the system will be out of memory.

Any pointers to narrow down will help, though I started looking at the telnetd code inside the buysbox.

thanks
Prash
Comment 1 Denys Vlasenko 2009-03-19 23:33:52 UTC
> 2) send the login/password
> 3) exit

Please clarify. Are you saying that login fails and telnet session dies;
or that you are deliberately exiting right after login worked and you reached a shell prompt, and doing this repeatedly leaks some resources, eventually killing the machine?
Comment 2 Denys Vlasenko 2009-03-20 00:01:19 UTC
Also, attach your .config and specify how do you run telnetd on server side:

Like this?

tcpsvd -vE 0.0.0.0 23 telnetd -i

Or like this - allowing it to daemonize?

telnetd

Or from inetd?
Comment 3 prash_2009 2009-03-20 07:29:20 UTC
I am deliberately exiting after I reach the shell prompt.

The exit seems to close the telnet session but not exiting out of shell prompt.

I run telnetd as /usr/sbin/telnetd

thanks
prashanth
Comment 4 Denys Vlasenko 2009-03-20 07:42:55 UTC
Please do the following: perform 10 or so iterations of telnet/login/password/exit cycles, then run "ps -a -o comm,pid,ppid" on the server and show the output.
It should look approximately like this:

COMMAND          PID   PPID
...
svlogd            1084  1001
automount         1086  1001
svlogd            1088   998
svlogd            1170  1002
crond             1172  1002
svlogd            1180   999
svlogd            1193  1003
dnscache          2024   999
pdflush           6153     2
...

(if it does not, your ps lacks support support for -a or -o).

Also, run "ls -l /pid/<pid_of_telnetd>/fd" and show its output too.

Also, please attach your .config to this bug.
Comment 5 prash_2009 2009-03-22 17:15:34 UTC
Created attachment 177 [details]
buysbox .config
Comment 6 prash_2009 2009-03-22 17:17:01 UTC
I couln't do this "ps -a -o comm,pid,ppid"  as my ps doesn't support -a option.

Why does this matter???

The fd's are fine.

thanks
prashanth
Comment 7 Denys Vlasenko 2009-03-23 06:40:29 UTC
Bug's summary says "telnetd in busybox1.13.3" but .config says:

# Automatically generated make config: don't edit
# Busybox version: 1.10.4
# Thu Mar 19 23:43:00 2009

Can you try whether 1.13.3 has this problem?

> I couln't do this "ps -a -o comm,pid,ppid"  as my ps doesn't support -a option.

Go to procps/ps.c and replace "#if ENABLE_DESKTOP" by "#if 1"

> Why does this matter???

Because I want to see whether they are leaked!!!

> The fd's are fine.

How do you know that?