2009-06-19 19:57:53

by Tim Abbott

[permalink] [raw]
Subject: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

Distributions and kerneloops.org have requested that the Ksplice
rebootless update system taint the kernel the first time that a
Ksplice update is installed, in order to assist with bug triage.

Ksplice uses a new taint flag, TAINT_KSPLICE, displayed as 'K', for
this purpose.

We would like to confirm that this use of taint meets with the
community's approval and get this taint flag registered in mainline.

Signed-off-by: Tim Abbott <[email protected]>
---
include/linux/kernel.h | 1 +
kernel/panic.c | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index c5a71c3..be77585 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -330,6 +330,7 @@ extern enum system_states {
#define TAINT_OVERRIDDEN_ACPI_TABLE 8
#define TAINT_WARN 9
#define TAINT_CRAP 10
+#define TAINT_KSPLICE 11

extern void dump_stack(void) __cold;

diff --git a/kernel/panic.c b/kernel/panic.c
index 984b3ec..c2ea780 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -160,6 +160,7 @@ static const struct tnt tnts[] = {
{ TAINT_OVERRIDDEN_ACPI_TABLE, 'A', ' ' },
{ TAINT_WARN, 'W', ' ' },
{ TAINT_CRAP, 'C', ' ' },
+ { TAINT_KSPLICE, 'K', ' ' },
};

/**
@@ -176,6 +177,7 @@ static const struct tnt tnts[] = {
* 'A' - ACPI table overridden.
* 'W' - Taint on warning.
* 'C' - modules from drivers/staging are loaded.
+ * 'K' - A Ksplice update has been loaded.
*
* The string is overwritten by the next call to print_taint().
*/
--
1.6.3.1


2009-06-19 20:13:18

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

On Fri, 2009-06-19 at 15:57 -0400, Tim Abbott wrote:
> Distributions and kerneloops.org have requested that the Ksplice
> rebootless update system taint the kernel the first time that a
> Ksplice update is installed, in order to assist with bug triage.
>
> Ksplice uses a new taint flag, TAINT_KSPLICE, displayed as 'K', for
> this purpose.
>
> We would like to confirm that this use of taint meets with the
> community's approval and get this taint flag registered in mainline.
>
> Signed-off-by: Tim Abbott <[email protected]>

Since all of ksplice is still out-of-tree, it seems to me this taint
should be too.

Just add it to the ksplice patch. That way it will get into mainline
if/when ksplice will.

> ---
> include/linux/kernel.h | 1 +
> kernel/panic.c | 2 ++
> 2 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index c5a71c3..be77585 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -330,6 +330,7 @@ extern enum system_states {
> #define TAINT_OVERRIDDEN_ACPI_TABLE 8
> #define TAINT_WARN 9
> #define TAINT_CRAP 10
> +#define TAINT_KSPLICE 11
>
> extern void dump_stack(void) __cold;
>
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 984b3ec..c2ea780 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -160,6 +160,7 @@ static const struct tnt tnts[] = {
> { TAINT_OVERRIDDEN_ACPI_TABLE, 'A', ' ' },
> { TAINT_WARN, 'W', ' ' },
> { TAINT_CRAP, 'C', ' ' },
> + { TAINT_KSPLICE, 'K', ' ' },
> };
>
> /**
> @@ -176,6 +177,7 @@ static const struct tnt tnts[] = {
> * 'A' - ACPI table overridden.
> * 'W' - Taint on warning.
> * 'C' - modules from drivers/staging are loaded.
> + * 'K' - A Ksplice update has been loaded.
> *
> * The string is overwritten by the next call to print_taint().
> */

2009-06-22 07:52:29

by Jon Masters

[permalink] [raw]
Subject: Re: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

On Fri, 2009-06-19 at 22:11 +0200, Peter Zijlstra wrote:
> On Fri, 2009-06-19 at 15:57 -0400, Tim Abbott wrote:
> > Distributions and kerneloops.org have requested that the Ksplice
> > rebootless update system taint the kernel the first time that a
> > Ksplice update is installed, in order to assist with bug triage.
> >
> > Ksplice uses a new taint flag, TAINT_KSPLICE, displayed as 'K', for
> > this purpose.
> >
> > We would like to confirm that this use of taint meets with the
> > community's approval and get this taint flag registered in mainline.
> >
> > Signed-off-by: Tim Abbott <[email protected]>
>
> Since all of ksplice is still out-of-tree, it seems to me this taint
> should be too.

Respectfully, I disagree.

The thing is, distribution maintainers and others would really benefit
from knowing if this stuff is loaded today, before the possible eventual
addition of ksplice upstream. We already have tainting for non-GPL code
and I don't see us arguing about the fact that the kernel has no non-GPL
code actually shipping in it to cause such taints to get set :)

Jon.

2009-06-22 08:50:23

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

On Mon, 2009-06-22 at 03:51 -0400, Jon Masters wrote:
> On Fri, 2009-06-19 at 22:11 +0200, Peter Zijlstra wrote:
> > On Fri, 2009-06-19 at 15:57 -0400, Tim Abbott wrote:
> > > Distributions and kerneloops.org have requested that the Ksplice
> > > rebootless update system taint the kernel the first time that a
> > > Ksplice update is installed, in order to assist with bug triage.
> > >
> > > Ksplice uses a new taint flag, TAINT_KSPLICE, displayed as 'K', for
> > > this purpose.
> > >
> > > We would like to confirm that this use of taint meets with the
> > > community's approval and get this taint flag registered in mainline.
> > >
> > > Signed-off-by: Tim Abbott <[email protected]>
> >
> > Since all of ksplice is still out-of-tree, it seems to me this taint
> > should be too.
>
> Respectfully, I disagree.
>
> The thing is, distribution maintainers and others would really benefit
> from knowing if this stuff is loaded today, before the possible eventual
> addition of ksplice upstream. We already have tainting for non-GPL code
> and I don't see us arguing about the fact that the kernel has no non-GPL
> code actually shipping in it to cause such taints to get set :)

