Add Propolice support

git-svn-id: svn://coreboot.org/openbios/openbios-devel@422 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2009-01-24 08:23:33 +00:00
parent 7a00116a9f
commit 037d00c9b5
3 changed files with 26 additions and 4 deletions

View File

@@ -38,10 +38,6 @@ CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prot
INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
AS_FLAGS := -Wa,-xarch=v9b -Wa,-64 -g
ifeq ($(shell uname), OpenBSD)
CFLAGS+= -fno-stack-protector
endif
#
# pre rules
#

View File

@@ -99,4 +99,9 @@ static inline unsigned char __toupper(unsigned char c) {
extern int errno_int;
// Propolice support
extern long __guard[8];
void __stack_smash_handler(const char *func, int damaged);
#endif /* _H_STRING */

View File

@@ -75,3 +75,24 @@ strtol( const char *nptr, char **endptr, int base )
return sum * sign;
}
// Propolice support
long __guard[8] = {
#ifdef CONFIG_BIG_ENDIAN
(0 << 24) | (0 << 16) | ('\n' << 8) | 255,
#else
(255 << 24) | ('\n' << 16) | (0 << 8) | 0,
#endif
0, 0, 0, 0, 0, 0, 0
};
void __stack_smash_handler(const char *func, int damaged)
{
printk("Propolice detected a stack smashing attack %x at function %s,"
" freezing\n", damaged, func);
// Freeze
// XXX: Disable interrupts?
for(;;)
;
}