Port-mips archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
"security/sudo" gets SIGBUS on Lemote Yeeloong (LOONGSON)
A freshly-built "security/sudo" from pkgsrc-HEAD (20160909) dies with
"Bus error" prior to any authentication attempt. Rebuilding with
debugging enabled and using 'su' to become root and run it under 'gdb'
reveals:
(gdb) run ls
Starting program: /usr/pkg/bin/sudo ls
Program received signal SIGBUS, Bus error.
[Switching to LWP 1]
0x783c0470 in init_defaults () at ./defaults.c:366
366 def_ignore_dot = true;
(gdb) bt
#0 0x783c0470 in init_defaults () at ./defaults.c:366
#1 0x783b8874 in sudoers_policy_init (info=0x7fff6b90, envp=0x7fff6d20)
at ./sudoers.c:171
#2 0x783b4a94 in sudoers_policy_open (version=<optimized out>,
conversation=<optimized out>, plugin_printf=<optimized out>,
settings=0x78438100, user_info=0x7840c080, envp=0x7fff6d20, args=0x0)
at ./policy.c:629
#3 0x10014cb4 in policy_open (plugin=0x1002e188 <policy_plugin>,
user_env=0x7fff6d20, user_info=0x7840c080, settings=<optimized out>)
at ./sudo.c:1209
#4 main (argc=<optimized out>, argv=<optimized out>, envp=0x7fff6d20)
at ./sudo.c:206
Afterward, 'gdb' hangs on exit or attempting to kill the 'sudo' process.
It can be killed with SIGKILL externally, but leaves the 'sudo' process
lying around.
This is on a stock installation (gcc 4.8.5) on local disk (SD card).
The last time a working 'sudo' was built was sudo-1.8.3p2 (from then
"wip/sudo") on 7.99.21:
/usr/pkg/bin/sudo: setuid ELF 32-bit LSB executable, MIPS, N32 MIPS-III version 1 (SYSV), dynamically linked (uses shared libs), for NetBSD 7.99.21, not stripped
(This particular binary was built on a local filesystem and the entire
"/usr/pkg" hierarchy was cloned via 'tar' pipeline to my NFS installation
where it continues to work properly with both gcc-48 and gcc-54 built
systems. Following 'pkg_tarup' of this 'sudo' installation, subsequent
installation of the package on the local disk (SD card) works properly.)
On a GCC 5.4-built system, the same problem occurs. Despite using the
same debugging switches (CFLAGS+=-ggdb CXXFLAGS+=-ggdb
INSTALL_UNSTRIPPED=yes), no additional debugging information could be
obtained. The session, with backtrace, amounted to:
(gdb) run ls
Starting program: /usr/pkg/bin/sudo ls
warning: GDB can't find the start of the function at 0x783cf6b4.
GDB is unable to find the start of the function at 0x783cf6b4
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
This problem is most likely caused by an invalid program counter or
stack pointer.
However, if you think GDB should simply search farther back
from 0x783cf6b4 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
Program received signal SIGBUS, Bus error.
[Switching to LWP 1]
0x783cf6b4 in ?? ()
(gdb) bt
#0 0x783cf6b4 in ?? ()
Likewise, attempting to quit 'gdb' or kill the 'sudo' process hangs
'gdb' which must be killed externally with SIGKILL and leaves the
dead 'sudo' process hanging around.
Installing the package for "sudo-1.8.3p2" built under 7.99.21 works
properly on the GCC 5.4-built system.
--
|/"\ John D. Baker, KN5UKS NetBSD Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]com OpenBSD FreeBSD
| X No HTML/proprietary data in email. BSD just sits there and works!
|/ \ GPGkeyID: D703 4A7E 479F 63F8 D3F4 BD99 9572 8F23 E4AD 1645
Home |
Main Index |
Thread Index |
Old Index