diff options
author | Kevin F. Quinn <kevquinn@gentoo.org> | 2006-11-28 18:52:04 +0000 |
---|---|---|
committer | Kevin F. Quinn <kevquinn@gentoo.org> | 2006-11-28 18:52:04 +0000 |
commit | bc634c87efabaddcbef8ef63b7b58674ecaf43b3 (patch) | |
tree | 7b021f7fbe95412da0176524b3982836ff798999 | |
parent | Tidyup (diff) | |
download | kevquinn-bc634c87efabaddcbef8ef63b7b58674ecaf43b3.tar.gz kevquinn-bc634c87efabaddcbef8ef63b7b58674ecaf43b3.tar.bz2 kevquinn-bc634c87efabaddcbef8ef63b7b58674ecaf43b3.zip |
Use syscall instead of sigaction(), __sigfillset() macro instead of sigfillset() to eliminate calls
svn path=/; revision=61
-rw-r--r-- | hardened/toolchain/sys-libs/glibc/Manifest | 8 | ||||
-rw-r--r-- | hardened/toolchain/sys-libs/glibc/files/2.4/glibc-2.4-gentoo-stack_chk_fail.c | 22 |
2 files changed, 16 insertions, 14 deletions
diff --git a/hardened/toolchain/sys-libs/glibc/Manifest b/hardened/toolchain/sys-libs/glibc/Manifest index 9d2759b..1c8c921 100644 --- a/hardened/toolchain/sys-libs/glibc/Manifest +++ b/hardened/toolchain/sys-libs/glibc/Manifest @@ -6,10 +6,10 @@ AUX 2.3.6/host.conf 937 RMD160 8e5e0f24d65fa744c3d182344808766609cb2619 SHA1 101 MD5 394baa59e2aac7cbc649a77f386c000d files/2.3.6/host.conf 937 RMD160 8e5e0f24d65fa744c3d182344808766609cb2619 files/2.3.6/host.conf 937 SHA256 0d30aa973b76d6b2c1bc947046978bd0a6f61d7aaf495caf361d14d16a932348 files/2.3.6/host.conf 937 -AUX 2.4/glibc-2.4-gentoo-stack_chk_fail.c 9585 RMD160 3a175e7f216c2941904c550348ac9b2c2d991711 SHA1 33cc8877bb85f806110269d8638d0cb73a304dbc SHA256 8a47104f5ae8277b866ac41b8e8ba6819491236ee8ef9458d8bfe01ed4f389c6 -MD5 ec3c61e5382f57cfe79ddaaaca544d5d files/2.4/glibc-2.4-gentoo-stack_chk_fail.c 9585 -RMD160 3a175e7f216c2941904c550348ac9b2c2d991711 files/2.4/glibc-2.4-gentoo-stack_chk_fail.c 9585 -SHA256 8a47104f5ae8277b866ac41b8e8ba6819491236ee8ef9458d8bfe01ed4f389c6 files/2.4/glibc-2.4-gentoo-stack_chk_fail.c 9585 +AUX 2.4/glibc-2.4-gentoo-stack_chk_fail.c 9841 RMD160 af71063e4a30556ba947dcfd7be9afb386653b0d SHA1 3d66a2811a0e20a8ebe8a4538dcbfbc5bd0411c6 SHA256 1aafd057aaaf59bbbf956f7561983435e565f92b71aba9ad73bbe2f60e9a241e +MD5 6e5e24833e13738a86c32877aef93b2f files/2.4/glibc-2.4-gentoo-stack_chk_fail.c 9841 +RMD160 af71063e4a30556ba947dcfd7be9afb386653b0d files/2.4/glibc-2.4-gentoo-stack_chk_fail.c 9841 +SHA256 1aafd057aaaf59bbbf956f7561983435e565f92b71aba9ad73bbe2f60e9a241e files/2.4/glibc-2.4-gentoo-stack_chk_fail.c 9841 AUX 2.4/glibc-2.4-hardened-linux-ssp.patch 480 RMD160 848555a0540993a41ef3821e821bc33bc1d8f760 SHA1 9a2a32429b83b5db7ba77b623aba500ea5b72819 SHA256 9ac4d8dcc3b2784f0ef62485ebe45ae67afe23be25735b28e80d7b543033175e MD5 43a30832a8f6024df02a21494ac96dbf files/2.4/glibc-2.4-hardened-linux-ssp.patch 480 RMD160 848555a0540993a41ef3821e821bc33bc1d8f760 files/2.4/glibc-2.4-hardened-linux-ssp.patch 480 diff --git a/hardened/toolchain/sys-libs/glibc/files/2.4/glibc-2.4-gentoo-stack_chk_fail.c b/hardened/toolchain/sys-libs/glibc/files/2.4/glibc-2.4-gentoo-stack_chk_fail.c index c3bac67..cf3713d 100644 --- a/hardened/toolchain/sys-libs/glibc/files/2.4/glibc-2.4-gentoo-stack_chk_fail.c +++ b/hardened/toolchain/sys-libs/glibc/files/2.4/glibc-2.4-gentoo-stack_chk_fail.c @@ -100,6 +100,10 @@ static inline _syscall2(int,stack_chk_fail_kill, pid_t,pid, int,sig); static inline pid_t stack_chk_fail_getpid(void) __attribute__ ((always_inline)); static inline _syscall0(pid_t,stack_chk_fail_getpid); +#define __NR_stack_chk_fail_sigaction __NR_sigaction +static inline int stack_chk_fail_sigaction(int signum, struct sigaction *act, struct sigaction *oldact) __attribute__ ((always_inline)); +static inline _syscall3(int,stack_chk_fail_sigaction, int,signum, struct sigaction *,act, struct sigaction *,oldact); + #ifndef __dietlibc__ #define __NR_stack_chk_fail_close __NR_close @@ -108,7 +112,7 @@ static inline _syscall1(int,stack_chk_fail_close, int,fd); /* socketcall is present on most arches (including x86, arm (some), ppc, ppc64, mips, mips64, sparc, sparc64) - * x86_86 and some arm do not have it, but does have socket and connect syscalls + * x86_86 and some arm do not have it, but do have socket and connect syscalls * Assume this when socketcall is not available. */ #ifdef __NR_socketcall @@ -201,7 +205,6 @@ __stack_chk_fail (void) const char msg_suffix[]=" terminated\n"; const char msg_unknown[]="<unknown>"; #ifdef SSP_DUMP_CORE - sigset_t fullsigset; struct sigaction default_abort_act; #endif #ifndef __dietlibc__ @@ -219,6 +222,7 @@ __stack_chk_fail (void) i++;\ }\ plen+=i; + plen=0; strconcat(msg_prefix); if (__progname != (char *)0) { @@ -272,14 +276,12 @@ __stack_chk_fail (void) pid=stack_chk_fail_getpid(); #ifdef SSP_DUMP_CORE /* Remove user-supplied handlers for SIGABRT, before using it */ - if (sigfillset(&fullsigset) == 0) { - default_abort_act.sa_handler = SIG_DFL; - default_abort_act.sa_sigaction = NULL; - default_abort_act.sa_mask = fullsigset; - default_abort_act.sa_flags = 0; - if (sigaction(SIGABRT,&default_abort_act,NULL) == 0) { - stack_chk_fail_kill(pid,SIGABRT); - } + default_abort_act.sa_handler = SIG_DFL; + default_abort_act.sa_sigaction = NULL; + __sigfillset(&default_abort_act.sa_mask); + default_abort_act.sa_flags = 0; + if (stack_chk_fail_sigaction(SIGABRT,&default_abort_act,NULL) == 0) { + stack_chk_fail_kill(pid,SIGABRT); } #endif /* Note; actions cannot be added to SIGKILL */ |