lkml.org 
[lkml]   [2018]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH for 4.18 1/2] rseq: use __u64 for rseq_cs fields, validate abort_ip < TASK_SIZE
On Mon, Jul 2, 2018 at 3:03 PM Mathieu Desnoyers
<mathieu.desnoyers@efficios.com> wrote:
>
> if (__get_user(ptr, &t->rseq->rseq_cs))
> return -EINVAL;
> if (check_rseq_cs_padding(t))
> return -EINVAL;

Small nit.

I think the _actual_ user access faults should return -EFAULT, and
then the *validation* checks should return -EINVAL.

So when the "copy_from_user()" fails, that's -EFAULT, but when you
have (rseq_cs->start_ip >= TASK_SIZE), that's -EINVAL.

That said, nothing actually cares or exposes the error number, I
think. Afaik, all the callers just check "did it work" or not.

So this is more a "let's be consistent" than anything that matters.

Linus

\
 
 \ /
  Last update: 2018-07-03 00:10    [W:0.063 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site