2001-04-22 17:22:56

by Manuel McLure

[permalink] [raw]
Subject: Problem with "su -" and kernels 2.4.3-ac11 and higher

I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the
problem.
The problem is easy to reproduce - go to a console, log in as root, do an
"su -" (this will succeed) and then another "su -". The second "su -"
should hang - ps shows it started bash and that the bash process is
sleeping. You need to "kill -9" the bash to get your prompt back.

Distribution is Red Hat 7.1, running on an Athlon Thunderbird 900MHz on a
MSI K7T Turbo R motherboard.

Thanks,
--
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]> | and significant law, no man may kill a cat.
<http://www.mclure.org> | -- H.P. Lovecraft


2001-04-23 02:01:27

by Andrzej Krzysztofowicz

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

>
> I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the
> problem.
> The problem is easy to reproduce - go to a console, log in as root, do an
> "su -" (this will succeed) and then another "su -". The second "su -"
> should hang - ps shows it started bash and that the bash process is
> sleeping. You need to "kill -9" the bash to get your prompt back.

No problem here.

P233MMX

# uname -a
Linux kufel 2.4.3-ac12 #2 nie kwi 22 15:32:51 CEST 2001 i586 unknown

# ls -l /lib/libc-*
-rwxr-xr-x 1 root root 1060168 Nov 19 11:17 /lib/libc-2.1.3.so

# gcc --version
egcs-2.91.66
(kernel with the fix by Niels Kristian Bech Jensen <[email protected]>)

# su --version
su (GNU sh-utils) 2.0

Maybe it is RH7 specyfic ? Or you have some compiler / hardware problem ?

Andrzej

2001-04-23 02:25:52

by Manuel McLure

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher


On 2001.04.22 14:38 Andrzej Krzysztofowicz wrote:
> >
> > I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the
> > problem.
> > The problem is easy to reproduce - go to a console, log in as root, do
> an
> > "su -" (this will succeed) and then another "su -". The second "su -"
> > should hang - ps shows it started bash and that the bash process is
> > sleeping. You need to "kill -9" the bash to get your prompt back.
>
> No problem here.
>
> P233MMX
>
> # uname -a
> Linux kufel 2.4.3-ac12 #2 nie kwi 22 15:32:51 CEST 2001 i586 unknown
>
> # ls -l /lib/libc-*
> -rwxr-xr-x 1 root root 1060168 Nov 19 11:17 /lib/libc-2.1.3.so
>
> # gcc --version
> egcs-2.91.66
> (kernel with the fix by Niels Kristian Bech Jensen <[email protected]>)
>
> # su --version
> su (GNU sh-utils) 2.0
>
> Maybe it is RH7 specyfic ? Or you have some compiler / hardware problem ?
>
> Andrzej

Did you try nesting more than one "su -"? The first one after a boot works
for me - every other one fails.
I'm on RH71 - this may be specific to this release. It's also
kernel-dependent, I can reboot with ac5 and the problem does not happen.
The kernel is compiled with the same compiler as yours.

My libc is 2.2.2 while yours is 2.1.3 - this may be the difference.

--
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]> | and significant law, no man may kill a cat.
<http://www.mclure.org> | -- H.P. Lovecraft

2001-04-23 02:42:43

by Brett

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

On Sun, 22 Apr 2001, Manuel McLure wrote:
>
>
> On 2001.04.22 14:38 Andrzej Krzysztofowicz wrote:
> > >
> > > I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the
> > > problem.
> > > The problem is easy to reproduce - go to a console, log in as root, do
> > an
> > > "su -" (this will succeed) and then another "su -". The second "su -"
> > > should hang - ps shows it started bash and that the bash process is
> > > sleeping. You need to "kill -9" the bash to get your prompt back.
> >

No problem here either...
Tried nesting 7 levels deep, a few times.

p75

# uname -a
Linux lapsis 2.4.3-ac12 #2 Sun Apr 22 17:41:08 EST 2001 i586 unknown

# ls /lib/libc-*
-rwxr-xr-x 1 root root 1417065 Feb 17 14:57 /lib/libc-2.2.2.so*

