Re: Doubt: core not dumped when binary give up root privileges.

From: Alan Cox (alan_at_lxorguk.ukuu.org.uk)
Date: 08/26/03

  • Next message: David Howells: "Re: authentication / encryption key retention"
    To: Alexandre Pereira Nunes <alex@PolesApart.wox.org>
    Date:	26 Aug 2003 17:04:08 +0100
    
    

    On Gwe, 2003-08-22 at 20:25, Alexandre Pereira Nunes wrote:
    > The program explicitly sets RLIMIT_CORE to RLIM_INFINITY when still
    > running with uid 0.

    The kernel assumes a core image from something that was priviledged may
    be unsafe.

    > If instead of calling the program as root, I call it from the non-priv
    > uid in question, if it crashes, it dumps core on the mentioned dir.
    > That's the desired behaviour, since I can then take the core and debug.
    > But if I run it as root (in fact, I would have to), and it crashes (or
    > is forced to ,by means of kill -SEGV), after it gives up root
    > credentials, it won't leave a core dump file, which in turn means I
    > cannot debug it later.
    >
    > Any ideas?

    2.4-ac has support for enabling setuid core dumps and setting the dump
    path, so you can write such dumps to /root/dumps and the kernel will
    make them root accessible only.

    The 2.6 test tree and Marcelo 2.4 don't currently support this

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: David Howells: "Re: authentication / encryption key retention"

    Relevant Pages

    • Re: [PATCH] ELF core dump options
      ... segments are dumped in ELF core files. ... can be set to have private file mappings dumped in their entirety. ... This dumps the first page of a read-only private file mapping if it ...
      (Linux-Kernel)
    • Re: [PATCH] [3/3] Support piping into commands in /proc/sys/kernel/core_pattern
      ... Using the infrastructure created in previous patches implement support ... to pipe core dumps into programs. ...
      (Linux-Kernel)
    • Re: Problem with Solaris 9 patch 112970-07
      ... >have the same multi-threaded RPC server running on two Solaris 9 ... It turns out that we've had similar core dumps before that patch ... so the patch revision is not implicated in the problem. ...
      (comp.unix.solaris)
    • Re: How to make a core dump?
      ... so the simliest way found is to use gdb command "gcore". ... It dumps ... core by copying memory and making all nessesary headers ... not relying on kernel ability to dump core. ...
      (Focus-Linux)
    • Re: Announce: Linux-next (Or Andrews dream :-))
      ... And the rate of change in each major portion of the kernel (drivers, ... arch, core, network, etc) is exactly proportional to the amount of the ... and we also tried to simply even re-architect the whole tree so ... And we fix them up, ...
      (Linux-Kernel)