From: Ingo Molnar <mingo@elte.hu>
To: Roland McGrath <roland@redhat.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>,
lkml <linux-kernel@vger.kernel.org>,
systemtap <systemtap@sources.redhat.com>,
DLE <dle-develop@lists.sourceforge.net>,
Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
Andrew Morton <akpm@linux-foundation.org>,
Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH -tip 1/3] Pass mm->flags to binfmt core_dump for bitflag consistency
Date: Fri, 13 Nov 2009 23:23:00 -0000 [thread overview]
Message-ID: <20091113232307.GB21666@elte.hu> (raw)
In-Reply-To: <20091113231602.2DD2C100E@magilla.sf.frob.com>
* Roland McGrath <roland@redhat.com> wrote:
> To clarify, proc_coredump_filter_write() is the one place that can
> change mm->flags during a core dump. I don't think any other is
> possible while all the other tasks sharing that mm are prevented from
> running. Is there any other way that mm->flags might change during
> do_coredump()?
>
> I don't see anything wrong with this change. But (assuming that is
> the only case), there is another approach we could take instead. That
> is, have proc_coredump_filter_write() do:
>
> down_read(&mm->mmap_sem);
> ret = mm->core_state ? -EBUSY : 0;
> up_read(&mm->mmap_sem);
this would fix the (probably harmless) race too, but isnt the whole
approach taken by the patch more robust, i.e. to take a snapshot of
mm->flags value and pass it along coredump processing?
That makes it evidently immutable in the future too. It also makes the
code a bit easier to read IMO - instead of get_dumpable() we use the
mm_flags.
The only other observation i have is that for this parameter set:
long signr, struct pt_regs *regs, struct file *file,
unsigned long limit, unsigned long mm_flags)
we should probably introduce a coredump parameter struct, and pass that
along:
struct coredump_params {
long signr;
struct pt_regs *regs;
struct file *file;
unsigned long limit;
unsigned long mm_flags;
}
Had this been done in the past this present patch would be a lot simpler
as well: we could have added mm_flags to coredump_params, instead of
having to propagate it through ~6 function interface surfaces.
Thanks,
Ingo
next prev parent reply other threads:[~2009-11-13 23:23 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 22:52 Masami Hiramatsu
2009-11-13 22:52 ` [PATCH -tip 3/3] Add get_signal tracepoint Masami Hiramatsu
2009-11-13 23:53 ` Roland McGrath
2009-11-14 0:12 ` Ingo Molnar
2009-11-16 21:52 ` Masami Hiramatsu
2009-11-16 22:11 ` Roland McGrath
2009-11-16 22:40 ` Masami Hiramatsu
2009-11-16 23:01 ` Roland McGrath
2009-11-16 23:46 ` Masami Hiramatsu
2009-11-17 6:03 ` Ingo Molnar
2009-11-17 15:25 ` Masami Hiramatsu
2009-11-14 0:29 ` Masami Hiramatsu
2009-11-13 22:52 ` [PATCH -tip 2/3] Add coredump tracepoint Masami Hiramatsu
2009-11-13 23:39 ` Roland McGrath
2009-11-14 0:00 ` Masami Hiramatsu
2009-11-14 0:02 ` Ingo Molnar
2009-11-14 0:06 ` Roland McGrath
2009-11-14 0:14 ` Ingo Molnar
2009-11-14 1:49 ` Roland McGrath
2009-11-14 0:26 ` Masami Hiramatsu
2009-11-13 23:09 ` [PATCH -tip 1/3] Pass mm->flags to binfmt core_dump for bitflag consistency Andrew Morton
2009-11-13 23:25 ` Ingo Molnar
2009-11-13 23:45 ` Masami Hiramatsu
2009-11-13 23:16 ` Roland McGrath
2009-11-13 23:23 ` Ingo Molnar [this message]
2009-11-13 23:30 ` Roland McGrath
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=20091113232307.GB21666@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=dle-develop@lists.sourceforge.net \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@redhat.com \
--cc=oleg@redhat.com \
--cc=roland@redhat.com \
--cc=systemtap@sources.redhat.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).