From owner-svn-src-all@FreeBSD.ORG Sat Nov 7 21:46:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 913DD1065670; Sat, 7 Nov 2009 21:46:34 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF338FC0C; Sat, 7 Nov 2009 21:46:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA7LkYR3064302; Sat, 7 Nov 2009 21:46:34 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA7LkYAr064300; Sat, 7 Nov 2009 21:46:34 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911072146.nA7LkYAr064300@svn.freebsd.org> From: Attilio Rao Date: Sat, 7 Nov 2009 21:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199024 - head/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Nov 2009 21:46:34 -0000 Author: attilio Date: Sat Nov 7 21:46:34 2009 New Revision: 199024 URL: http://svn.freebsd.org/changeset/base/199024 Log: Use a safety belt for cases where corrupted narg can be passed to the ktrsyscall(). print_number() does decrement the number of arguments, leading to infinite loops for negative values. Reported by: Patrick Lamaiziere , Jonathan Pascal Submitted by: jh PR: bin/120055, kern/119564 MFC: 1 week Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sat Nov 7 21:28:21 2009 (r199023) +++ head/usr.bin/kdump/kdump.c Sat Nov 7 21:46:34 2009 (r199024) @@ -799,7 +799,7 @@ ktrsyscall(struct ktr_syscall *ktr) narg--; } } - while (narg) { + while (narg > 0) { print_number(ip,narg,c); } (void)putchar(')');