# gcc --version
2.95.3

# su --version
su (GNU sh-utils) 2.0j

/ Brett

2001-04-23 02:44:13

by Wayne Whitney

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

In mailing-lists.linux-kernel, Manuel A. McLure wrote:

> Did you try nesting more than one "su -"? The first one after a boot
> works for me - every other one fails.

Same here: the first "su -" works OK, but a second nested one hangs:

8825 pts/2 S 0:00 /bin/su -
8826 pts/2 S 0:00 -bash
8854 pts/2 T 0:00 stty erase ?
8855 pts/0 R 0:00 ps ax

"kill -CONT 8854" has no effect.

> I'm on RH71 - this may be specific to this release. It's also
> kernel-dependent, I can reboot with ac5 and the problem does not
> happen. The kernel is compiled with the same compiler as yours.

I'm RH-7.1 and kernel 2.4.4-pre6 (with the via 3.23 driver from -ac)

Cheers, Wayne

2001-04-23 03:02:02

by John Cavan

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

Manuel McLure wrote:
> Did you try nesting more than one "su -"? The first one after a boot works
> for me - every other one fails.

I tried it with about a half-dozen nested and no problem. Mandrake
cooker here...

uname -a
Linux lion 2.4.3-ac11 #5 SMP Fri Apr 20 22:10:41 EDT 2001 i686 unknown

gcc --version
2.96

ls -l /lib/libc-*
-rwxr-xr-x 1 root root 1216268 Feb 21 05:38
/lib/libc-2.2.2.so

su --version
su (GNU sh-utils) 2.0

I don't think libc is the problem, unless it is in conjunction with the
compiler choice. Have you tried building the kernel with the updated Red
Hat gcc version? I know Mandrake has kept theirs current to Red Hat and
it works fine for me.

John

2001-04-23 03:21:23

by Manuel McLure

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher


On 2001.04.22 19:42 Brett wrote:
> On Sun, 22 Apr 2001, Manuel McLure wrote:
> >
> >
> > On 2001.04.22 14:38 Andrzej Krzysztofowicz wrote:
> > > >
> > > > I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the
> > > > problem.
> > > > The problem is easy to reproduce - go to a console, log in as root,
> do
> > > an
> > > > "su -" (this will succeed) and then another "su -". The second "su
> -"
> > > > should hang - ps shows it started bash and that the bash process is
> > > > sleeping. You need to "kill -9" the bash to get your prompt back.
> > >
>
> No problem here either...
> Tried nesting 7 levels deep, a few times.
>
> p75
>
> # uname -a
> Linux lapsis 2.4.3-ac12 #2 Sun Apr 22 17:41:08 EST 2001 i586 unknown
>
> # ls /lib/libc-*
> -rwxr-xr-x 1 root root 1417065 Feb 17 14:57
> /lib/libc-2.2.2.so*
>
> # gcc --version
> 2.95.3
>
> # su --version
> su (GNU sh-utils) 2.0j
>
> / Brett
>

In my case:

# su --version
su (GNU sh-utils) 2.0

# bash --version
GNU bash, version 2.04.21(1)-release (i386-redhat-linux-gnu)

# uname -a
Linux ulthar 2.4.3-ac12 #3 Sat Apr 21 23:15:08 PDT 2001 i686 unknown

# ls -l /lib/libc-*
-rwxr-xr-x 2 root root 1236396 Apr 6 14:58 /lib/libc-2.2.2.so

# kgcc --version
egcs-2.91.66


--
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]> | and significant law, no man may kill a cat.
<http://www.mclure.org> | -- H.P. Lovecraft

2001-04-23 03:22:34

by Manuel McLure

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher


