[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <18826.1171969097@redhat.com>
Date: Tue, 20 Feb 2007 10:58:17 +0000
From: David Howells <dhowells@...hat.com>
To: "Kawai, Hidehiro" <hidehiro.kawai.ez@...achi.com>
Cc: Andrew Morton <akpm@...l.org>,
kernel list <linux-kernel@...r.kernel.org>,
Pavel Machek <pavel@....cz>, Robin Holt <holt@....com>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
sugita <yumiko.sugita.yf@...achi.com>,
Satoshi OSHIMA <soshima@...hat.com>,
"Hideo AOKI@...hat" <haoki@...hat.com>
Subject: Re: [PATCH 3/4] coredump: ELF-FDPIC: enable to omit anonymous shared memory
Kawai, Hidehiro <hidehiro.kawai.ez@...achi.com> wrote:
> Core dumping is separated two phases, one is the phase of writing
> headers, the other is the phase of writing memory segments. If the
> coredump_omit_anon_shared setting is changed between these two phases,
> a corrupted core file will be generated because the offsets written
> in headers don't match their bodies. So we need to use the same
> setting in both phases.
Hmmm... Okay.
> I think that locking makes codes complex and generates overhead.
> So I wouldn't like to use lock as far as possible. I think passing
> the flag as an extra argument is the simplest implementation to
> avoid the core file corruption.
Actually, I don't think the locking is that hard or that complex.
int do_coredump(long signr, int exit_code, struct pt_regs * regs)
{
<setup vars>
down_read(&coredump_settings_sem);
...
fail:
up_read(&coredump_settings_sem);
return retval;
}
And:
static ssize_t proc_coredump_omit_anon_shared_write(struct file *file,
const char __user *buf,
size_t count,
loff_t *ppos)
{
<setup vars>
down_write(&coredump_settings_sem);
...
out_no_task:
up_write(&coredump_settings_sem);
return ret;
}
The same could be applied to all controls that change the coredumping
variables, in particular the sysctl for core_pattern could be wrapped so as to
remove one of the reliances on lock_kernel() and the lock_kernel pair could be
removed from do_coredump().
David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists