openssh 3.7p1 sshd on Solaris 8 / sparcv9:
sshd runs fine, and starts to allow the login. However, when reading
from /etc/default/login, I get a bus error. I am able to get sshd to
work by commenting out these lines in session.c:
1015,1018c1015
< # ifdef HAVE_ETC_DEFAULT_LOGIN
< read_etc_default_login(&env, &envsize,
pw->pw_uid);
< path = child_get_env(env, "PATH");
< # endif /* HAVE_ETC_DEFAULT_LOGIN */
Here is an truss of the failure:
1904: open("/etc/default/login", O_RDONLY) = 7
1904: fstat(7, 0xFFFFFFFF7FFFD7F0) = 0
1904: ioctl(7, TCGETA, 0xFFFFFFFF7FFFD72C) Err#25 ENOTTY
1904: read(7, " # i d e n t\t " @ ( #".., 8192) = 2042
1904: read(7, 0x1001D23B4, 8192) = 0
1904: lseek(7, 0, SEEK_CUR) = 2042
1904: close(7) = 0
1904: Incurred fault #5, FLTACCESS %pc = 0xFFFFFFFF7E299934
1904: siginfo: SIGBUS BUS_ADRALN addr=0xFFFFFFFF7FFFEA9C
1904: Received signal #10, SIGBUS [default]
1904: siginfo: SIGBUS BUS_ADRALN addr=0xFFFFFFFF7FFFEA9C
1904: *** process killed ***
1900: Received signal #18, SIGCLD [caught]
1900: siginfo: SIGCLD CLD_KILLED pid=1904 status=0x000A
1900: sigaction(SIGCLD, 0x00000000, 0xFFFFFFFF7FFFE950) = 0
1900: write(4, "\0", 1) = 1
1900: setcontext(0xFFFFFFFF7FFFEBD0)
1900: close(8) = 0
1900: dup(7) = 8
1900: dup(7) = 9
The problem seems to be that read_etc_default_login() assumes that a
u_int (unsigned int) is the same size as a size_t. This is true in
sparcv7, but not in sparcv9:
jparsons at sparc64:~# cat test.c
#include <stdio.h>
int main() {
int n;
size_t size;
unsigned int uint;
printf ("size_t: %d, u_int: %d\n", sizeof(size), sizeof(uint));
}
jparsons at sparc64:~# gcc -v
Reading specs from
/usr/local/lib/gcc-lib/sparc64-sun-solaris2.8/3.3/specs
Configured with: ../gcc-3.3/configure --enable-threads=posix
--enable-shared --build=sparc64-sun-solaris2.8
--host=sparc64-sun-solaris2.8 --enable-languages=c,c++,f77,objc
Thread model: posix
gcc version 3.3
jparsons at sparc64:~# gcc -o test ./test.c
jparsons at sparc64:~# ./test
size_t: 8, u_int: 4
jparsons at sparc:~# gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.3/specs
Configured with: ../gcc-3.3/configure --host=sparc-sun-solaris2.8
--enable-threads=posix --enable-shared --enable-languages=c,c++,f77,objc
Thread model: posix
gcc version 3.3
jparsons at sparc:~# ./test
size_t: 4, u_int: 4
I imagine this effects other 64-bit platforms as well.
- Jason Parsons
--
Saffron Solutions, LLC <http://www.saffron.net>
System, Network, and Security Consulting
E-Commerce, Web Site, and E-Mail Hosting
Jason Parsons wrote:> > openssh 3.7p1 sshd on Solaris 8 / sparcv9: > > sshd runs fine, and starts to allow the login. However, when reading > from /etc/default/login, I get a bus error. I am able to get sshd to > work by commenting out these lines in session.c:[snip]> The problem seems to be that read_etc_default_login() assumes that a > u_int (unsigned int) is the same size as a size_t. This is true in > sparcv7, but not in sparcv9:Damn, I tested it on a sun4m. Does the attached patch fix it? -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement. -------------- next part -------------- Index: session.c ==================================================================RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/session.c,v retrieving revision 1.253 diff -u -p -r1.253 session.c --- session.c 16 Sep 2003 01:52:19 -0000 1.253 +++ session.c 16 Sep 2003 23:36:08 -0000 @@ -912,8 +912,7 @@ static void read_etc_default_login(char ***env, u_int *envsize, uid_t uid) { char **tmpenv = NULL, *var; - u_int i; - size_t tmpenvsize = 0; + u_int i, tmpenvsize = 0; mode_t mask; /*
> Damn, I tested it on a sun4m. Does the attached patch fix it?It seems to. Thank you. - Jason Parsons> RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/session.c,v > retrieving revision 1.253 > diff -u -p -r1.253 session.c > --- session.c 16 Sep 2003 01:52:19 -0000 1.253 > +++ session.c 16 Sep 2003 23:36:08 -0000 > @@ -912,8 +912,7 @@ static void > read_etc_default_login(char ***env, u_int *envsize, uid_t uid) > { > char **tmpenv = NULL, *var; > - u_int i; > - size_t tmpenvsize = 0; > + u_int i, tmpenvsize = 0; > mode_t mask; > > /*
Possibly Parallel Threads
- Fwd: Re: Bus Error with OpenSSH 3.7.1p2 on Solaris 8, SPARC 64-bit, YASSP
- Bus Error with OpenSSH 3.7.1p2 on Solaris 8, SPARC 64-bit, YASSP
- openssh 3.7.1p2 fault on solaris 9 for sparc when built as 64-bit
- Problem with enabling /etc/default(s)/login on Cygwin
- Bus Error with openssh 3.7.1p1 on 64-bit Sparc/Solaris