On 2001.04.22 19:42 Wayne Whitney wrote:
> In mailing-lists.linux-kernel, Manuel A. McLure wrote:
>
> > Did you try nesting more than one "su -"? The first one after a boot
> > works for me - every other one fails.
>
> Same here: the first "su -" works OK, but a second nested one hangs:
>
> 8825 pts/2 S 0:00 /bin/su -
> 8826 pts/2 S 0:00 -bash
> 8854 pts/2 T 0:00 stty erase ?
> 8855 pts/0 R 0:00 ps ax
>
> "kill -CONT 8854" has no effect.
>
> > I'm on RH71 - this may be specific to this release. It's also
> > kernel-dependent, I can reboot with ac5 and the problem does not
> > happen. The kernel is compiled with the same compiler as yours.
>
> I'm RH-7.1 and kernel 2.4.4-pre6 (with the via 3.23 driver from -ac)

It looks like this may very well be a RH 7.1 interaction with the kernel,
since others are not seeing this.

--
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]> | and significant law, no man may kill a cat.
<http://www.mclure.org> | -- H.P. Lovecraft

2001-04-23 05:06:07

by Manuel McLure

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher


On 2001.04.22 20:21 Manuel McLure wrote:
>
> On 2001.04.22 19:42 Wayne Whitney wrote:
> > In mailing-lists.linux-kernel, Manuel A. McLure wrote:
> >
> > > Did you try nesting more than one "su -"? The first one after a boot
> > > works for me - every other one fails.
> >
> > Same here: the first "su -" works OK, but a second nested one hangs:
> >
> > 8825 pts/2 S 0:00 /bin/su -
> > 8826 pts/2 S 0:00 -bash
> > 8854 pts/2 T 0:00 stty erase ?
> > 8855 pts/0 R 0:00 ps ax
> >
> > "kill -CONT 8854" has no effect.
> >
> > > I'm on RH71 - this may be specific to this release. It's also
> > > kernel-dependent, I can reboot with ac5 and the problem does not
> > > happen. The kernel is compiled with the same compiler as yours.
> >
> > I'm RH-7.1 and kernel 2.4.4-pre6 (with the via 3.23 driver from -ac)
>
> It looks like this may very well be a RH 7.1 interaction with the kernel,
> since others are not seeing this.

Your email made me look closer at my ps output. I also have stty waiting in
"T" state.

--
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]> | and significant law, no man may kill a cat.
<http://www.mclure.org> | -- H.P. Lovecraft

2001-04-23 05:18:28

by Albert D. Cahalan

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

Wayne writes:
> In mailing-lists.linux-kernel, Manuel A. McLure wrote:

>> Did you try nesting more than one "su -"? The first one after a boot
>> works for me - every other one fails.
>
> Same here: the first "su -" works OK, but a second nested one hangs:
>
> 8825 pts/2 S 0:00 /bin/su -
> 8826 pts/2 S 0:00 -bash
> 8854 pts/2 T 0:00 stty erase ?
> 8855 pts/0 R 0:00 ps ax

Try this:

ps -t pts/2 -o pid,ppid,pgid,sess,f,stat,ruid,euid,fname,nwchan,wchan
ps -t pts/2 s

(replace "pts/2" as needed to select the right tty, and split that
first one into two commands if it is too long)

2001-04-23 05:28:19

by Wayne Whitney

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

On Mon, 23 Apr 2001, Albert D. Cahalan wrote:

> Try this:
>
> ps -t pts/2 -o pid,ppid,pgid,sess,f,stat,ruid,euid,fname,nwchan,wchan
> ps -t pts/2 s

OK, below are the results. Since I'm sleepy I haven't looked up the ps
man page to see what it all means or whether I need to translate any
numbers into symbols, sorry. Let me know if you'd like anything else.

Cheers, Wayne


