mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 16:47:18 +02:00
DEBUG: add a tainted flag when ha_panic() is called
This will make it easier to know that the panic function was called, for the occasional case where the dump crashes and/or the stack is corrupted and not much exploitable. Now at least it will be sufficient to check the tainted value to know that someone called ha_panic(), and it will also be usable to condition extra analysis.
This commit is contained in:
parent
1822e8998b
commit
46bbb3a33b
@ -248,6 +248,7 @@ enum tainted_flags {
|
|||||||
TAINTED_SHARED_LIBS = 0x00000040, /* a shared library was loaded */
|
TAINTED_SHARED_LIBS = 0x00000040, /* a shared library was loaded */
|
||||||
TAINTED_REDEFINITION = 0x00000080, /* symbol redefinition detected */
|
TAINTED_REDEFINITION = 0x00000080, /* symbol redefinition detected */
|
||||||
TAINTED_REPLACED_MEM_ALLOCATOR = 0x00000100, /* memory allocator was replaced using LD_PRELOAD */
|
TAINTED_REPLACED_MEM_ALLOCATOR = 0x00000100, /* memory allocator was replaced using LD_PRELOAD */
|
||||||
|
TAINTED_PANIC = 0x00000200, /* a panic dump has started */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* this is a bit field made of TAINTED_*, and is declared in haproxy.c */
|
/* this is a bit field made of TAINTED_*, and is declared in haproxy.c */
|
||||||
|
@ -415,6 +415,8 @@ void ha_panic()
|
|||||||
struct buffer *old;
|
struct buffer *old;
|
||||||
unsigned int thr;
|
unsigned int thr;
|
||||||
|
|
||||||
|
mark_tainted(TAINTED_PANIC);
|
||||||
|
|
||||||
old = NULL;
|
old = NULL;
|
||||||
if (!HA_ATOMIC_CAS(&thread_dump_buffer, &old, get_trash_chunk())) {
|
if (!HA_ATOMIC_CAS(&thread_dump_buffer, &old, get_trash_chunk())) {
|
||||||
/* a panic dump is already in progress, let's not disturb it,
|
/* a panic dump is already in progress, let's not disturb it,
|
||||||
|
Loading…
Reference in New Issue
Block a user