Thread (154 messages) 154 messages, 12 authors, 2023-03-20

Re: [PATCH v7 33/41] x86/shstk: Introduce map_shadow_stack syscall

From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Date: 2023-03-10 20:20:08
Also in: linux-arch, linux-doc, linux-mm, lkml

On Fri, 2023-03-10 at 21:05 +0100, Borislav Petkov wrote:
On Fri, Mar 10, 2023 at 05:12:40PM +0000, Edgecombe, Rick P wrote:
quoted
quoted
Can we use distinct negative retvals in each case so that it is
clear
to
userspace where it fails, *if* it fails?
Good idea, I think maybe ERANGE.
For those two, right?

        /* If there isn't space for a token */
        if (set_tok && size < 8)
                return -EINVAL;

        if (addr && addr <= 0xFFFFFFFF)
                return -EINVAL;

They are kinda range-checking of sorts. A wider range but still
similar... 
I was thinking ERANGE would be for the 4GB limit. This is the weird 32
bit limiting thing. So if someone hit it they could look up in the docs
what is going on. The size-big-enough-for-a-token check could be
ENOSPC? Then each reason could have a different error code.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help