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: <E1KsXrY-0000AU-C4@pomaz-ex.szeredi.hu>
Date:	Wed, 22 Oct 2008 09:10:36 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	cl@...ux-foundation.org
CC:	miklos@...redi.hu, penberg@...helsinki.fi, nickpiggin@...oo.com.au,
	hugh@...itas.com, linux-mm@...ck.org,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org
Subject: Re: SLUB defrag pull request?

On Tue, 21 Oct 2008, Christoph Lameter wrote:
> The only way that a secure reference can be established is if the
> slab page is locked. That requires a spinlock. The slab allocator
> calls the get() functions while the slab lock guarantees object
> existence. Then locks are dropped and reclaim actions can start with
> the guarantee that the slab object will not suddenly vanish.

Yes, you've made up your mind, that you want to do it this way.  But
it's the _wrong_ way, this "want to get a secure reference for use
later" leads to madness when applied to dentries or inodes.  Try for a
minute to think outside this template.

For example dcache_lock will protect against dentries moving to/from
d_lru.  So you can do this:

  take dcache_lock
  check if d_lru is non-empty
  take sb->s_umount
  free dentry
  release sb->s_umount
  release dcache_lock

Yeah, locking will be more complicated in reality.  Still, much less
complicated than trying to do the same across two separate phases.

Why can't something like that work?

Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