From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Al Viro <viro@ftp.linux.org.uk>
Subject: Re: [PATCH] Fix a panic when core_pattern is set to "| prog..."
Date: Tue, 17 Dec 2019 13:56:25 +0100 [thread overview]
Message-ID: <7309912.xQAL2Br30t@amur.mch.fsc.net> (raw)
In-Reply-To: <87r214unfw.fsf@linux.intel.com>
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
prev parent reply other threads:[~2019-12-17 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-16 13:48 [PATCH] Fix a panic when core_pattern is set to "| prog..." Dietmar Hahn
2019-12-16 18:37 ` Andi Kleen
2019-12-17 12:56 ` Dietmar Hahn [this message]
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=7309912.xQAL2Br30t@amur.mch.fsc.net \
--to=dietmar.hahn@ts.fujitsu.com \
--cc=ak@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/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