Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Sep 2016 19:58:37 +0200
From:      Oliver Pinter <oliver.pinter@hardenedbsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>,  "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r303753 - head/sys/amd64/amd64
Message-ID:  <CAPQ4ffvD9Tr%2BHrOYnhT_w%2BW9-%2B6vdQxBq8-7QZzw1Xtx5q6xDg@mail.gmail.com>
In-Reply-To: <201608041755.u74HtNc6040224@repo.freebsd.org>
References:  <201608041755.u74HtNc6040224@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi!

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

On Thu, Aug 4, 2016 at 7:55 PM, John Baldwin <jhb@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-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPQ4ffvD9Tr%2BHrOYnhT_w%2BW9-%2B6vdQxBq8-7QZzw1Xtx5q6xDg>