Luis Chamberlain
480534e030
coredump: fix crash when umh is disabled
commit 3740d93e37902b31159a82da2d5c8812ed825404 upstream.
Commit 64e90a8acb ("Introduce STATIC_USERMODEHELPER to mediate
call_usermodehelper()") added the optiont to disable all
call_usermodehelper() calls by setting STATIC_USERMODEHELPER_PATH to
an empty string. When this is done, and crashdump is triggered, it
will crash on null pointer dereference, since we make assumptions
over what call_usermodehelper_exec() did.
This has been reported by Sergey when one triggers a a coredump
with the following configuration:
```
CONFIG_STATIC_USERMODEHELPER=y
CONFIG_STATIC_USERMODEHELPER_PATH=""
kernel.core_pattern = |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e
```
The way disabling the umh was designed was that call_usermodehelper_exec()
would just return early, without an error. But coredump assumes
certain variables are set up for us when this happens, and calls
ile_start_write(cprm.file) with a NULL file.
[ 2.819676] BUG: kernel NULL pointer dereference, address: 0000000000000020
[ 2.819859] #PF: supervisor read access in kernel mode
[ 2.820035] #PF: error_code(0x0000) - not-present page
[ 2.820188] PGD 0 P4D 0
[ 2.820305] Oops: 0000 [#1] SMP PTI
[ 2.820436] CPU: 2 PID: 89 Comm: a Not tainted 5.7.0-rc1+ #7
[ 2.820680] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190711_202441-buildvm-armv7-10.arm.fedoraproject.org-2.fc31 04/01/2014
[ 2.821150] RIP: 0010:do_coredump+0xd80/0x1060
[ 2.821385] Code: e8 95 11 ed ff 48 c7 c6 cc a7 b4 81 48 8d bd 28 ff
ff ff 89 c2 e8 70 f1 ff ff 41 89 c2 85 c0 0f 84 72 f7 ff ff e9 b4 fe ff
ff <48> 8b 57 20 0f b7 02 66 25 00 f0 66 3d 00 8
0 0f 84 9c 01 00 00 44
[ 2.822014] RSP: 0000:ffffc9000029bcb8 EFLAGS: 00010246
[ 2.822339] RAX: 0000000000000000 RBX: ffff88803f860000 RCX: 000000000000000a
[ 2.822746] RDX: 0000000000000009 RSI: 0000000000000282 RDI: 0000000000000000
[ 2.823141] RBP: ffffc9000029bde8 R08: 0000000000000000 R09: ffffc9000029bc00
[ 2.823508] R10: 0000000000000001 R11: ffff88803dec90be R12: ffffffff81c39da0
[ 2.823902] R13: ffff88803de84400 R14: 0000000000000000 R15: 0000000000000000
[ 2.824285] FS: 00007fee08183540(0000) GS:ffff88803e480000(0000) knlGS:0000000000000000
[ 2.824767] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2.825111] CR2: 0000000000000020 CR3: 000000003f856005 CR4: 0000000000060ea0
[ 2.825479] Call Trace:
[ 2.825790] get_signal+0x11e/0x720
[ 2.826087] do_signal+0x1d/0x670
[ 2.826361] ? force_sig_info_to_task+0xc1/0xf0
[ 2.826691] ? force_sig_fault+0x3c/0x40
[ 2.826996] ? do_trap+0xc9/0x100
[ 2.827179] exit_to_usermode_loop+0x49/0x90
[ 2.827359] prepare_exit_to_usermode+0x77/0xb0
[ 2.827559] ? invalid_op+0xa/0x30
[ 2.827747] ret_from_intr+0x20/0x20
[ 2.827921] RIP: 0033:0x55e2c76d2129
[ 2.828107] Code: 2d ff ff ff e8 68 ff ff ff 5d c6 05 18 2f 00 00 01
c3 0f 1f 80 00 00 00 00 c3 0f 1f 80 00 00 00 00 e9 7b ff ff ff 55 48 89
e5 <0f> 0b b8 00 00 00 00 5d c3 66 2e 0f 1f 84 0
0 00 00 00 00 0f 1f 40
[ 2.828603] RSP: 002b:00007fffeba5e080 EFLAGS: 00010246
[ 2.828801] RAX: 000055e2c76d2125 RBX: 0000000000000000 RCX: 00007fee0817c718
[ 2.829034] RDX: 00007fffeba5e188 RSI: 00007fffeba5e178 RDI: 0000000000000001
[ 2.829257] RBP: 00007fffeba5e080 R08: 0000000000000000 R09: 00007fee08193c00
[ 2.829482] R10: 0000000000000009 R11: 0000000000000000 R12: 000055e2c76d2040
[ 2.829727] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[ 2.829964] CR2: 0000000000000020
[ 2.830149] ---[ end trace ceed83d8c68a1bf1 ]---
```
Cc: <stable@vger.kernel.org> # v4.11+
Fixes: 64e90a8acb ("Introduce STATIC_USERMODEHELPER to mediate call_usermodehelper()")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199795
Reported-by: Tony Vroon <chainsaw@gentoo.org>
Reported-by: Sergey Kvachonok <ravenexp@gmail.com>
Tested-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20200416162859.26518-1-mcgrof@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
2020-05-14 07:58:27 +02:00 |
| .. |
|
bpf
|
cpumap: Avoid warning when CONFIG_DEBUG_PER_CPU_MAPS is enabled
|
2020-05-02 08:48:51 +02:00 |
|
cgroup
|
cgroup1: don't call release_agent when it is ""
|
2020-04-01 11:01:51 +02:00 |
|
configs
|
|
|
|
debug
|
kgdb: don't use a notifier to enter kgdb at panic; call directly
|
2019-09-25 17:51:40 -07:00 |
|
dma
|
dma-direct: fix data truncation in dma_direct_get_required_mask()
|
2020-04-29 16:33:00 +02:00 |
|
events
|
perf/core: fix parent pid/tid in task exit events
|
2020-05-02 08:48:52 +02:00 |
|
gcov
|
kernel/gcov/fs.c: gcov_seq_next() should increase position index
|
2020-04-29 16:33:00 +02:00 |
|
irq
|
genirq/debugfs: Add missing sanity checks to interrupt injection
|
2020-04-17 10:50:11 +02:00 |
|
livepatch
|
livepatch: Nullify obj->mod in klp_module_coming()'s error path
|
2019-08-19 13:03:37 +02:00 |
|
locking
|
locktorture: Print ratio of acquisitions, not failures
|
2020-04-23 10:36:44 +02:00 |
|
power
|
PM: hibernate: Freeze kernel threads in software_resume()
|
2020-05-06 08:15:09 +02:00 |
|
printk
|
printk: queue wake_up_klogd irq_work only if per-CPU areas are ready
|
2020-05-02 08:48:42 +02:00 |
|
rcu
|
rcu: Allow only one expedited GP to run concurrently with wakeups
|
2020-03-05 16:43:50 +01:00 |
|
sched
|
sched/core: Fix reset-on-fork from RT with uclamp
|
2020-05-02 08:48:52 +02:00 |
|
time
|
time/sched_clock: Expire timer in hardirq context
|
2020-04-17 10:50:02 +02:00 |
|
trace
|
tracing: Add a vmalloc_sync_mappings() for safe measure
|
2020-05-14 07:58:25 +02:00 |
|
.gitignore
|
Provide in-kernel headers to make extending kernel easier
|
2019-04-29 16:48:03 +02:00 |
|
acct.c
|
acct_on(): don't mess with freeze protection
|
2019-04-04 21:04:13 -04:00 |
|
async.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
audit.c
|
audit: check the length of userspace generated audit records
|
2020-04-29 16:33:18 +02:00 |
|
audit.h
|
audit/stable-5.3 PR 20190702
|
2019-07-08 18:55:42 -07:00 |
|
audit_fsnotify.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
|
2019-05-30 11:26:37 -07:00 |
|
audit_tree.c
|
fsnotify: switch send_to_group() and ->handle_event to const struct qstr *
|
2019-04-26 13:51:03 -04:00 |
|
audit_watch.c
|
audit_get_nd(): don't unlock parent too early
|
2019-11-10 11:56:55 -05:00 |
|
auditfilter.c
|
audit: fix error handling in audit_data_to_entry()
|
2020-03-05 16:43:42 +01:00 |
|
auditsc.c
|
audit: enforce op for string fields
|
2019-05-28 17:46:43 -04:00 |
|
backtracetest.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
bounds.c
|
|
|
|
capability.c
|
|
|
|
compat.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
|
2019-06-19 17:09:55 +02:00 |
|
configs.c
|
kernel/configs: Replace GPL boilerplate code with SPDX identifier
|
2019-07-30 18:34:15 +02:00 |
|
context_tracking.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
cpu.c
|
cpu/hotplug: Ignore pm_wakeup_pending() for disable_nonboot_cpus()
|
2020-04-17 10:50:11 +02:00 |
|
cpu_pm.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282
|
2019-06-05 17:36:37 +02:00 |
|
crash_core.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 230
|
2019-06-19 17:09:06 +02:00 |
|
crash_dump.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
cred.c
|
keys: Fix request_key() cache
|
2020-01-17 19:48:42 +01:00 |
|
delayacct.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 25
|
2019-05-21 11:52:39 +02:00 |
|
dma.c
|
|
|
|
elfcore.c
|
kernel/elfcore.c: include proper prototypes
|
2019-09-25 17:51:39 -07:00 |
|
exec_domain.c
|
|
|
|
exit.c
|
exit: panic before exit_mm() on global init exit
|
2020-01-09 10:20:01 +01:00 |
|
extable.c
|
extable: Add function to search only kernel exception table
|
2019-08-21 22:23:48 +10:00 |
|
fail_function.c
|
fail_function: no need to check return value of debugfs_create functions
|
2019-06-03 15:49:06 +02:00 |
|
fork.c
|
mm: fork: fix kernel_stack memcg stats for various stack implementations
|
2020-04-01 11:02:03 +02:00 |
|
freezer.c
|
Revert "libata, freezer: avoid block device removal while system is frozen"
|
2019-10-06 09:11:37 -06:00 |
|
futex.c
|
futex: Unbreak futex hashing
|
2020-03-25 08:25:58 +01:00 |
|
gen_kheaders.sh
|
kheaders: substituting --sort in archive creation
|
2019-10-17 09:08:19 +09:00 |
|
groups.c
|
|
|
|
hung_task.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
iomem.c
|
mm/nvdimm: add is_ioremap_addr and use that to check ioremap address
|
2019-07-12 11:05:40 -07:00 |
|
irq_work.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
jump_label.c
|
jump_label: Don't warn on __exit jump entries
|
2019-08-29 15:10:10 +01:00 |
|
kallsyms.c
|
kallsyms: Don't let kallsyms_lookup_size_offset() fail on retrieving the first symbol
|
2019-08-27 16:19:56 +01:00 |
|
kcmp.c
|
|
|
|
Kconfig.freezer
|
treewide: Add SPDX license identifier - Makefile/Kconfig
|
2019-05-21 10:50:46 +02:00 |
|
Kconfig.hz
|
treewide: Add SPDX license identifier - Makefile/Kconfig
|
2019-05-21 10:50:46 +02:00 |
|
Kconfig.locks
|
treewide: Add SPDX license identifier - Makefile/Kconfig
|
2019-05-21 10:50:46 +02:00 |
|
Kconfig.preempt
|
sched/rt, Kconfig: Unbreak def/oldconfig with CONFIG_PREEMPT=y
|
2019-07-22 18:05:11 +02:00 |
|
kcov.c
|
|
|
|
kexec.c
|
kexec_load: Disable at runtime if the kernel is locked down
|
2019-08-19 21:54:15 -07:00 |
|
kexec_core.c
|
kexec: bail out upon SIGKILL when allocating memory.
|
2019-09-25 17:51:40 -07:00 |
|
kexec_elf.c
|
kexec_elf: support 32 bit ELF files
|
2019-09-06 23:58:44 +02:00 |
|
kexec_file.c
|
Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
|
2019-09-28 08:14:15 -07:00 |
|
kexec_internal.h
|
|
|
|
kheaders.c
|
kheaders: Move from proc to sysfs
|
2019-05-24 20:16:01 +02:00 |
|
kmod.c
|
kmod: make request_module() return an error when autoloading is disabled
|
2020-04-17 10:50:22 +02:00 |
|
kprobes.c
|
kprobes: Fix optimize_kprobe()/unoptimize_kprobe() cancellation logic
|
2020-03-12 13:00:09 +01:00 |
|
ksysfs.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 170
|
2019-05-30 11:26:39 -07:00 |
|
kthread.c
|
kthread: make __kthread_queue_delayed_work static
|
2019-10-16 09:20:58 -07:00 |
|
latencytop.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
Makefile
|
Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
|
2019-09-27 19:37:27 -07:00 |
|
module-internal.h
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36
|
2019-05-24 17:27:11 +02:00 |
|
module.c
|
module: avoid setting info->name early in case we can fall back to info->mod->name
|
2020-02-24 08:36:54 +01:00 |
|
module_signature.c
|
MODSIGN: Export module signature definitions
|
2019-08-05 18:39:56 -04:00 |
|
module_signing.c
|
MODSIGN: Export module signature definitions
|
2019-08-05 18:39:56 -04:00 |
|
notifier.c
|
x86/mm: split vmalloc_sync_all()
|
2020-03-25 08:25:58 +01:00 |
|
nsproxy.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
padata.c
|
padata: always acquire cpu_hotplug_lock before pinst->lock
|
2020-04-08 09:08:47 +02:00 |
|
panic.c
|
panic: ensure preemption is disabled during panic()
|
2019-10-07 15:47:19 -07:00 |
|
params.c
|
lockdown: Lock down module params that specify hardware parameters (eg. ioport)
|
2019-08-19 21:54:16 -07:00 |
|
pid.c
|
kernel/pid.c: convert struct pid count to refcount_t
|
2019-07-16 19:23:24 -07:00 |
|
pid_namespace.c
|
proc/sysctl: add shared variables for range check
|
2019-07-18 17:08:07 -07:00 |
|
profile.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ptrace.c
|
ptrace: reintroduce usage of subjective credentials in ptrace_has_cap()
|
2020-01-23 08:22:36 +01:00 |
|
range.c
|
|
|
|
reboot.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
relay.c
|
|
|
|
resource.c
|
mm/memory_hotplug.c: use PFN_UP / PFN_DOWN in walk_system_ram_range()
|
2019-09-24 15:54:09 -07:00 |
|
rseq.c
|
signal: Remove task parameter from force_sig
|
2019-05-27 09:36:28 -05:00 |
|
seccomp.c
|
seccomp: Add missing compat_ioctl for notify
|
2020-04-17 10:50:09 +02:00 |
|
signal.c
|
signal: check sig before setting info in kill_pid_usb_asyncio
|
2020-05-02 08:48:55 +02:00 |
|
smp.c
|
smp: Warn on function calls from softirq context
|
2019-07-20 11:27:16 +02:00 |
|
smpboot.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
smpboot.h
|
|
|
|
softirq.c
|
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
|
2019-07-08 11:01:13 -07:00 |
|
stackleak.c
|
|
|
|
stacktrace.c
|
stacktrace: Don't skip first entry on noncurrent tasks
|
2019-11-04 21:19:25 +01:00 |
|
stop_machine.c
|
stop_machine: Avoid potential race behaviour
|
2019-10-17 12:47:12 +02:00 |
|
sys.c
|
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
|
2019-09-17 12:35:15 -07:00 |
|
sys_ni.c
|
arch: handle arches who do not yet define clone3
|
2019-06-21 01:54:53 +02:00 |
|
sysctl.c
|
kernel: sysctl: make drop_caches write-only
|
2020-01-04 19:18:32 +01:00 |
|
sysctl_binary.c
|
|
|
|
task_work.c
|
|
|
|
taskstats.c
|
taskstats: fix data-race
|
2020-01-09 10:19:54 +01:00 |
|
test_kprobes.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 25
|
2019-05-21 11:52:39 +02:00 |
|
torture.c
|
torture: Remove exporting of internal functions
|
2019-08-01 14:30:22 -07:00 |
|
tracepoint.c
|
The main changes in this release include:
|
2019-07-18 11:51:00 -07:00 |
|
tsacct.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
|
2019-05-30 11:26:37 -07:00 |
|
ucount.c
|
proc/sysctl: add shared variables for range check
|
2019-07-18 17:08:07 -07:00 |
|
uid16.c
|
|
|
|
uid16.h
|
|
|
|
umh.c
|
coredump: fix crash when umh is disabled
|
2020-05-14 07:58:27 +02:00 |
|
up.c
|
smp: Remove smp_call_function() and on_each_cpu() return values
|
2019-06-23 14:26:26 +02:00 |
|
user-return-notifier.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
user.c
|
Keyrings namespacing
|
2019-07-08 19:36:47 -07:00 |
|
user_namespace.c
|
Keyrings namespacing
|
2019-07-08 19:36:47 -07:00 |
|
utsname.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
utsname_sysctl.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
|
2019-06-05 17:37:17 +02:00 |
|
watchdog.c
|
watchdog/softlockup: Enforce that timestamp is valid on boot
|
2020-02-24 08:36:52 +01:00 |
|
watchdog_hld.c
|
kernel/watchdog_hld.c: hard lockup message should end with a newline
|
2019-04-19 09:46:05 -07:00 |
|
workqueue.c
|
workqueue: don't use wq_select_unbound_cpu() for bound works
|
2020-03-18 07:17:50 +01:00 |
|
workqueue_internal.h
|
sched/core, workqueues: Distangle worker accounting from rq lock
|
2019-04-16 16:55:15 +02:00 |