Bug 199795 - CONFIG_STATIC_USERMODEHELPER_PATH="" causes NULL pointer dereference in do_coredump() when kernel.core_pattern is set to a pipe.
Summary: CONFIG_STATIC_USERMODEHELPER_PATH="" causes NULL pointer dereference in do_co...
Status: NEW
Alias: None
Product: Process Management
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 low
Assignee: process_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-22 06:08 UTC by Sergey Kvachonok
Modified: 2020-04-16 05:12 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.16.10
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Oops dmesg (2.50 KB, text/plain)
2018-05-22 06:08 UTC, Sergey Kvachonok
Details
0001-umh-always-return-error-when-helper-was-not-called.patch (5.52 KB, patch)
2020-04-15 07:00 UTC, Sergei Trofimovich
Details | Diff

Description Sergey Kvachonok 2018-05-22 06:08:28 UTC
Created attachment 276125 [details]
Oops dmesg

My kernel config contains:

CONFIG_STATIC_USERMODEHELPER=y
CONFIG_STATIC_USERMODEHELPER_PATH=""

My system is using systemd, which sysctls

kernel.core_pattern = |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e

at the boot time.

Running a SEGFAULT-ing program triggers:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
IP: do_coredump+0xba0/0xe20

Full dmesg log attached.

Running

sysctl kernel.core_pattern = /tmp/core.%e.%p.%h.%t

makes the oops go away.

I understand that my kernel was configured incorrectly for use with systemd,
but it should not cause a kernel oops in any case.
A helpful error message would be much better.
Comment 1 Sergei Trofimovich 2020-04-15 07:00:56 UTC
Created attachment 288461 [details]
0001-umh-always-return-error-when-helper-was-not-called.patch
Comment 2 Sergei Trofimovich 2020-04-15 07:02:06 UTC
Sent patch as https://lkml.org/lkml/2020/4/15/116
Comment 3 Luis Chamberlain 2020-04-16 05:12:40 UTC
Thanks for the patch and bug report! I provided an alternative patch. Let's review on the thread I replied to, I Cc'd other possible stakeholders.

Note You need to log in before you can comment on or make changes to this bug.