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:	Thu, 17 Mar 2011 19:38:42 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	richard -rw- weinberger <richard.weinberger@...il.com>,
	laijs@...fujitsu.com, LKML <linux-kernel@...r.kernel.org>,
	user-mode-linux-devel@...ts.sourceforge.net, dvhart@...ux.intel.com
Subject: Re: um: WARNING: at kernel/futex.c:786 __unqueue_futex

Le jeudi 17 mars 2011 à 19:25 +0100, Geert Uytterhoeven a écrit :
> On Thu, Mar 17, 2011 at 19:16, Steven Rostedt <rostedt@...dmis.org> wrote:
> > On Thu, 2011-03-17 at 18:02 +0100, Eric Dumazet wrote:
> >> Le jeudi 17 mars 2011 à 12:55 -0400, Steven Rostedt a écrit :
> >> > Here, test this patch. I'm in the process of committing it now.
> >> > It will be two patches, one for the WARN_ON_SMP() change, the other for
> >> > the futex change.
> >> >
> >> > -- Steve
> >> >
> >> > diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
> >> > index c2c9ba0..25f1e9e 100644
> >> > --- a/include/asm-generic/bug.h
> >> > +++ b/include/asm-generic/bug.h
> >> > @@ -168,7 +168,7 @@ extern void warn_slowpath_null(const char *file, const int line);
> >> >  #ifdef CONFIG_SMP
> >> >  # define WARN_ON_SMP(x)                    WARN_ON(x)
> >> >  #else
> >> > -# define WARN_ON_SMP(x)                    do { } while (0)
> >> > +# define WARN_ON_SMP(x)                    ({0;})
> >> >  #endif
> >> >
> >>
> >> You meant :
> >>
> >> # define WARN_ON_SMP(x)                       ({x;})
> >>
> >> or
> >>
> >> # define WARN_ON_SMP(x)         do { } while (x, 0)
> >>
> >> ?
> >>
> >
> > Does if (do { } while (x, 0)) work?
> 

My point was that WARN_ON(X) always evaluates X once

And apparently, WARN_ON_SMP(X) doesnt evaluates X iF !SMP

This should be documented, or fixed ;)



--
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