[whitney@pizza whitney]$ ps auxwOT
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
[ . . . ]
root 1792 0.1 0.2 2300 1068 pts/0 S 22:19 0:00 /bin/su -
root 1796 0.2 0.2 2356 1384 pts/0 S 22:19 0:00 -bash
root 1825 0.0 0.1 2112 952 pts/0 S 22:19 0:00 /bin/su -
root 1826 0.2 0.2 2188 1148 pts/0 S 22:19 0:00 -bash
root 1854 0.0 0.0 1352 412 pts/0 T 22:19 0:00 stty erase ?
whitney 1855 0.0 0.1 2664 792 pts/2 R 22:19 0:00 ps auxwOT
[whitney@pizza whitney]$ ps -t pts/0 -o pid,ppid,pgid,sess,f,stat,ruid,euid,fname,nwchan,wchan
PID PPID PGID SESS F STAT RUID EUID COMMAND WCHAN WCHAN
1722 1711 1722 1722 000 S 500 500 bash 117801 wait4
1792 1722 1792 1722 000 S 500 0 su 117801 wait4
1796 1792 1796 1722 100 S 0 0 bash 117801 wait4
1825 1796 1825 1722 000 S 0 0 su 117801 wait4
1826 1825 1826 1722 100 S 0 0 bash 117801 wait4
1854 1826 1826 1722 000 T 0 0 stty 106a5f do_signal
[whitney@pizza whitney]$ ps -t pts/0 s
UID PID PENDING BLOCKED IGNORED CAUGHT STAT TTY TIME COMMAND
500 1722 00000000 00010000 <00384004 4b813efb S pts/0 0:00 bash
0 1792 00000000 <fffb9eff <00000000 00004000 S pts/0 0:00 /bin/su -
0 1796 00000000 00010000 <00384004 4b813efb S pts/0 0:00 -bash
0 1825 00000000 <fffb9eff <00000000 00004000 S pts/0 0:00 /bin/su -
0 1826 00000000 00010000 <00384004 4b813efb S pts/0 0:00 -bash
0 1854 00000000 00000000 <00000000 00000000 T pts/0 0:00 stty erase ?

2001-04-23 09:19:30

by Alan

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

> > Did you try nesting more than one "su -"? The first one after a boot
> > works for me - every other one fails.
>
> Same here: the first "su -" works OK, but a second nested one hangs:

It appears to be a bug in PAM. Someone seems to reply on parent/child running
order and just got caught out

2001-04-23 09:56:36

by Andrzej Krzysztofowicz

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

"Manuel McLure wrote:"
> On 2001.04.22 14:38 Andrzej Krzysztofowicz wrote:
> > >
> > > I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the
> > > problem.
> > > The problem is easy to reproduce - go to a console, log in as root, do
> > an
> > > "su -" (this will succeed) and then another "su -". The second "su -"
> > > should hang - ps shows it started bash and that the bash process is
> > > sleeping. You need to "kill -9" the bash to get your prompt back.
> >
> > No problem here.
> >
> > P233MMX
> >
> > # uname -a
> > Linux kufel 2.4.3-ac12 #2 nie kwi 22 15:32:51 CEST 2001 i586 unknown
> >
> > # ls -l /lib/libc-*
> > -rwxr-xr-x 1 root root 1060168 Nov 19 11:17 /lib/libc-2.1.3.so
> >
> > # gcc --version
> > egcs-2.91.66
> > (kernel with the fix by Niels Kristian Bech Jensen <[email protected]>)
> >
> > # su --version
> > su (GNU sh-utils) 2.0
> >
> > Maybe it is RH7 specyfic ? Or you have some compiler / hardware problem ?
> >
> > Andrzej
>
> Did you try nesting more than one "su -"? The first one after a boot works
> for me - every other one fails.

I've tried three levels.
But my systsem is based on RH6.x

> I'm on RH71 - this may be specific to this release. It's also
> kernel-dependent, I can reboot with ac5 and the problem does not happen.
> The kernel is compiled with the same compiler as yours.
>
> My libc is 2.2.2 while yours is 2.1.3 - this may be the difference.

Andrzej

2001-04-23 15:55:53

by Bill Nottingham

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

Alan Cox ([email protected]) said:
> > > Did you try nesting more than one "su -"? The first one after a boot
> > > works for me - every other one fails.
> >
> > Same here: the first "su -" works OK, but a second nested one hangs:
>
> It appears to be a bug in PAM. Someone seems to reply on parent/child running
> order and just got caught out

I'm not so sure; this hang is already after all the authentication is
done.

Bill

2001-04-23 16:04:33

by Lukasz Trabinski

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

