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:	Wed, 23 Feb 2011 18:30:56 -0800
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [patch 1/5] genirq: Prepare the handling of shared oneshot interrupts

On Wed, Feb 23, 2011 at 3:52 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
>
> +               /*
> +                * We or the mask lockless. Safe because the code
> +                * which clears the mask is serialized
> +                * vs. IRQ_INPROGRESS.
> +                */
> +               desc->threads_oneshot |= action->thread_mask;
> +               wake_up_process(action->thread);

That comment makes no sense.

What has "code which clears the mask" to do with anything?

Even if another CPU _sets_ a bit, doing so in parallel will lose bits
if it's not locked. One CPU will read the old value, set its bit, and
store the new value: with the race, only one of the bits will be set.

So maybe the code is safe, but the comment is still totally wrong. You
had better be safe not just against people clearing bits, you need to
be safe against ANY OTHER WRITER (clear or set), including very much
OTHER BITS in the same word.

So if it really is safe, comment on ALL the cases.

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