Hi!

Do you plan to MFC this change to 10-STABLE?

On Thu, Aug 4, 2016 at 7:55 PM, John Baldwin <j...@freebsd.org> wrote:
> Author: jhb
> Date: Thu Aug  4 17:55:23 2016
> New Revision: 303753
> URL: https://svnweb.freebsd.org/changeset/base/303753
>
> Log:
>   Don't permit mappings of invalid physical addresses on amd64 via /dev/mem.
>
>   Discussed with:       kib
>
> Modified:
>   head/sys/amd64/amd64/mem.c
>
> Modified: head/sys/amd64/amd64/mem.c
> ==============================================================================
> --- head/sys/amd64/amd64/mem.c  Thu Aug  4 17:46:07 2016        (r303752)
> +++ head/sys/amd64/amd64/mem.c  Thu Aug  4 17:55:23 2016        (r303753)
> @@ -168,9 +168,11 @@ int
>  memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
>      int prot __unused, vm_memattr_t *memattr __unused)
>  {
> -       if (dev2unit(dev) == CDEV_MINOR_MEM)
> +       if (dev2unit(dev) == CDEV_MINOR_MEM) {
> +               if (offset >= (1ULL << cpu_maxphyaddr))
> +                       return (-1);
>                 *paddr = offset;
> -       else if (dev2unit(dev) == CDEV_MINOR_KMEM)
> +       } else if (dev2unit(dev) == CDEV_MINOR_KMEM)
>                 *paddr = vtophys(offset);
>         /* else panic! */
>         return (0);
> _______________________________________________
> 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"
_______________________________________________
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