if you get SIGSEGV - most likely we have some memory ocrruption - so catching this signal, flushing the log and then returning (letting the process continue execution) is a big no-no.
Signed-off-by: guy keren <c...@actcom.co.il> --guy -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To post to this group, send email to open-is...@googlegroups.com. To unsubscribe from this group, send email to open-iscsi+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/open-iscsi?hl=.
[PATCH 3/3] do NOT perform illegal operations in a SIGSEGV handler if you get SIGSEGV - most likely we have some memory ocrruption - so catching this signal, flushing the log and then returning (letting the process continue execution) is a big no-no. Signed-off-by: guy keren <c...@actcom.co.il> --- usr/log.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/usr/log.c b/usr/log.c index 908aac1..d9a5af7 100644 --- a/usr/log.c +++ b/usr/log.c @@ -376,9 +376,6 @@ static void log_flush(void) static void catch_signal(int signo) { switch (signo) { - case SIGSEGV: - log_flush(); - break; case SIGTERM: log_stop_daemon = 1; break; @@ -430,7 +427,6 @@ int log_init(char *program_name, int size) sa_new.sa_handler = (void*)catch_signal; sigemptyset(&sa_new.sa_mask); sa_new.sa_flags = 0; - sigaction(SIGSEGV, &sa_new, &sa_old ); sigaction(SIGTERM, &sa_new, &sa_old ); while(1) { -- 1.6.3.3