lkml.org 
[lkml]   [2023]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 02/14] futex: Extend the FUTEX2 flags
On Fri, Jul 21, 2023 at 05:47:31PM +0200, Arnd Bergmann wrote:
> On Fri, Jul 21, 2023, at 12:22, Peter Zijlstra wrote:
> > * futex_parse_waitv - Parse a waitv array from userspace
> > @@ -207,7 +207,12 @@ static int futex_parse_waitv(struct fute
> > if ((aux.flags & ~FUTEX2_MASK) || aux.__reserved)
> > return -EINVAL;
> >
> > - if (!(aux.flags & FUTEX2_32))
> > + if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall()) {
> > + if ((aux.flags & FUTEX2_64) == FUTEX2_64)
> > + return -EINVAL;
> > + }
> > +
> > + if ((aux.flags & FUTEX2_64) != FUTEX2_32)
> > return -EINVAL;
>
> This looks slightly confusing, how about defining another
> FUTEX2_SIZEMASK (or similar) macro to clarify that
> "aux.flags & FUTEX2_64" is a mask operation that can
> match the FUTEX2_{8,16,32,64} values?

Yeah, I had that in an earlier version, but then reconsidered as I
didn't want to clutter the uabi with that. But perhaps I over-throught
this.

\
 
 \ /
  Last update: 2023-07-21 20:53    [W:0.107 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site