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