Messages in this thread | | | Date | Thu, 16 May 2013 20:38:53 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH 7/6] coredump: avoid the uninitialized cn->corename if core_pattern is empty |
| |
off-topic...
Perhaps do_coredump() should warn if filp_open() fails?
And I'd wish I could understand d_unhashed() check...
And why filp_open() uses O_RDWR passed as hardcoded 2.
On 05/16, Oleg Nesterov wrote: > > If core_pattern is "" or "|", cn->corename is used uninitialized > by filp_open() or call_usermodehelper_exec(). > > Signed-off-by: Oleg Nesterov <oleg@redhat.com> > --- > fs/coredump.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/fs/coredump.c b/fs/coredump.c > index 5968064..72f816d 100644 > --- a/fs/coredump.c > +++ b/fs/coredump.c > @@ -165,6 +165,7 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm) > cn->corename = NULL; > if (expand_corename(cn, core_name_size)) > return -ENOMEM; > + cn->corename[0] = '\0'; > > if (ispipe) > ++pat_ptr; > -- > 1.5.5.1 >
| |