Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1488371

Re: [PATCH] arm64: Correctly bounds check virt_addr_valid

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] arm64: Correctly bounds check virt_addr_valid
Date 2016-09-21 22:10 +0200
Message-ID <sjW0a-545-17@gated-at.bofh.it> (permalink)
References <sjTvj-3ps-1@gated-at.bofh.it> <sjTYm-3z1-15@gated-at.bofh.it> <sjVx7-4Eu-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Sep 21, 2016 at 12:34:46PM -0700, Laura Abbott wrote:
> On 09/21/2016 10:58 AM, Mark Rutland wrote:
> >Are there other potentially-broken users of virt_addr_valid? It's not
> >clear to me what some drivers are doing with this, and therefore whether
> >we need to cc stable.
> 
> The number of users is pretty limited. Some of them use it as a debugging
> check, others are using it more like hardened usercopy. The number of
> users that would actually affect arm64 seems so small I don't think it's
> worth trying to backport to stable.

Ok.

> Hardened usercopy was getting hit particularly hard because usercopy was
> happening on all types of memory whereas the drivers tend to be more limited
> in scope.

Sure.

> >Given the common sub-expression, perhaps it would be better to leave
> >these as-is, but prefix them with '_', and after the #endif, have
> >something like:
> >
> >#define _virt_addr_is_linear(kaddr)	(((u64)(kaddr)) >= PAGE_OFFSET)
> >#define virt_addr_valid(kaddr)		(_virt_addr_is_linear(kaddr) && _virt_addr_valid(kaddr))
> >
> 
> Good suggestion.

FWIW, with that, feel free to add:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] arm64: Correctly bounds check virt_addr_valid Laura Abbott <labbott@redhat.com> - 2016-09-21 19:30 +0200
  Re: [PATCH] arm64: Correctly bounds check virt_addr_valid Laura Abbott <labbott@redhat.com> - 2016-09-21 19:50 +0200
  Re: [PATCH] arm64: Correctly bounds check virt_addr_valid Mark Rutland <mark.rutland@arm.com> - 2016-09-21 20:00 +0200
    Re: [PATCH] arm64: Correctly bounds check virt_addr_valid Laura Abbott <labbott@redhat.com> - 2016-09-21 21:40 +0200
      Re: [PATCH] arm64: Correctly bounds check virt_addr_valid Mark Rutland <mark.rutland@arm.com> - 2016-09-21 22:10 +0200

csiph-web