mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Peter Waechtler <pwaechtler@mac.com>
Cc: linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: [PATCH] coredump - as root not only if euid switched
Date: Thu, 22 Apr 2004 01:55:56 -0700	[thread overview]
Message-ID: <20040422015556.55b4db0a.akpm@osdl.org> (raw)
In-Reply-To: <16641351.1082623864205.JavaMail.pwaechtler@mac.com>

Peter Waechtler <pwaechtler@mac.com> wrote:
>
>  >Is it not possible to call sys_unlink() directly from there?  Something like
>  >
>  >long kernel_unlink(const char *name)
>  >{
>  >	mm_segment_t old_fs = get_fs();
>  >	long ret;
>  >
>  >	set_fs(KERNEL_DS);
>  >	ret = sys_unlink(name);
>  >	set_fs(old_fs);
>  >	return ret;
>  >}	
> 
>  And you're asking me? ;)

Well someone has to know ;)

>  While getname() has a check for user/kernelspace - do you really
>  care about "the overhead" for a function call level with 1 argument?
>  Uhm, probably if you even care to write this..

It's very small, but heck, we unlink a lot more often than we dump core. 
Most of us, that is.

>  What is the cost for switching the segments?

Teeny.

>  But I agree that sys_unlink should be the fast call and dumping core
>  is the exception :)
> 
>  would fastcall do_unlink() help? I guess the arg is then passed in a
>  register

I've never been able to measure any size or space benefit for fastcall, and
we do it via compiler options kernel-wide nowadays.

The above will work fine.  You can probably just open-code it at the place
where you're unlinking the file.

(why are you trying to unlink the old file anyway?)

  reply	other threads:[~2004-04-22  8:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-22  8:51 Peter Waechtler
2004-04-22  8:55 ` Andrew Morton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-04-23 15:35 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-23  7:14 Peter Waechtler
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-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=20040422015556.55b4db0a.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pwaechtler@mac.com \
    --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®