Skip to contentSkip to conversation

futex: avoid kernel taint caused by get_robust_list

PATCH In review Paul Gortmaker 3 participants 5 messages Feb 15, 2013 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 futex: avoid kernel taint caused by get_robust_list

commit ec0c4274e33c0373e476b73e01995c53128f1257 ("futex: Mark get_robust_list as deprecated") added these two WARN_ONCE calls.

However, WARN_ONCE taints the kernel, and we shouldn't be allowing any user who wanders by to do this. For example, the system fuzzer "trinity" uses the tainted state as a metric for when to stop, assuming that it has caused significant wreckage (and indeed that tool is what actually led me to this change).

The ability to deprecate this code has been called into question[1], but if that remains to be finalized, then making this change in the interim seems to make sense.

[1] http://lkml.indiana.edu/hypermail/linux/kernel/1208.0/01081.html

Cc Dave Jones <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Kees Cook <[email protected]>
Cc Thomas Gleixner <[email protected]>

---

[Alternatively, someone can simply apply Richard's original revert:
http://permalink.gmane.org/gmane.linux.kernel.hardened.devel/506
Either way, I think the WARN_ONCE needs to go away. ]

 kernel/futex.c        | 2 +-
 kernel/futex_compat.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
kernel/futex.c +1 -1
index 19eb089..e1aede2 100644
@@ -2471,7 +2471,7 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
 	if (!futex_cmpxchg_enabled)
 		return -ENOSYS;
 
-	WARN_ONCE(1, "deprecated: get_robust_list will be deleted in 2013.\n");
+	printk_once(KERN_WARNING "deprecated: get_robust_list will be deleted in 2013.\n");
 
 	rcu_read_lock();
 
kernel/futex_compat.c +1 -1
index 83e368b..618d2db 100644
@@ -142,7 +142,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
 	if (!futex_cmpxchg_enabled)
 		return -ENOSYS;
 
-	WARN_ONCE(1, "deprecated: get_robust_list will be deleted in 2013.\n");
+	printk_once(KERN_WARNING "deprecated: get_robust_list will be deleted in 2013.\n");
 
 	rcu_read_lock();
 
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 13 lines · Paul Gortmaker

commit ec0c4274e33c0373e476b73e01995c53128f1257 ("futex: Mark get_robust_list as deprecated") added these two WARN_ONCE calls.

However, WARN_ONCE taints the kernel, and we shouldn't be allowing any user who wanders by to do this. For example, the system fuzzer "trinity" uses the tainted state as a metric for when to stop, assuming that it has caused significant wreckage (and indeed that tool is what actually led me to this change).

The ability to deprecate this code has been called into question[1], but if that remains to be finalized, then making this change in the interim seems to make sense.

Quoted 8 lines

[1] http://lkml.indiana.edu/hypermail/linux/kernel/1208.0/01081.html

Cc Dave Jones <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Kees Cook <[email protected]>
Cc Thomas Gleixner <[email protected]>

I Acked the original revert. I thought there was agreement that it was needed for checkpointing to work?

-Kees

Signature · 2 lines
Kees Cook
Chrome OS Security
#2 lore raw
Quoted 24 lines · Kees Cook
Quoted 13 lines · Paul Gortmaker

commit ec0c4274e33c0373e476b73e01995c53128f1257 ("futex: Mark get_robust_list as deprecated") added these two WARN_ONCE calls.

However, WARN_ONCE taints the kernel, and we shouldn't be allowing any user who wanders by to do this. For example, the system fuzzer "trinity" uses the tainted state as a metric for when to stop, assuming that it has caused significant wreckage (and indeed that tool is what actually led me to this change).

The ability to deprecate this code has been called into question[1], but if that remains to be finalized, then making this change in the interim seems to make sense.

Quoted 8 lines

[1] http://lkml.indiana.edu/hypermail/linux/kernel/1208.0/01081.html

Cc Dave Jones <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Kees Cook <[email protected]>
Cc Thomas Gleixner <[email protected]>
Quoted 2 lines

I Acked the original revert. I thought there was agreement that it was needed for checkpointing to work?

There were several acks in the original thread, but for some unknown reason (at least unknown to me and Richard), it never made it in tree...

P.
--

Quoted 3 lines

-Kees

#3 lore raw

Hi Andrew,

Is this revert something you would be willing to take?

-Kees

Quoted 30 lines · Paul Gortmaker
Quoted 24 lines · Kees Cook
Quoted 13 lines · Paul Gortmaker

commit ec0c4274e33c0373e476b73e01995c53128f1257 ("futex: Mark get_robust_list as deprecated") added these two WARN_ONCE calls.

However, WARN_ONCE taints the kernel, and we shouldn't be allowing any user who wanders by to do this. For example, the system fuzzer "trinity" uses the tainted state as a metric for when to stop, assuming that it has caused significant wreckage (and indeed that tool is what actually led me to this change).

The ability to deprecate this code has been called into question[1], but if that remains to be finalized, then making this change in the interim seems to make sense.

Quoted 8 lines

[1] http://lkml.indiana.edu/hypermail/linux/kernel/1208.0/01081.html

Cc Dave Jones <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Kees Cook <[email protected]>
Cc Thomas Gleixner <[email protected]>
Quoted 2 lines

I Acked the original revert. I thought there was agreement that it was needed for checkpointing to work?

There were several acks in the original thread, but for some unknown reason (at least unknown to me and Richard), it never made it in tree...

Signature · 2 lines
Kees Cook
Chrome OS Security