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: <20250205080029.rAEXY6qX@linutronix.de>
Date: Wed, 5 Feb 2025 09:00:29 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org,
	André Almeida <andrealmeid@...lia.com>,
	Darren Hart <dvhart@...radead.org>,
	Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar <mingo@...hat.com>,
	Juri Lelli <juri.lelli@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Valentin Schneider <vschneid@...hat.com>,
	Waiman Long <longman@...hat.com>
Subject: Re: [PATCH v8 12/15] futex: Allow to re-allocate the private local
 hash.

On 2025-02-04 12:05:33 [+0100], Peter Zijlstra wrote:
> > @@ -175,6 +311,14 @@ void futex_hash_put(struct futex_hash_bucket *hb)
> >   */
> >  void futex_hash_get(struct futex_hash_bucket *hb)
> >  {
> > +	struct futex_private_hash *hb_p;
> > +
> > +	if (hb->hb_slot == 0)
> > +		return;
> > +	hb_p = container_of(hb, struct futex_private_hash,
> > +			    queues[hb->hb_slot - 1]);
> > +
> > +	WARN_ON_ONCE(!rcuref_get(&hb_p->users));
> >  }
> 
> > --- a/kernel/futex/futex.h
> > +++ b/kernel/futex/futex.h
> > @@ -115,6 +115,7 @@ static inline bool should_fail_futex(bool fshared)
> >   */
> >  struct futex_hash_bucket {
> >  	atomic_t waiters;
> > +	unsigned int hb_slot;
> >  	spinlock_t lock;
> >  	struct plist_head chain;
> >  } ____cacheline_aligned_in_smp;
> 
> *groan*
> 
> Just sticking a pointer in was too complicated?

It looked simpler. But okay.

> void futex_hash_put(struct futex_hash_bucket *hb)
> {
> 	struct futex_private_hash *ph = hb->private;
> 	if (!ph)
> 		return;
> 
> 	futex_put_private_hash(ph);
> }

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