lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6a49b585-05d0-4b79-b5ab-d710f5d6d598@app.fastmail.com>
Date:   Fri, 21 Jul 2023 17:47:31 +0200
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Peter Zijlstra" <peterz@...radead.org>,
        "Thomas Gleixner" <tglx@...utronix.de>,
        "Jens Axboe" <axboe@...nel.dk>
Cc:     linux-kernel@...r.kernel.org, "Ingo Molnar" <mingo@...hat.com>,
        "Darren Hart" <dvhart@...radead.org>, dave@...olabs.net,
        andrealmeid@...lia.com,
        "Andrew Morton" <akpm@...ux-foundation.org>, urezki@...il.com,
        "Christoph Hellwig" <hch@...radead.org>,
        "Lorenzo Stoakes" <lstoakes@...il.com>, linux-api@...r.kernel.org,
        linux-mm@...ck.org, Linux-Arch <linux-arch@...r.kernel.org>,
        malteskarupke@....de
Subject: Re: [PATCH v1 02/14] futex: Extend the FUTEX2 flags

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?

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