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]
Date:	Tue, 20 Nov 2007 13:36:58 -0800 (PST)
From:	Christoph Lameter <clameter@....com>
To:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
cc:	ak@...e.de, akpm@...ux-foundation.org, travis@....com,
	linux-kernel@...r.kernel.org
Subject: Re: [rfc 04/45] cpu alloc: Use in SLUB

On Tue, 20 Nov 2007, Mathieu Desnoyers wrote:

> > > > -			__slab_free(s, page, x, addr, c->offset);
> > > > +		if (unlikely(page != __CPU_READ(c->page) ||
> > > > +					__CPU_READ(c->node) < 0)) {
> > > > +			__slab_free(s, page, x, addr, __CPU_READ(c->offset));
> > > 
> > > And same question as above : what happens if we fail after executing the
> > > __slab_free.. is it valid to do it twice ?
> > 
> > __slab_free is always successful and will never cause a repeat of the 
> > loop.
> 
> Then what happens if we are migrated between the end of __slab_free and
> the CPU_CMPXCHG ? The cmpxchg would fail, and the __slab_free will be
> done twice ?

Look at the control flow. The __slab_free can never be done twice.

{
                freelist = __CPU_READ(c->freelist);
                barrier();
                if (unlikely(page != __CPU_READ(c->page) ||
                                        __CPU_READ(c->node) < 0)) {
                        __slab_free(s, page, x, addr);
                        break;
			^^^^^^^ no redo of the loop possible.

                }
                set_freepointer(s, object, freelist);
        } while (CPU_CMPXCHG(c->freelist, freelist, object) != freelist);

-
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