Skip to contentSkip to conversation

PR_GET_DUMPABLE returns incorrect info

PATCH In review Michael Kerrisk 2 participants 2 messages Sep 16, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PR_GET_DUMPABLE returns incorrect info

Andrew,

2.6.13 incorporated Alan Cox's patch for /proc/sys/fs/suid_dumpable (one version of this patch can be found here
http://marc.theaimsgroup.com/?l=linux-kernel&m=109647550421014&w=2 ). This patch also made corresponding changes in kernel/sys.c to change the prctl() PR_SET_DUMPABLE operation so that the permitted range of 'arg2' was modified from 0..1 to 0..2.

However, a corresponding change was not made for
PR_GET_DUMPABLE: if the dumpable flag is non-zero, then PR_GET_DUMPABLE always returns 1, so that the caller can't determine the true setting of this flag.

I suggest the following small patch. Perhaps Alan has comments.

Cheers,

Michael

kernel/sys.c 2005-09-16 16:55:29.000000000 +0200 renamed from kernel/sys.c 2005-09-15 08:21:30.000000000 +0200 +1 -2
@@ -1729,6 +1729,5 @@
                        break;
                case PR_GET_DUMPABLE:
-                       if (current->mm->dumpable)
-                               error = 1;
+                       error = current->mm->dumpable;
                        break;
                case PR_SET_DUMPABLE:
Signature · 2 lines
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++
#1 lore raw
Quoted 1 line · Michael Kerrisk

I suggest the following small patch. Perhaps Alan has comments.

When it went into 2.4-ac I didnt want to expose a value to the user space that wasn't in the upstream kernel as this was all done for RHEL3 originally.

The change makes total sense to me