[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080902174246.0587a04a.akpm@linux-foundation.org>
Date: Tue, 2 Sep 2008 17:42:46 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Andi Kleen <andi@...stfloor.org>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Make taint bit reliable
On Mon, 1 Sep 2008 18:46:32 +0200
Andi Kleen <andi@...stfloor.org> wrote:
> Make taint bit reliable
>
> It's somewhat unlikely that it happens, but right now a race window
> between interrupts or machine checks or oopses could corrupt the tainted
> bitmap because it is modified in a non atomic fashion.
>
> Convert the taint variable to an unsigned long and use only atomic bit
> operations on it.
>
> Unfortunately this means the intvec sysctl functions cannot be used on
> it anymore.
>
> It turned out the taint sysctl handler could actually be simplified
> a bit (since it only increases capabilities) so this patch actually
> removes code.
>
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
>
> ---
> include/linux/kernel.h | 2 -
> kernel/panic.c | 5 ++-
> kernel/sysctl.c | 67 +++++++++++++++++++++----------------------------
> 3 files changed, 33 insertions(+), 41 deletions(-)
You missed one:
./arch/x86/kernel/smpboot.c: tainted &= ~TAINT_UNSAFE_SMP;
To prevent reoccurrences we could/should rename `tainted' to something else.
Also, it would end up with a beter result if we were to change
- #define TAINT_PROPRIETARY_MODULE (1<<0)
- #define TAINT_FORCED_MODULE (1<<1)
...
+ #define TAINT_PROPRIETARY_MODULE 0
+ #define TAINT_FORCED_MODULE 1
...
and remove that ungainly log2() you had to add, and just prevent all
open-coded access to the 'tainted' global. ie: add `int get_taint(void)'?
--
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