linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] taint/module: Fix problems when out-of-kernel driver defines true or false
@ 2017-01-02  2:25 Larry Finger
  2017-01-02  5:50 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Larry Finger @ 2017-01-02  2:25 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Larry Finger, Petr Mladek, Jessica Yu, Rusty Russell

Commit 7fd8329ba502 ("taint/module: Clean up global and module taint
flags handling") used the key words true and false as character members
of a new struct. These names cause problems when out-of-kernel modules
such as VirtualBox include their own definitions of true and false.

Fixes: 7fd8329ba502 ("taint/module: Clean up global and module taint flags handling")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Jessica Yu <jeyu@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
---
 include/linux/kernel.h | 4 ++--
 kernel/module.c        | 2 +-
 kernel/panic.c         | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 56aec84..cb09238 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -514,8 +514,8 @@ extern enum system_states {
 #define TAINT_FLAGS_COUNT		16
 
 struct taint_flag {
-	char true;	/* character printed when tainted */
-	char false;	/* character printed when not tainted */
+	char c_true;	/* character printed when tainted */
+	char c_false;	/* character printed when not tainted */
 	bool module;	/* also show as a per-module taint flag */
 };
 
diff --git a/kernel/module.c b/kernel/module.c
index f7482db..5f7d482 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1145,7 +1145,7 @@ static size_t module_flags_taint(struct module *mod, char *buf)
 
 	for (i = 0; i < TAINT_FLAGS_COUNT; i++) {
 		if (taint_flags[i].module && test_bit(i, &mod->taints))
-			buf[l++] = taint_flags[i].true;
+			buf[l++] = taint_flags[i].c_true;
 	}
 
 	return l;
diff --git a/kernel/panic.c b/kernel/panic.c
index c51edaa..901c4fb 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -355,7 +355,7 @@ const char *print_tainted(void)
 		for (i = 0; i < TAINT_FLAGS_COUNT; i++) {
 			const struct taint_flag *t = &taint_flags[i];
 			*s++ = test_bit(i, &tainted_mask) ?
-					t->true : t->false;
+					t->c_true : t->c_false;
 		}
 		*s = 0;
 	} else
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] taint/module: Fix problems when out-of-kernel driver defines true or false
  2017-01-02  2:25 [PATCH] taint/module: Fix problems when out-of-kernel driver defines true or false Larry Finger
@ 2017-01-02  5:50 ` Christoph Hellwig
  2017-01-02 10:51 ` Petr Mladek
  2017-01-04  3:08 ` Jessica Yu
  2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2017-01-02  5:50 UTC (permalink / raw)
  To: Larry Finger
  Cc: Linus Torvalds, linux-kernel, Petr Mladek, Jessica Yu, Rusty Russell

On Sun, Jan 01, 2017 at 08:25:25PM -0600, Larry Finger wrote:
> Commit 7fd8329ba502 ("taint/module: Clean up global and module taint
> flags handling") used the key words true and false as character members
> of a new struct. These names cause problems when out-of-kernel modules
> such as VirtualBox include their own definitions of true and false.

Whuch they should not define, so fix them, just like you;d fix them for
everything else that would conflict with something in kernel headers.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] taint/module: Fix problems when out-of-kernel driver defines true or false
  2017-01-02  2:25 [PATCH] taint/module: Fix problems when out-of-kernel driver defines true or false Larry Finger
  2017-01-02  5:50 ` Christoph Hellwig
@ 2017-01-02 10:51 ` Petr Mladek
  2017-01-04  3:08 ` Jessica Yu
  2 siblings, 0 replies; 5+ messages in thread
From: Petr Mladek @ 2017-01-02 10:51 UTC (permalink / raw)
  To: Larry Finger; +Cc: Linus Torvalds, linux-kernel, Jessica Yu, Rusty Russell

On Sun 2017-01-01 20:25:25, Larry Finger wrote:
> Commit 7fd8329ba502 ("taint/module: Clean up global and module taint
> flags handling") used the key words true and false as character members
> of a new struct. These names cause problems when out-of-kernel modules
> such as VirtualBox include their own definitions of true and false.
> 
> Fixes: 7fd8329ba502 ("taint/module: Clean up global and module taint flags handling")
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Petr Mladek <pmladek@suse.com>
> Cc: Jessica Yu <jeyu@redhat.com>
> Cc: Rusty Russell <rusty@rustcorp.com.au>

I like this variant a bit more than the tainted/untainted one.

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: taint/module: Fix problems when out-of-kernel driver defines true or false
  2017-01-02  2:25 [PATCH] taint/module: Fix problems when out-of-kernel driver defines true or false Larry Finger
  2017-01-02  5:50 ` Christoph Hellwig
  2017-01-02 10:51 ` Petr Mladek
@ 2017-01-04  3:08 ` Jessica Yu
       [not found]   ` <CAP71bdULb5BReYmouqE7CLX3uS=3EdD0t46Wp_uGAFD+hxRRYA@mail.gmail.com>
  2 siblings, 1 reply; 5+ messages in thread
From: Jessica Yu @ 2017-01-04  3:08 UTC (permalink / raw)
  To: Larry Finger; +Cc: Linus Torvalds, linux-kernel, Petr Mladek, Rusty Russell

+++ Larry Finger [01/01/17 20:25 -0600]:
>Commit 7fd8329ba502 ("taint/module: Clean up global and module taint
>flags handling") used the key words true and false as character members
>of a new struct. These names cause problems when out-of-kernel modules
>such as VirtualBox include their own definitions of true and false.
>
>Fixes: 7fd8329ba502 ("taint/module: Clean up global and module taint flags handling")
>Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>Cc: Petr Mladek <pmladek@suse.com>
>Cc: Jessica Yu <jeyu@redhat.com>
>Cc: Rusty Russell <rusty@rustcorp.com.au>

Applied, thanks.

Jessica

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: taint/module: Fix problems when out-of-kernel driver defines true or false
       [not found]   ` <CAP71bdULb5BReYmouqE7CLX3uS=3EdD0t46Wp_uGAFD+hxRRYA@mail.gmail.com>
@ 2017-01-17 17:55     ` Jessica Yu
  0 siblings, 0 replies; 5+ messages in thread
From: Jessica Yu @ 2017-01-17 17:55 UTC (permalink / raw)
  To: Larry Finger; +Cc: Linus Torvalds, LKML, Petr Mladek, Rusty Russell

+++ Larry Finger [17/01/17 10:08 -0600]:
>Jessica,
>
>What is the status of the patch? VirtualBox has converted to the hotplug
>state manager, thus their drivers now build, but only if this patch has
>been applied.
>
>Thanks,
>
>Larry

This fix has already been sitting on modules-next for some time,
queued up for the next merge window. But since it was actually one of
the patches from the last merge window that caused the OOT module
breakage, this should have be an -rc fix instead, my mistake. I will
send a pull request for -rc5. Thanks for pinging.

Jessica

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-17 17:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-02  2:25 [PATCH] taint/module: Fix problems when out-of-kernel driver defines true or false Larry Finger
2017-01-02  5:50 ` Christoph Hellwig
2017-01-02 10:51 ` Petr Mladek
2017-01-04  3:08 ` Jessica Yu
     [not found]   ` <CAP71bdULb5BReYmouqE7CLX3uS=3EdD0t46Wp_uGAFD+hxRRYA@mail.gmail.com>
2017-01-17 17:55     ` Jessica Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).