But without ksplice patches you cannot ksplice, right? That is, there is
a non trivial patch to the kernel to make this happen afaik. If distros
ship that, then they can add this taint flag as well. No need to burden
mainline with any of that until it ksplice proper makes it in.



2009-06-22 13:33:46

by Tim Abbott

[permalink] [raw]
Subject: Re: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

On Mon, 22 Jun 2009, Peter Zijlstra wrote:

> But without ksplice patches you cannot ksplice, right? That is, there is
> a non trivial patch to the kernel to make this happen afaik. If distros
> ship that, then they can add this taint flag as well. No need to burden
> mainline with any of that until it ksplice proper makes it in.

No, Ksplice can patch completely unmodified upstream and distribution
kernels.

-Tim Abbott

2009-06-22 14:54:40

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

On Mon, 22 Jun 2009 09:32:13 -0400 (EDT) Tim Abbott <[email protected]> wrote:

> On Mon, 22 Jun 2009, Peter Zijlstra wrote:
>
> > But without ksplice patches you cannot ksplice, right? That is, there is
> > a non trivial patch to the kernel to make this happen afaik. If distros
> > ship that, then they can add this taint flag as well. No need to burden
> > mainline with any of that until it ksplice proper makes it in.
>
> No, Ksplice can patch completely unmodified upstream and distribution
> kernels.
>

Have the ksplice people considered using /proc/sys/kernel/tainted and
TAINT_USER?

2009-06-22 17:48:44

by Chuck Ebbert

[permalink] [raw]
Subject: Re: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

On Fri, 19 Jun 2009 15:57:21 -0400 (EDT)
Tim Abbott <[email protected]> wrote:

> Distributions and kerneloops.org have requested that the Ksplice
> rebootless update system taint the kernel the first time that a
> Ksplice update is installed, in order to assist with bug triage.
>
> Ksplice uses a new taint flag, TAINT_KSPLICE, displayed as 'K', for
> this purpose.
>
> We would like to confirm that this use of taint meets with the
> community's approval and get this taint flag registered in mainline.
>

How about a more generic taint flag that just says some user program has
patched the running kernel?

2009-06-22 20:00:08

by Maxim Levitsky

[permalink] [raw]
Subject: Re: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

