lkml.org 
[lkml]   [2019]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/2 v2] kprobe: Do not use uaccess functions to access kernel memory that can fault
    On Wed, 20 Feb 2019 14:57:31 +0100
    Jann Horn <jannh@google.com> wrote:

    > > (*) BTW, there is another concern to use _from_user APIs in kprobe. Are those
    > > APIs might sleep??
    >
    > If you want to access userspace without sleeping, and ignore data in
    > non-present pages, you can do `pagefault_disable(); err =
    > __copy_from_user_inatomic(...); pagefault_enable();`. (Actually, maybe
    > the kernel should have a helper for that...)

    I was about to say pretty much the same thing (about using
    _inatomic()), but yeah, we should also have a helper function if we
    don't already to include the page_fault_disable/enable() too.

    -- Steve

    \
     
     \ /
      Last update: 2019-02-20 15:48    [W:4.559 / U:0.468 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site