Date: Wed, 6 Dec 2017 02:05:21 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326611 - head/sys/sys Message-ID: <201712060205.vB625Lps036354@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712060205.vB625Lps036354>