In article <[email protected]> you wrote:
> I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the
> problem.
> The problem is easy to reproduce - go to a console, log in as root, do an
> "su -" (this will succeed) and then another "su -". The second "su -"
> should hang - ps shows it started bash and that the bash process is
> sleeping. You need to "kill -9" the bash to get your prompt back.

> Distribution is Red Hat 7.1, running on an Athlon Thunderbird 900MHz on a
> MSI K7T Turbo R motherboard.

I have tested it on 2.4.4pre6, here is result:

[root@lt /root]# su - test

[root@lt /root]# ps xaf
1372 tty1 S 0:00 login -- root
1373 tty1 S 0:00 \_ -bash
1819 tty1 S 0:00 \_ su - test
1820 tty1 S 0:00 \_ -bash
1846 tty1 T 0:00 \_ stty erase ?


Last 10 lines from gdb su

Loaded symbols for /lib/security/pam_env.so
Reading symbols from /lib/security/pam_unix.so...done.
Loaded symbols for /lib/security/pam_unix.so
Reading symbols from /lib/security/pam_cracklib.so...done.
Loaded symbols for /lib/security/pam_cracklib.so
Reading symbols from /usr/lib/libcrack.so.2...done.
Loaded symbols for /usr/lib/libcrack.so.2
Reading symbols from /lib/security/pam_limits.so...done.
Loaded symbols for /lib/security/pam_limits.so
0x401156c9 in __wait4 () from /lib/libc.so.6
(gdb)

but:

[lukasz@lt lukasz]$ su -
Password:
[root@lt /root]#

It's looks OK :)


[lukasz@lt lukasz]$ su --version
su (GNU sh-utils) 2.0

[lukasz@lt lukasz]$ bash --version
GNU bash, version 2.04.21(1)-release (i386-redhat-linux-gnu)
Copyright 1999 Free Software Foundation, Inc.

[lukasz@lt lukasz]$ stty --version
stty (GNU sh-utils) 2.0


Kernel 2.4.4-pre6, 2.2.2-10, 0.74-22 - RedHat 7.1
AMD-K6 300 Mhz,


--
*[ ?ukasz Tr?bi?ski ]*
SysAdmin @wsisiz.edu.pl

2001-04-23 16:14:44

by Lukasz Trabinski

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

In article <[email protected]> you wrote:


> Kernel 2.4.4-pre6, 2.2.2-10, 0.74-22 - RedHat 7.1

Little update to my last mail: glibc 2.2.2-10, PAM 0.74-22 - RedHat 7.1.


--
*[ ?ukasz Tr?bi?ski ]*
SysAdmin @wsisiz.edu.pl

2001-04-26 04:35:19

by linux-kernel

[permalink] [raw]
Subject: Re: Problem with "su -" and kernels 2.4.3-ac11 and higher

In article <[email protected]>,
Alan Cox <[email protected]> writes:
>> > Did you try nesting more than one "su -"? The first one after a boot
>> > works for me - every other one fails.
>>
>> Same here: the first "su -" works OK, but a second nested one hangs:
>
> It appears to be a bug in PAM. Someone seems to reply on parent/child running
> order and just got caught out
>

I once debugged a very simular sounding problem that I solved with
the following patch to login. It's a wild guess, but you could try if
it happens to solve it. If not it might at least be a hint of what has to
be done to su.
(the problem is that the extra process PAM keeps waiting is process leader)
(I don't have redhat, so I can't check if this is relevant here)

diff -ur util-linux-2.9x/login-utils/login.c util-linux-2.9x-ton/login-utils/login.c
--- util-linux-2.9x/login-utils/login.c Sun Sep 12 23:25:30 1999
+++ util-linux-2.9x-ton/login-utils/login.c Tue Sep 21 03:24:52 1999
@@ -1109,6 +1112,15 @@
exit(0);
}
/* child */
+
+ if (tcsetpgrp(0, getpid()) < 0)
+ fprintf(stderr,
+ _("login: could not become foreground process group: %s\n"),
+ strerror(errno));
+ if (setpgid(0, 0) < 0)
+ fprintf(stderr, _("login: could not become process leader: %s\n"),
+ strerror(errno));
+
#endif
signal(SIGINT, SIG_DFL);