From: Andrew Morton <akpm@linux-foundation.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Make taint bit reliable
Date: Tue, 2 Sep 2008 17:42:46 -0700 [thread overview]
Message-ID: <20080902174246.0587a04a.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080901164632.GA18159@basil.nowhere.org>
On Mon, 1 Sep 2008 18:46:32 +0200
Andi Kleen <andi@firstfloor.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@linux.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)'?
next prev parent reply other threads:[~2008-09-03 0:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-01 16:46 Andi Kleen
2008-09-03 0:42 ` Andrew Morton [this message]
2008-09-03 18:54 ` [PATCH] Make taint bit reliable v2 Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080902174246.0587a04a.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome