lkml.org 
[lkml]   [2019]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Fix a panic when core_pattern is set to "| prog..."
Date
Am Montag, 16. Dezember 2019, 19:37:07 CET schrieb Andi Kleen:
> Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> writes:
>
> > Hi,
> >
> > if the /proc/sys/kernel/core_pattern is set with a space between '|' and the
> > program and later a core file should be written the kernel panics.
> > This happens because in format_corename() the first part of cn.corename
> > is set to '\0' and later call_usermodehelper_exec() exits because of an
> > empty command path but with return 0. But no pipe is created and thus
> > cprm.file == NULL.
> > This leads in file_start_write() to the panic because of dereferencing
> > file_inode(file)->i_mode.
>
> It would seem better to just skip the spaces and DTRT?

This would be the normal case but the mistake happened accidently. And I was
really surprised to see the system panic after the segfault of a user program.
And it took a little bit time to find the cause ...

Dietmar.

> Of course doing the error check properly is a good idea anyways.
>
> -Andi




\
 
 \ /
  Last update: 2019-12-17 13:57    [W:1.002 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site