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


Groups > linux.kernel > #1448711

Re: [PATCH 2/3] x86: add some better documentation for probe_kernel_address()

From Dave Hansen <dave@sr71.net>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] x86: add some better documentation for probe_kernel_address()
Date 2016-07-22 20:20 +0200
Message-ID <rXNdf-Tw-17@gated-at.bofh.it> (permalink)
References <rXN3z-Qn-3@gated-at.bofh.it> <rXN3A-Qn-25@gated-at.bofh.it> <rXNdf-Tw-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 07/22/2016 11:10 AM, Andy Lutomirski wrote:
> On Jul 22, 2016 11:03 AM, "Dave Hansen" <dave@sr71.net> wrote:
>> From: Dave Hansen <dave.hansen@linux.intel.com>
>>
>> probe_kernel_address() has an unfortunate name since it is used
>> to probe kernel *and* userspace addresses.  Add a comment
>> explaining some of the situation to help the next developer who
>> might make the silly assumption that it is for probing kernel
>> addresses.
> 
> This can't work on architectures like s390 that have separate,
> overlapping user and kernel address spaces.  Maybe we should fix x86
> to stop abusing it and use get_user instead.  (In which case, your new
> function should be called get_user_insn_byte or similar.)

Urg.

But can't the x86 use in no_context() be called from a kernel-initiated
fault?  Like a prefetch instruction to a vmalloc() page that we needed
to do a vmalloc fault for?

In either case, it would be awfully nice to have the clarity about
exactly what is being probed.  The other 2 calls to is_prefetch() do
appear to be userspace-only.

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


Thread

[PATCH 0/3] x86, pkeys: fix prefetch/pkeys interaction Dave Hansen <dave@sr71.net> - 2016-07-22 20:10 +0200
  [PATCH 2/3] x86: add some better documentation for probe_kernel_address() Dave Hansen <dave@sr71.net> - 2016-07-22 20:10 +0200
    Re: [PATCH 2/3] x86: add some better documentation for probe_kernel_address() Andy Lutomirski <luto@amacapital.net> - 2016-07-22 20:20 +0200
      Re: [PATCH 2/3] x86: add some better documentation for  probe_kernel_address() Dave Hansen <dave@sr71.net> - 2016-07-22 20:20 +0200
        Re: [PATCH 2/3] x86: add some better documentation for probe_kernel_address() Andy Lutomirski <luto@amacapital.net> - 2016-07-22 20:30 +0200
  [PATCH 3/3] x86, pkeys: allow instruction fetches in presence of pkeys Dave Hansen <dave@sr71.net> - 2016-07-22 20:10 +0200

csiph-web