Adding Address Space Layout Randomization support for SSH binaries in AIX#613
Adding Address Space Layout Randomization support for SSH binaries in AIX#613AkankshaP15 wants to merge 3 commits intoopenssh:masterfrom
Conversation
daztucker
left a comment
There was a problem hiding this comment.
This will break any AIX systems using xlc whose linker doesn't support that flag, which will likely include a number where OpenSSH would otherwise work fine. Instead, could you please use the OSSH_CHECK_LDFLAG_LINK macro to only add it if the linker supports it?
|
also, you placed it inside a configure test that's for a completely different purpose. Given that it's a linker flag, does it work with alternative compilers such as gcc or clang on those systems? Either way I think it should be its own stand-alone test, not inside AC_MSG_CHECKING([if compiler allows macro redefinitions]). |
|
I have updated configure.ac in the latest commit. Below are the test scenarios executed for the
|
|
@daztucker, Please let me know if there are any comments. |
configure.ac
Outdated
| dnl Check whether the linker accepts -baslr | ||
| OSSH_CHECK_LDFLAG_LINK([-baslr]) | ||
|
|
||
| AC_MSG_CHECKING([whether linker supports -baslr]) |
There was a problem hiding this comment.
this part is unnecessary, since OSSH_CHECK_LDFLAG_LINK already provides all of this information in its output, and adds it to LDFLAGS if it's supported (see m4/openssh.m4).
| fi | ||
| LDFLAGS="$saved_LDFLAGS" | ||
|
|
||
| AC_ARG_WITH([baslr], |
There was a problem hiding this comment.
is there any reason this can't be part of the rest of the use_toolchain_hardening --with-hardening flags and be on by default when supported?
There was a problem hiding this comment.
-baslr is linker/loader specific option for AIX (similar to pie for other OS). Hence, we are handling it under aix target specific case instead.
Since the existing code is built without ASLR, we wish to keep this behavior as is and enable it when explicitly specified.
There was a problem hiding this comment.
-baslr is linker/loader specific option for AIX (similar to pie for other OS). Hence, we are handling it under aix target specific case instead.
If it's not supported, the OSSH_CHECK_LDFLAG_LINK check will fail and the flag won't be added.
Since the existing code is built without ASLR, we wish to keep this behavior as is and enable it when explicitly specified.
Why? What's the point of having a security feature that's off by default? Now if it was problematic or very slow that might be a good reason, but is it?
|
I have updated configure.ac in the latest commit to drop redundant -baslr linker check. |
Adding Address Space Layout Randomization support for SSH binaries in AIX to enhance security against memory-based attacks.
This feature is designed to improve security by loading shared memory objects at random addresses instead of fixed addresses.