From owner-svn-src-all@FreeBSD.ORG Mon Dec 1 22:33:50 2008 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 E060C1065670; Mon, 1 Dec 2008 22:33:50 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D34B58FC16; Mon, 1 Dec 2008 22:33:50 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB1MXor1039187; Mon, 1 Dec 2008 22:33:50 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB1MXojv039186; Mon, 1 Dec 2008 22:33:50 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200812012233.mB1MXojv039186@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 1 Dec 2008 22:33:50 +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: r185533 - 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: Mon, 01 Dec 2008 22:33:51 -0000 Author: kan Date: Mon Dec 1 22:33:50 2008 New Revision: 185533 URL: http://svn.freebsd.org/changeset/base/185533 Log: Shared memory objects that have size which is not necessarily equal to exact multiple of system page size should still be allowed to be mapped in their entirety to match the regular vnode backed file behavior. Reported by: ed Reviewed by: jhb Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Mon Dec 1 21:15:04 2008 (r185532) +++ head/sys/kern/uipc_shm.c Mon Dec 1 22:33:50 2008 (r185533) @@ -605,7 +605,8 @@ shm_mmap(struct shmfd *shmfd, vm_size_t * XXXRW: This validation is probably insufficient, and subject to * sign errors. It should be fixed. */ - if (foff >= shmfd->shm_size || foff + objsize > shmfd->shm_size) + if (foff >= shmfd->shm_size || + foff + objsize > round_page(shmfd->shm_size)) return (EINVAL); mtx_lock(&shm_timestamp_lock);