2005-09-16 15:15:38

by Michael Kerrisk

[permalink] [raw]
Subject: [patch 2.6.14-rc1] 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


--- linux-2.6.14-rc1/kernel/sys.c 2005-09-15 08:21:30.000000000 +0200
+++ linux-2.6.14-rc1-mod/kernel/sys.c 2005-09-16 16:55:29.000000000 +0200
@@ -1729,6 +1729,5 @@
break;
case PR_GET_DUMPABLE:
- if (current->mm->dumpable)
- error = 1;
+ error = current->mm->dumpable;
break;
case PR_SET_DUMPABLE:

--
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse f?r Mail, Message, More +++


2005-09-16 15:23:54

by Alan Cox

[permalink] [raw]
Subject: Re: [patch 2.6.14-rc1] PR_GET_DUMPABLE returns incorrect info

On Fri, Sep 16, 2005 at 05:15:36PM +0200, Michael Kerrisk wrote:
> 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