Re: [PATCH] KEYS: Fix a race between negating a key and reading the error set

From: David Howells
Date: Fri Oct 11 2013 - 18:51:58 EST


Jeff Layton <jlayton@xxxxxxxxxx> wrote:

> > - if (kflags & (1 << KEY_FLAG_NEGATIVE))
> > + if (kflags & (1 << KEY_FLAG_NEGATIVE)) {
>
> Not specifically related to this bug, but why are you open-coding
> test_bit() here and elsewhere?

Because kflags is read once and kept in a variable. Might not be necessary -
and I should probably use ACCESS_ONCE() when I do.

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