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: <20230714144749.GA3261758@hirez.programming.kicks-ass.net>
Date:   Fri, 14 Jul 2023 16:47:49 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Thomas Gleixner <tglx@...utronix.de>, Jens Axboe <axboe@...nel.dk>,
        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: [RFC][PATCH 04/10] futex: Add sys_futex_wake()

On Fri, Jul 14, 2023 at 04:26:45PM +0200, Arnd Bergmann wrote:
> On Fri, Jul 14, 2023, at 15:39, Peter Zijlstra wrote:
> >
> > +++ b/include/linux/syscalls.h
> > @@ -563,6 +563,9 @@ asmlinkage long sys_set_robust_list(stru
> >  asmlinkage long sys_futex_waitv(struct futex_waitv *waiters,
> >  				unsigned int nr_futexes, unsigned int flags,
> >  				struct __kernel_timespec __user *timeout, clockid_t clockid);
> > +
> > +asmlinkage long sys_futex_wake(void __user *uaddr, int nr, unsigned 
> > int flags, u64 mask);
> > +
> 
> You can't really use 'u64' arguments in portable syscalls, it causes
> a couple of problems, both with defining the user space wrappers,
> and with compat mode.
> 
> Variants that would work include:
> 
> - using 'unsigned long' instead of 'u64'
> - passing 'mask' by reference, as in splice()
> - passing the mask in two u32-bit arguments like in llseek()
> 
> Not sure if any of the above work for you.

Durr, I was hoping they'd use register pairs, but yeah I can see how
that would be very hard to do in generic code.

Hurmph.. using 2 u32s is unfortunate on 64bit, while unsigned long
would limit 64bit futexes to 64bit machines (perhaps not too bad).

Using unsigned long would help with the futex_wait() thing as well.

I'll ponder things a bit.

Obviously I only did build x86_64 ;-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