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: <ZQ1fx29+b8PmLVk6@gmail.com>
Date:   Fri, 22 Sep 2023 11:35:03 +0200
From:   Ingo Molnar <mingo@...nel.org>
To:     peterz@...radead.org
Cc:     tglx@...utronix.de, axboe@...nel.dk, linux-kernel@...r.kernel.org,
        mingo@...hat.com, dvhart@...radead.org, dave@...olabs.net,
        andrealmeid@...lia.com, Andrew Morton <akpm@...ux-foundation.org>,
        urezki@...il.com, hch@...radead.org, lstoakes@...il.com,
        Arnd Bergmann <arnd@...db.de>, linux-api@...r.kernel.org,
        linux-mm@...ck.org, linux-arch@...r.kernel.org,
        malteskarupke@....de, Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [PATCH v3 10/15] futex: Add sys_futex_requeue()


* peterz@...radead.org <peterz@...radead.org> wrote:

> --- linux-2.6.orig/kernel/futex/syscalls.c
> +++ linux-2.6/kernel/futex/syscalls.c
> @@ -396,6 +396,44 @@ SYSCALL_DEFINE6(futex_wait,
>  	return ret;
>  }
>  
> +/*
> + * sys_futex_requeue - Requeue a waiter from one futex to another
> + * @waiters:	array describing the source and destination futex
> + * @flags:	unused
> + * @nr_wake:	number of futexes to wake
> + * @nr_requeue:	number of futexes to requeue
> + *
> + * Identical to the traditional FUTEX_CMP_REQUEUE op, except it is part of the
> + * futex2 family of calls.
> + */
> +
> +SYSCALL_DEFINE4(futex_requeue,
> +		struct futex_waitv __user *, waiters,
> +		unsigned int, flags,
> +		int, nr_wake,
> +		int, nr_requeue)
> +{
> +	struct futex_vector futexes[2];
> +	u32 cmpval;
> +	int ret;
> +
> +	if (flags)
> +		return -EINVAL;

Small detail, but isn't -ENOSYS the canonical error code for functionality 
not yet implemented - which the unused 'flags' ABI is arguably?

-EINVAL is for recognized but incorrect parameters, such as:

> +	if (!waiters)
> +		return -EINVAL;

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