Index: lib/libc/secure/stack_protector.c =================================================================== --- lib/libc/secure/stack_protector.c +++ lib/libc/secure/stack_protector.c @@ -56,13 +56,19 @@ static const int mib[2] = { CTL_KERN, KERN_ARND }; size_t len; int error; + long tmp_stack_chk_guard[sizeof(__stack_chk_guard) / sizeof(__stack_chk_guard[0])]; if (__stack_chk_guard[0] != 0) return; - error = _elf_aux_info(AT_CANARY, __stack_chk_guard, - sizeof(__stack_chk_guard)); - if (error == 0 && __stack_chk_guard[0] != 0) + error = _elf_aux_info(AT_CANARY, tmp_stack_chk_guard, + sizeof(tmp_stack_chk_guard)); + if (error == 0 && tmp_stack_chk_guard[0] != 0) { + int idx; + for (idx = 0; idx < sizeof(__stack_chk_guard) / sizeof(__stack_chk_guard[0]); idx++) { + __stack_chk_guard[idx] = tmp_stack_chk_guard[idx]; + } return; + } len = sizeof(__stack_chk_guard); if (__sysctl(mib, nitems(mib), __stack_chk_guard, &len, NULL, 0) ==