lkml.org 
[lkml]   [2013]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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
>



\
 
 \ /
  Last update: 2013-05-16 21:01    [W:0.401 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site