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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to