Ptrace hole / Linux 2.2.25
Quoted 5 lines · Alan Cox
Vulnerability: CAN-2003-0127
The Linux 2.2 and Linux 2.4 kernels have a flaw in ptrace. This hole allows local users to obtain full privileges. Remote exploitation of this hole is not possible. Linux 2.5 is not believed to be vulnerable.
The patch breaks /proc/<pid>/cmdline and /proc/<pid>/environ for 'non dumpable' processes, even for root.
We need to access theses proc files for processes monitoring.
Included is a patch to restore this functionnality for root.
Any comments ?
(See attached file: cmdline_environ_fix.diff)
--
Mathieu Lafon - Arkoon Network Security
kernel/ptrace.c +1 -1
@@ -140,7 +140,7 @@/* Worry about races with exit() */ task_lock (tsk); mm = tsk->mm; -if (!is_dumpable (tsk) || (&init_mm == mm)) +if ((!is_dumpable (tsk) || (&init_mm == mm)) && (current->uid !=0 )) mm =NULL ;if (mm)atomic_inc (&mm->mm_users);