On Mon, 2009-06-22 at 13:46 -0400, Chuck Ebbert wrote:
> On Fri, 19 Jun 2009 15:57:21 -0400 (EDT)
> Tim Abbott <[email protected]> wrote:
>
> > Distributions and kerneloops.org have requested that the Ksplice
> > rebootless update system taint the kernel the first time that a
> > Ksplice update is installed, in order to assist with bug triage.
> >
> > Ksplice uses a new taint flag, TAINT_KSPLICE, displayed as 'K', for
> > this purpose.
> >
> > We would like to confirm that this use of taint meets with the
> > community's approval and get this taint flag registered in mainline.
> >
>
> How about a more generic taint flag that just says some user program has
> patched the running kernel?
Like TAINT_ROOTKIT :-)



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

2009-06-22 21:26:07

by Jon Masters

[permalink] [raw]
Subject: Re: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

On Mon, 2009-06-22 at 10:50 +0200, Peter Zijlstra wrote:
> On Mon, 2009-06-22 at 03:51 -0400, Jon Masters wrote:
> > On Fri, 2009-06-19 at 22:11 +0200, Peter Zijlstra wrote:
> > > On Fri, 2009-06-19 at 15:57 -0400, Tim Abbott wrote:
> > > > Distributions and kerneloops.org have requested that the Ksplice
> > > > rebootless update system taint the kernel the first time that a
> > > > Ksplice update is installed, in order to assist with bug triage.
> > > >
> > > > Ksplice uses a new taint flag, TAINT_KSPLICE, displayed as 'K', for
> > > > this purpose.
> > > >
> > > > We would like to confirm that this use of taint meets with the
> > > > community's approval and get this taint flag registered in mainline.
> > > >
> > > > Signed-off-by: Tim Abbott <[email protected]>
> > >
> > > Since all of ksplice is still out-of-tree, it seems to me this taint
> > > should be too.
> >
> > Respectfully, I disagree.
> >
> > The thing is, distribution maintainers and others would really benefit
> > from knowing if this stuff is loaded today, before the possible eventual
> > addition of ksplice upstream. We already have tainting for non-GPL code
> > and I don't see us arguing about the fact that the kernel has no non-GPL
> > code actually shipping in it to cause such taints to get set :)
>
> But without ksplice patches you cannot ksplice, right?

Nah. This is a common missunderstanding. Ksplice actually doesn't need
any in-kernel patches, but it does include a rather uncomfortable (from
upstream PoV) disassembler to help it with patching. To avoid this, the
Ksplice guys are looking to get some of the split function sections
stuff, etc. upstream so that they don't need the extraneous stuff.

> That is, there is
> a non trivial patch to the kernel to make this happen afaik.

Well, actually there are several ways that could get in upstream - even
just the base bits are useful. Upstream may never take the shadow data
structure tracking kABI stuff that also comes with Ksplice (I can,
however, think of a few distributions that might be interested in adding
those bits for themselves sometime), but that can live in their module.

> If distros
> ship that, then they can add this taint flag as well. No need to burden
> mainline with any of that until it ksplice proper makes it in.

Nah. We need a flag. It's a really nice way to know "is this backtrace
I'm seeing coming from the kernel that I shipped?". Just imagine you're
one of the folks in $enterprise_vendor who needs to figure this out
(sure you should get there from the linked module list if you've half a
brain, but perhaps "you" is actually an automated tool, like sosreport
on RH systems and I'm sure other vendors have their own equivalents).

Jon.

2009-06-23 18:58:34

by Tim Abbott

[permalink] [raw]
Subject: Re: [PATCH] Add new TAINT_KSPLICE flag for when a Ksplice update has been loaded.

On Mon, 22 Jun 2009, Andrew Morton wrote:
> Have the ksplice people considered using /proc/sys/kernel/tainted and
> TAINT_USER?

We're thinking about using TAINT_USER to indicate when a user has
installed a Ksplice update that they generated on their own. We'd like to
be able to distinguish between the cases (1) where a user has generated a
potentially-bad Ksplice update by providing their own naughty patch and
(2) where a user is running binary Ksplice updates provided by a vendor
that is taking care to use Ksplice properly. Our patch currently uses
TAINT_KSPLICE to indicate whether _any_ Ksplice update has been applied.

-Tim Abbott