[Bug 3441] Build openssh with sanitizer flags enabled

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Sat Jun 4 20:16:48 AEST 2022


https://bugzilla.mindrot.org/show_bug.cgi?id=3441

--- Comment #5 from Darren Tucker <dtucker at dtucker.net> ---
Th(In reply to Dmitry Belyavskiy from comment #4)
> See also https://bugzilla.redhat.com/show_bug.cgi?id=2070137

I split out the rlimit+select check before I read that bug but got the
same result:

$ ./a.out 
==2109378==Can't open /proc/2109377/task for reading.
==2109377==LeakSanitizer has encountered a fatal error.
==2109377==HINT: For debugging, try setting environment variable
LSAN_OPTIONS=verbosity=1:log_threads=1
==2109377==HINT: LeakSanitizer does not work under ptrace (strace, gdb,
etc)

You can work around that by skipping the rlimit+select check if
--without-sandbox is set, which gets to the dlsym problem:

usr/bin/ld: ./libssh.a(ssh-pkcs11.o): undefined reference to symbol
'dlsym@@GLIBC_2.2.5'
//usr/lib64/libdl.so.2: error adding symbols: DSO missing from command
line
collect2: error: ld returned 1 exit status

which you can work around by disabling the things that need dlsym
("--disable-security-key --disable-pkcs11") which brings us to the
final problem: the leak checker in the preauth privsep process can't
open /proc because that process is in a chroot and fails when the
process exits: 

$ sudo `pwd`/sshd -ddde -p 2022
[...]
debug3: mm_send_keystate: Finished sending state [preauth]
==2194517==Can't open /proc/2194515/task for reading.
==2194515==LeakSanitizer has encountered a fatal error.
==2194515==HINT: For debugging, try setting environment variable
LSAN_OPTIONS=verbosity=1:log_threads=1
==2194515==HINT: LeakSanitizer does not work under ptrace (strace, gdb,
etc)

This one is a dealbreaker as long as the leak checker needs access to
/proc since privsep is required.  You could try hacking the code to
disable privsep for testing purposes but be aware that's now an
untested and unsupported configuration.

-- 
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list