Skip Menu |
 

Subject: HP-UX 11.11 system include redefines SE - telnetd deadlock/clients hang
As a result of this redefinition, telnetd sends the wrong SE (suboption
end) and some clients which rely on this for parsing hang (Putty,
Windows telnet, HP-UX stock telnet client etc), diff of fix to
src/appl/telnet/telnetd/telnetd.c follows (basically undef and redefine
right before main()):

217a218,225
Show quoted text
> /* /usr/include/machine/cpu.h defines SE as 0x0200 on HP-UX 11.11 */
> #ifdef __hpux
> #undef SE
> #define SE 0xF0
> #endif /* __hpux */
Subject: HPUX 11.11 Redefines SE - Causes telnetd deadlock
Date: Thu, 26 Jan 2006 16:14:10 -0800
From: "Nate Yocom" <nate.yocom@centrify.com>
To: <krb5-bugs@mit.edu>
/usr/include/machine/cpu.h redefines SE on HP-UX 11.11. SE is the
suboption end byte sent by telnet server/clients to signify the end of a
suboption command. When redefined, this results in the server sending
0x00 instead of the correct 0xF0. Many clients (Windows telnet, putty,
and stock HPUX telnet) fail to parse the suboption correctly and as a
result don't respond to it and go into a wait state for more data from
the server - while the server is in a wait looking for the clients
response, resulting in a 'deadlocked' session. The attached patch
forces the definition of SE on the HPUX platform before its used in
telnetd.c.

Nate Yocom
Senior Software Engineer
Centrify Corporation
425.462.5894
www.centrify.com
Download hpux_telnetd_deadlock.diff
application/octet-stream 623B

Message body not shown because it is not plain text.

[nate.yocom@centrify.com - Thu Jan 26 22:14:55 2006]:

Show quoted text
> /usr/include/machine/cpu.h redefines SE on HP-UX 11.11. SE is the
> suboption end byte sent by telnet server/clients to signify the end of a
> suboption command. When redefined, this results in the server sending
> 0x00 instead of the correct 0xF0. Many clients (Windows telnet, putty,
> and stock HPUX telnet) fail to parse the suboption correctly and as a
> result don't respond to it and go into a wait state for more data from
> the server - while the server is in a wait looking for the clients
> response, resulting in a 'deadlocked' session. The attached patch
> forces the definition of SE on the HPUX platform before its used in
> telnetd.c.

We have other files using SE; do they not run into the same problem? If
not, why not? If so, we shouldn't fix it independently in every file if
we can avoid it.

Perhaps we should work around this in our arpa/telnet.h instead?
Subject: RE: [krbdev.mit.edu #3422] HPUX 11.11 Redefines SE - Causes telnetd deadlock
Date: Mon, 19 Jun 2006 11:48:58 -0700
From: "Nate Yocom" <nate.yocom@centrify.com>
To: <rt-comment@krbdev.mit.edu>
RT-Send-Cc:
Show quoted text
> We have other files using SE; do they not run into the same
> problem? If not, why not? If so, we shouldn't fix it
> independently in every file if we can avoid it.

I haven't looked at this in some time, but from what I recall it was the
particular set and order of includes in telnetd only that caused this to
happen (or this was the only place where the use of an invalid SE
resulted in a deadlock).
[nate.yocom@centrify.com - Mon Jun 19 14:48:30 2006]:

Show quoted text
> > We have other files using SE; do they not run into the same
> > problem? If not, why not? If so, we shouldn't fix it
> > independently in every file if we can avoid it.
>
> I haven't looked at this in some time, but from what I recall it was the
> particular set and order of includes in telnetd only that caused this to
> happen (or this was the only place where the use of an invalid SE
> resulted in a deadlock).

Does moving the inclusion of arpa/telnet.h to after the inclusion of
general.h help? I don't have a HPUX 11 system to test with. Also,
could you trace the inclusion chain resulting in the inclusion of
machine/cpu.h?