From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 08:58:59 2012 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 54B90106564A; Fri, 27 Jan 2012 08:58:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43B2F8FC13; Fri, 27 Jan 2012 08:58:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0R8wxi6030722; Fri, 27 Jan 2012 08:58:59 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0R8wx09030720; Fri, 27 Jan 2012 08:58:59 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201270858.q0R8wx09030720@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 27 Jan 2012 08:58:59 +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: r230610 - head/sys/kern 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: Fri, 27 Jan 2012 08:58:59 -0000 Author: glebius Date: Fri Jan 27 08:58:58 2012 New Revision: 230610 URL: http://svn.freebsd.org/changeset/base/230610 Log: Fix size check, that prevents getting negative after casting to a signed type Reviewed by: bde Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Fri Jan 27 08:46:32 2012 (r230609) +++ head/sys/kern/vfs_aio.c Fri Jan 27 08:58:58 2012 (r230610) @@ -1553,7 +1553,7 @@ aio_aqueue(struct thread *td, struct aio } /* XXX: aio_nbytes is later casted to signed types. */ - if ((int)aiocbe->uaiocb.aio_nbytes < 0) { + if (aiocbe->uaiocb.aio_nbytes > INT_MAX) { uma_zfree(aiocb_zone, aiocbe); return (EINVAL); }