From owner-svn-src-head@freebsd.org Wed Dec 6 02:05:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EF78E8BC98; Wed, 6 Dec 2017 02:05:22 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF807E030; Wed, 6 Dec 2017 02:05:22 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB625LQ2036355; Wed, 6 Dec 2017 02:05:21 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB625Lps036354; Wed, 6 Dec 2017 02:05:21 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201712060205.vB625Lps036354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 6 Dec 2017 02:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326611 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 326611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 02:05:22 -0000 Author: jhibbits Date: Wed Dec 6 02:05:21 2017 New Revision: 326611 URL: https://svnweb.freebsd.org/changeset/base/326611 Log: Use unsigned intptr_t type for framebuffer addresses Summary: Some architectures (powerpc Book-E) have a vm_paddr_t larger than intptr_t. Casting from the intptr_t to vm_paddr_t causes sign extension, leading to a potentially invalid address. This was seen when running X on a PowerPC P1022 machine, which mapped the backing framebuffer at 0xc1800000. When mmap()d by X, this yielded an invalid address of 0xffffffffc1800000, or, as the hardware would see it, 0xfc1800000. Reviewed By: ray Differential Revision: https://reviews.freebsd.org/D13332 Modified: head/sys/sys/fbio.h Modified: head/sys/sys/fbio.h ============================================================================== --- head/sys/sys/fbio.h Wed Dec 6 02:00:09 2017 (r326610) +++ head/sys/sys/fbio.h Wed Dec 6 02:05:21 2017 (r326611) @@ -136,8 +136,8 @@ struct fb_info { fb_leave_t *leave; fb_setblankmode_t *setblankmode; - intptr_t fb_pbase; /* For FB mmap. */ - intptr_t fb_vbase; /* if NULL, use fb_write/fb_read. */ + uintptr_t fb_pbase; /* For FB mmap. */ + uintptr_t fb_vbase; /* if NULL, use fb_write/fb_read. */ void *fb_priv; /* First argument for read/write. */ const char *fb_name; uint32_t fb_flags;