From owner-svn-src-projects@FreeBSD.ORG Thu Sep 23 15:10:28 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85404106564A; Thu, 23 Sep 2010 15:10:28 +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 7531C8FC14; Thu, 23 Sep 2010 15:10:28 +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 o8NFASE5072639; Thu, 23 Sep 2010 15:10:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NFASc2072637; Thu, 23 Sep 2010 15:10:28 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009231510.o8NFASc2072637@svn.freebsd.org> From: Attilio Rao Date: Thu, 23 Sep 2010 15:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213076 - projects/sv/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 15:10:28 -0000 Author: attilio Date: Thu Sep 23 15:10:28 2010 New Revision: 213076 URL: http://svn.freebsd.org/changeset/base/213076 Log: Fix a protection stub left-over in r212295. Modified: projects/sv/sys/kern/kern_shutdown.c Modified: projects/sv/sys/kern/kern_shutdown.c ============================================================================== --- projects/sv/sys/kern/kern_shutdown.c Thu Sep 23 14:06:15 2010 (r213075) +++ projects/sv/sys/kern/kern_shutdown.c Thu Sep 23 15:10:28 2010 (r213076) @@ -686,7 +686,9 @@ dump_write(struct dumperinfo *di, void * off_t offset, size_t length) { - if (length != 0 && (offset < di->mediaoffset || + /* If the upper bound is 0, dumper likely will not use disks. */ + if ((di->mediaoffset + di->mediasize) != 0 && length != 0 && + (offset < di->mediaoffset || offset - di->mediaoffset + length > di->mediasize)) { printf("Attempt to write outside dump device boundaries.\n"); return (ENXIO);