From: "Randy.Dunlap" <rddunlap@osdl.org>
To: Alan Cox <alan@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, torvalds@osdl.org
Subject: Re: Patch for comment: setuid core dumps
Date: Mon, 27 Sep 2004 13:37:58 -0700 [thread overview]
Message-ID: <20040927133758.2be9dc5a.rddunlap@osdl.org> (raw)
In-Reply-To: <20040927202616.GA22228@devserv.devel.redhat.com>
| Opinions, bugs, reviews, fan mail ?
|
|
| @@ -1383,6 +1389,17 @@
| up_write(&mm->mmap_sem);
| goto fail;
| }
| +
| + /*
| + * We cannot trust fsuid as being the "true" uid of the
| + * process nor do we know its entire history. We only know it
| + * was tainted so we dump it as root in mode 2.
| + */
| + if (mm->dumpable == 2) /* Setuid core dump mode */
Use something other than hard-coded '2'.
| + {
| + flag = O_EXCL; /* Stop rewrite attacks */
| + current->fsuid = 0; /* Dump root private */
| + }
| mm->dumpable = 0;
| init_completion(&mm->core_done);
| current->signal->group_exit = 1;
| diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.9rc2/include/linux/sysctl.h linux-2.6.9rc2/include/linux/sysctl.h
| --- linux.vanilla-2.6.9rc2/include/linux/sysctl.h 2004-09-14 14:22:57.000000000 +0100
| +++ linux-2.6.9rc2/include/linux/sysctl.h 2004-09-27 16:05:39.889981776 +0100
| @@ -134,6 +134,7 @@
| KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */
| KERN_HZ_TIMER=65, /* int: hz timer on or off */
| KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */
| + KERN_SETUID_DUMPABLE=67, /* int: unknown nmi panic flag */
Fix comment.
| @@ -1681,7 +1681,7 @@
| error = 1;
| break;
| case PR_SET_DUMPABLE:
| - if (arg2 != 0 && arg2 != 1) {
| + if (arg2 < 0 || arg2 > 2) {
| error = -EINVAL;
| break;
| }
The suid_dumpable possible values deserve an enum or #defines
instead of hard-coded values.
Otherwise makes sense to me & looks good on a quick look.
--
~Randy
MOTD: Always include version info.
(Again. Sometimes I think ln -s /usr/src/linux/.config .signature)
next prev parent reply other threads:[~2004-09-27 20:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-27 20:26 Alan Cox
2004-09-27 20:37 ` Randy.Dunlap [this message]
2004-09-27 21:03 ` Chris Wright
2004-09-27 21:10 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040927133758.2be9dc5a.rddunlap@osdl.org \
--to=rddunlap@osdl.org \
--cc=akpm@osdl.org \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®