mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] Allow core dumps to block devices as well as regular files.
Date: Wed, 16 Mar 2011 15:21:56 +0000	[thread overview]
Message-ID: <1300288916-607-1-git-send-email-rjones@redhat.com> (raw)

Allow core dumps to block devices by allowing the user to name a block
device in core_pattern.  This change also removes the historical
comment which would no longer be accurate.

This is extremely useful when running the kernel in a "captive"
appliance.  There is not necessarily a writable, mounted filesystem
that can be used to catch a core dump, so instead we set aside a
virtual disk for core dumps and allow the kernel to write a core to
that.

This patch was tested by running the modified kernel under qemu (using
libguestfs) and forcing various core dumps to attached virtual disks.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
---
 fs/exec.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index ba99e1a..ee8051a 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2052,11 +2052,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
 			goto close_fail;
 		if (d_unhashed(cprm.file->f_path.dentry))
 			goto close_fail;
-		/*
-		 * AK: actually i see no reason to not allow this for named
-		 * pipes etc, but keep the previous behaviour for now.
-		 */
-		if (!S_ISREG(inode->i_mode))
+		if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))
 			goto close_fail;
 		/*
 		 * Dont allow local users get cute and trick others to coredump
-- 
1.7.4


                 reply	other threads:[~2011-03-16 15:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1300288916-607-1-git-send-email-rjones@redhat.com \
    --to=rjones@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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®