From e016103fa25167594b9ff5d410019f114b7a36fb Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 23 May 2009 15:14:45 +0200 Subject: New upstream release 15.7a, fixing CVE-2009-0148 --- src/display.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'src/display.c') diff --git a/src/display.c b/src/display.c index 7ef03cb..2af0e6c 100644 --- a/src/display.c +++ b/src/display.c @@ -62,7 +62,7 @@ typedef jmp_buf sigjmp_buf; #endif -static char const rcsid[] = "$Id: display.c,v 1.29 2006/08/20 15:00:34 broeker Exp $"; +static char const rcsid[] = "$Id: display.c,v 1.30 2009/04/10 13:39:23 broeker Exp $"; int booklen; /* OGS book name display field length */ int *displine; /* screen line of displayed reference */ @@ -478,20 +478,20 @@ search(void) /* see if it is empty */ if ((c = getc(refsfound)) == EOF) { if (findresult != NULL) { - (void) sprintf(lastmsg, "Egrep %s in this pattern: %s", + (void) snprintf(lastmsg, sizeof(lastmsg), "Egrep %s in this pattern: %s", findresult, Pattern); } else if (rc == NOTSYMBOL) { - (void) sprintf(lastmsg, "This is not a C symbol: %s", + (void) snprintf(lastmsg, sizeof(lastmsg), "This is not a C symbol: %s", Pattern); } else if (rc == REGCMPERROR) { - (void) sprintf(lastmsg, "Error in this regcomp(3) regular expression: %s", + (void) snprintf(lastmsg, sizeof(lastmsg), "Error in this regcomp(3) regular expression: %s", Pattern); } else if (funcexist == NO) { - (void) sprintf(lastmsg, "Function definition does not exist: %s", + (void) snprintf(lastmsg, sizeof(lastmsg), "Function definition does not exist: %s", Pattern); } else { - (void) sprintf(lastmsg, "Could not find the %s: %s", + (void) snprintf(lastmsg, sizeof(lastmsg), "Could not find the %s: %s", fields[field].text2, Pattern); } return(NO); @@ -527,17 +527,17 @@ progress(char *what, long current, long max) move(MSGLINE, 0); clrtoeol(); addstr(what); - sprintf(msg, "%ld", current); + snprintf(msg, sizeof(msg), "%ld", current); move(MSGLINE, (COLS / 2) - (strlen(msg) / 2)); addstr(msg); - sprintf(msg, "%ld", max); + snprintf(msg, sizeof(msg), "%ld", max); move(MSGLINE, COLS - strlen(msg)); addstr(msg); refresh(); } else if (verbosemode == YES) { - sprintf(msg, "> %s %ld of %ld", what, current, max); + snprintf(msg, sizeof(msg), "> %s %ld of %ld", what, current, max); } start = now; @@ -575,7 +575,7 @@ myperror(char *text) s = sys_errlist[errno]; } #endif - (void) sprintf(msg, "%s: %s", text, s); + (void) snprintf(msg, sizeof(msg), "%s: %s", text, s); postmsg(msg); } @@ -647,11 +647,7 @@ posterr(char *msg, ...) (void) vfprintf(stderr, msg, ap); (void) fputc('\n', stderr); } else { -#if HAVE_VSNPRINTF vsnprintf(errbuf, sizeof(errbuf), msg, ap); -#else - vsprintf(errbuf, msg, ap); -#endif postmsg2(errbuf); } } @@ -664,11 +660,7 @@ postfatal(const char *msg, ...) char errbuf[MSGLEN]; va_start(ap, msg); -#if HAVE_VSNPRINTF vsnprintf(errbuf, sizeof(errbuf), msg, ap); -#else - vsprintf(errbuf, msg, ap); -#endif /* restore the terminal to its original mode */ if (incurses == YES) { exitcurses(); -- cgit v1.2.3-54-g00ecf 9234c959b0b82b63fa252c129225a899'>kobject.txt
diff options
context:
space:
mode:
authorWanpeng Li <wanpeng.li@hotmail.com>2016-09-02 14:38:23 +0800
committerThomas Gleixner <tglx@linutronix.de>2016-09-02 10:25:40 +0200
commit08d072599234c959b0b82b63fa252c129225a899 (patch)
tree7e39e250570300bc66e42d922fa80327aaf1e573 /Documentation/kobject.txt
parent98744b408c757901df57fa50cbd5826245dc3a1f (diff)
tick/nohz: Fix softlockup on scheduler stalls in kvm guest
tick_nohz_start_idle() is prevented to be called if the idle tick can't be stopped since commit 1f3b0f8243cb934 ("tick/nohz: Optimize nohz idle enter"). As a result, after suspend/resume the host machine, full dynticks kvm guest will softlockup: NMI watchdog: BUG: soft lockup - CPU#0 stuck for 26s! [swapper/0:0] Call Trace: default_idle+0x31/0x1a0 arch_cpu_idle+0xf/0x20 default_idle_call+0x2a/0x50 cpu_startup_entry+0x39b/0x4d0 rest_init+0x138/0x140 ? rest_init+0x5/0x140 start_kernel+0x4c1/0x4ce ? set_init_arg+0x55/0x55 ? early_idt_handler_array+0x120/0x120 x86_64_start_reservations+0x24/0x26 x86_64_start_kernel+0x142/0x14f In addition, cat /proc/stat | grep cpu in guest or host: cpu 398 16 5049 15754 5490 0 1 46 0 0 cpu0 206 5 450 0 0 0 1 14 0 0 cpu1 81 0 3937 3149 1514 0 0 9 0 0 cpu2 45 6 332 6052 2243 0 0 11 0 0 cpu3 65 2 328 6552 1732 0 0 11 0 0 The idle and iowait states are weird 0 for cpu0(housekeeping). The bug is present in both guest and host kernels, and they both have cpu0's idle and iowait states issue, however, host kernel's suspend/resume path etc will touch watchdog to avoid the softlockup. - The watchdog will not be touched in tick_nohz_stop_idle path (need be touched since the scheduler stall is expected) if idle_active flags are not detected. - The idle and iowait states will not be accounted when exit idle loop (resched or interrupt) if idle start time and idle_active flags are not set. This patch fixes it by reverting commit 1f3b0f8243cb934 since can't stop idle tick doesn't mean can't be idle. Fixes: 1f3b0f8243cb934 ("tick/nohz: Optimize nohz idle enter") Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Cc: Sanjeev Yadav<sanjeev.yadav@spreadtrum.com> Cc: Gaurav Jindal<gaurav.jindal@spreadtrum.com> Cc: stable@vger.kernel.org Cc: kvm@vger.kernel.org Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Link: http://lkml.kernel.org/r/1472798303-4154-1-git-send-email-wanpeng.li@hotmail.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'Documentation/kobject.txt')