lkml.org 
[lkml]   [2017]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v9 25/29] x86/umip: Force a page fault when unable to copy emulated result to user
On Tue, Oct 3, 2017 at 8:54 PM, Ricardo Neri
<ricardo.neri-calderon@linux.intel.com> wrote:
> fixup_umip_exception() will be called from do_general_protection(). If the
> former returns false, the latter will issue a SIGSEGV with SEND_SIG_PRIV.
> However, when emulation is successful but the emulated result cannot be
> copied to user space memory, it is more accurate to issue a SIGSEGV with
> SEGV_MAPERR with the offending address. A new function, inspired in
> force_sig_info_fault(), is introduced to model the page fault.

This code is slightly buggy (with, for example, PKRU, although the
chance that anyone ever notices is about nil). For an alternative
approach, see current->thread.sig_on_uaccess_err, used in
arch/x86/entry/vsyscall/vsyscall_64.c. But I'm fine with this patch
as is, too.

\
 
 \ /
  Last update: 2017-10-26 10:00    [W:0.283 / U:5.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site