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: <4DFB93C1.9000901@fb.com>
Date:	Fri, 17 Jun 2011 10:49:53 -0700
From:	Arun Sharma <asharma@...com>
To:	Mike Frysinger <vapier.adi@...il.com>
CC:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Ingo Molnar <mingo@...e.hu>, David Miller <davem@...emloft.net>
Subject: Re: [PATCH] atomic: cleanup asm-generic atomic*.h inclusion

On 6/17/11 10:28 AM, Mike Frysinger wrote:
> On Fri, Jun 17, 2011 at 13:11, Arun Sharma wrote:
>> On 6/16/11 11:36 PM, Mike Frysinger wrote:
>>> i'm not sure this doesnt break things.  what tree exactly should i
>>> apply this patch to to verify things ?
>>
>> I tested 3.0-rc2 + patch 1 + patch 2 + this patch.
>
> not sure what those patches are, so i picked at random:
> Subject: [PATCH 2/3] atomic: move atomic_add_unless to generic code
> Date: Tue,  7 Jun 2011 17:07:18 -0700
> Message-Id:<1307491639-9864-2-git-send-email-asharma@...com>
>
> Subject: [PATCH 1/3] atomic: use<linux/atomic.h>
> Date:	Mon,  6 Jun 2011 10:27:29 -0700
> Message-Id:<1307381251-15729-1-git-send-email-asharma@...com>

Yes - these are the right patches.

>
> but even after just these two, things fail because
> include/asm-generic/atomic.h provides atomic_add_unless() already.
> i'm guessing your patch 2/3 should have fixed that somehow since it
> adds the func to linux/atomic.h.

Thanks for catching this. I missed it because I tested only on i386 and 
x86_64. Looks like only 4 archs are affected:

$ grep -r asm-generic.atomic.h *
blackfin/include/asm/atomic.h:# include <asm-generic/atomic.h>
microblaze/include/asm/atomic.h:#include <asm-generic/atomic.h>
mn10300/include/asm/atomic.h:#include <asm-generic/atomic.h>
score/include/asm/atomic.h:#include <asm-generic/atomic.h>

I believe the correct fix is:

--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -129,17 +129,6 @@ static inline void atomic_dec(atomic_t *v)

  #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), 
(o), (n))

-static inline int atomic_add_unless(atomic_t *v, int a, int u)
-{
-  int c, old;
-  c = atomic_read(v);
-  while (c != u && (old = atomic_cmpxchg(v, c, c + a)) != c)
-    c = old;
-  return c != u;
-}
-
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
-
  static inline void atomic_clear_mask(unsigned long mask, unsigned long 
*addr)
  {
         unsigned long flags;

Could you help test this? I'll resend the patch series once I get 
confirmation.

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