Skip to content

Commit 5eb7c0d

Browse files
lwfingerJessica Yu
authored andcommitted
taint/module: Fix problems when out-of-kernel driver defines true or false
Commit 7fd8329 ("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: 7fd8329 ("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> Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Reviewed-by: Petr Mladek <pmladek@suse.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Jessica Yu <jeyu@redhat.com>
1 parent 0c744ea commit 5eb7c0d

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

include/linux/kernel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,8 @@ extern enum system_states {
514514
#define TAINT_FLAGS_COUNT 16
515515

516516
struct taint_flag {
517-
char true; /* character printed when tainted */
518-
char false; /* character printed when not tainted */
517+
char c_true; /* character printed when tainted */
518+
char c_false; /* character printed when not tainted */
519519
bool module; /* also show as a per-module taint flag */
520520
};
521521

kernel/module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ static size_t module_flags_taint(struct module *mod, char *buf)
11451145

11461146
for (i = 0; i < TAINT_FLAGS_COUNT; i++) {
11471147
if (taint_flags[i].module && test_bit(i, &mod->taints))
1148-
buf[l++] = taint_flags[i].true;
1148+
buf[l++] = taint_flags[i].c_true;
11491149
}
11501150

11511151
return l;

kernel/panic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ const char *print_tainted(void)
355355
for (i = 0; i < TAINT_FLAGS_COUNT; i++) {
356356
const struct taint_flag *t = &taint_flags[i];
357357
*s++ = test_bit(i, &tainted_mask) ?
358-
t->true : t->false;
358+
t->c_true : t->c_false;
359359
}
360360
*s = 0;
361361
} else

0 commit comments

Comments
 (0)