All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Waechtler <pwaechtler@mac.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] coredump - as root not only if euid switched
Date: Fri, 23 Apr 2004 09:14:32 +0200	[thread overview]
Message-ID: <8046885.1082704472016.JavaMail.pwaechtler@mac.com> (raw)

 
On Thursday, April 22, 2004, at 10:05PM, Linus Torvalds <torvalds@osdl.org> wrote:

>
>
>On Thu, 22 Apr 2004, Peter W�chtler wrote:
>>
>> > hm, OK.  There's a window in which someone can come in and recreate the
>> > file, but the open is using O_EXCL|O_CREATE so that seems safe enough.
>> 
>> So here is the updated patch with an open coded call to sys_unlink
>
>Aughr. 
>
>Wouldn't it be much nicer to just refuse to overwrite files owned by 
>anybody else?
>
>In other words, I'd much rather see a patch that is a much simpler one, 
>which just says: if we opened an existing file, we won't touch it if we 
>weren't the owners of it.
>
>That should be safe for root _and_ it should be safe for people who 
>already had a file descriptor open previously (hey, if the previous 
>root-owned core-file was world readable, then what else is new?)
>

the previous core was owned by user.donttellyourwisdom
The root process happily dumps it's core into it, doesn't change 
ownership nor permissions.

>Tell me why this isn't simpler?
>
I can't it's simpler.
If you are interested in the core (you don't because you don't make 
errors, you don't even use debuggers but change the VM ;> )
you get it, otherwise you have an old one.

>
>---
>--- 1.111/fs/exec.c	Wed Apr 21 02:11:57 2004
>+++ edited/fs/exec.c	Thu Apr 22 13:03:27 2004
>@@ -1378,6 +1378,8 @@
> 	inode = file->f_dentry->d_inode;
> 	if (inode->i_nlink > 1)
> 		goto close_fail;	/* multiple links - don't dump */
>+	if (inode->i_uid != current->euid || inode->i_gid != current->egid)
>+		goto close_fail;
> 	if (d_unhashed(file->f_dentry))
> 		goto close_fail;
> 
>
>

             reply	other threads:[~2004-04-23  7:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-23  7:14 Peter Waechtler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-04-23 15:35 [PATCH] coredump - as root not only if euid switched Albert Cahalan
2004-04-23 19:14 ` Peter Wächtler
2004-04-23 17:22   ` Albert Cahalan
2004-04-23  7:46 Peter Waechtler
2004-04-23  7:16 Peter Waechtler
2004-04-23 17:10 ` Chris Wright
2004-04-23 19:05   ` Peter Wächtler
2004-04-22  9:40 Peter Waechtler
2004-04-22  9:56 ` Andrew Morton
2004-04-22 19:43   ` Peter Wächtler
2004-04-22 19:53     ` Chris Wright
2004-04-22 20:05     ` Linus Torvalds
2004-04-22  8:51 Peter Waechtler
2004-04-22  8:55 ` Andrew Morton
2004-04-21 19:20 Peter Wächtler
2004-04-22  1:18 ` Andrew Morton

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=8046885.1082704472016.JavaMail.pwaechtler@mac.com \
    --to=pwaechtler@mac.com \
    --cc=akpm@osdl.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.