Go to file
Luis Chamberlain 86e563164d coredump: fix crash when umh is disabled
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 ]---
```

Change-Id: I2ff9dc56aaf8f91aa83724f35e437e236032bb88
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>
Git-commit: 3740d93e37902b31159a82da2d5c8812ed825404
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Prateek Sood <prsood@codeaurora.org>
2020-09-08 01:59:16 -07:00
arch defconfig: msm: Enable BCL sensor for SDM660 2020-09-04 09:26:39 -07:00
block Merge "ANDROID: block: backport the ability to specify max_dun_bytes" 2020-07-25 03:20:36 -07:00
certs Merge remote-tracking branch 'origin/tmp-441e17f' into msm-kona 2018-09-05 14:58:16 -07:00
crypto Merge android-4.19.110 (1984fff) into msm-4.19 2020-05-23 05:08:22 -07:00
Documentation BACKPORT: FROMLIST: fscrypt: add support for IV_INO_LBLK_32 policies 2020-07-25 21:10:18 +05:30
drivers Merge "soc: qcom: Fix mhi_qdss mode permission issue" 2020-09-07 21:26:51 -07:00
firmware Fix built-in early-load Intel microcode alignment 2020-01-23 08:21:29 +01:00
fs coredump: fix crash when umh is disabled 2020-09-08 01:59:16 -07:00
include Merge "mm: fix the page_owner initializing issue for arm32" 2020-09-04 04:11:02 -07:00
init mm: fix the page_owner initializing issue for arm32 2020-09-02 16:37:28 +08:00
ipc This is the 4.19.107 stable release 2020-03-03 07:33:01 +01:00
kernel Merge "sched/fair: Improve the scheduler" 2020-09-07 21:26:50 -07:00
lib Merge android-4.19.110 (1984fff) into msm-4.19 2020-05-23 05:08:22 -07:00
LICENSES LICENSES: Add ISC license text 2019-01-10 17:22:01 +02:00
mm Merge "mm: fix the page_owner initializing issue for arm32" 2020-09-04 04:11:02 -07:00
net Merge android-4.19.113 (248555d) into msm-4.19 2020-07-16 18:45:03 +05:30
samples FROMGIT: samples/hw_breakpoint: drop use of kallsyms_lookup_name() 2020-03-12 11:18:49 +00:00
scripts Merge android-4.19.113 (248555d) into msm-4.19 2020-07-16 18:45:03 +05:30
security apparmor: don't try to replace stale label in ptraceme check 2020-06-11 21:13:57 +08:00
sound Merge android-4.19.113 (248555d) into msm-4.19 2020-07-16 18:45:03 +05:30
techpack Revert "techpack: replace type with xtype while searching for sub-dirs" 2019-11-19 07:06:17 -08:00
tools Reverting incrementalfs, power,usb and scheduler changes 2020-07-16 19:29:29 +05:30
usr kbuild: clean compressed initramfs image 2019-10-07 18:57:16 +02:00
virt Merge android-4.19.110 (1984fff) into msm-4.19 2020-05-23 05:08:22 -07:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore .gitignore: Add techpack directory to gitignore 2019-05-06 09:34:35 -07:00
.mailmap libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
abi_gki_aarch64_cuttlefish_whitelist ANDROID: ABI/Whitelist: update for Cuttlefish 2020-02-12 11:11:16 +00:00
abi_gki_aarch64_qcom_whitelist ANDROID: Update ABI whitelist for qcom SoCs 2020-03-06 14:50:51 -08:00
abi_gki_aarch64_whitelist ANDROID: abi_gki_aarch64_whitelist: add module_layout and task_struct 2020-03-05 09:07:15 +00:00
abi_gki_aarch64.xml ANDROID: Bulk update the ABI xml based on the referenced bugs. 2020-04-02 15:51:45 +00:00
Android.bp Example kernel headers header_lib package 2020-01-18 11:53:58 -08:00
AndroidKernel.mk AndroidKernel: add TARGET_PREBUILT_INT_KERNEL_IMAGE 2019-08-02 20:31:09 +08:00
build.config.aarch64 ANDROID: refactor build.config files to remove duplication 2019-10-22 18:27:12 -07:00
build.config.allmodconfig ANDROID: Don't base allmodconfig on gki_defconfig 2019-12-05 12:48:26 +00:00
build.config.allmodconfig.aarch64 ANDROID: Add allmodconfig build.configs for x86_64 and aarch64 2019-11-12 20:55:23 +00:00
build.config.allmodconfig.arm ANDROID: Add build.config files for ARM 32-bit 2020-03-16 17:43:55 +00:00
build.config.allmodconfig.x86_64 ANDROID: Add allmodconfig build.configs for x86_64 and aarch64 2019-11-12 20:55:23 +00:00
build.config.arm ANDROID: Add build.config files for ARM 32-bit 2020-03-16 17:43:55 +00:00
build.config.common ANDROID: clang: update to 10.0.5 2020-03-30 20:08:33 +00:00
build.config.gki ANDROID: gki: Removed cf modules from gki_defconfig 2020-01-31 16:23:38 -08:00
build.config.gki-debug.aarch64 ANDROID: Add build.config.gki-debug.aarch64 2020-03-16 14:29:13 +00:00
build.config.gki-debug.x86_64 ANDROID: Add build.config.gki-debug.x86_64 2020-03-16 14:29:13 +00:00
build.config.gki.aarch64 ANDROID: Add ABI Whitelist for qcom 2020-02-28 23:45:43 +00:00
build.config.gki.x86_64 ANDROID: refactor build.config files to remove duplication 2019-10-22 18:27:12 -07:00
build.config.goldfish.arm ANDROID: build.config: enforce trace_printk check 2018-08-28 17:10:42 +05:30
build.config.goldfish.arm64 ANDROID: build.config: enforce trace_printk check 2018-08-28 17:10:42 +05:30
build.config.goldfish.mips ANDROID: build.config: enforce trace_printk check 2018-08-28 17:10:42 +05:30
build.config.goldfish.mips64 ANDROID: build.config: enforce trace_printk check 2018-08-28 17:10:42 +05:30
build.config.goldfish.x86 ANDROID: build.config: enforce trace_printk check 2018-08-28 17:10:42 +05:30
build.config.goldfish.x86_64 ANDROID: build.config: enforce trace_printk check 2018-08-28 17:10:42 +05:30
build.config.x86_64 ANDROID: refactor build.config files to remove duplication 2019-10-22 18:27:12 -07:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS 9p: remove Ron Minnich from MAINTAINERS 2018-08-17 16:20:26 -07:00
gen_headers_arm64.bp input: misc: hbtp_input: snapshot of driver from msm-4.9 2020-08-04 19:37:49 +05:30
gen_headers_arm.bp input: misc: hbtp_input: snapshot of driver from msm-4.9 2020-08-04 19:37:49 +05:30
Kbuild Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
kernel_headers.py Revert "kernel_headers: Disable headers matching" 2020-05-01 13:22:22 -07:00
MAINTAINERS Merge android-4.19.110 (1984fff) into msm-4.19 2020-05-23 05:08:22 -07:00
Makefile Merge android-4.19.113 (248555d) into msm-4.19 2020-07-16 18:45:03 +05:30
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00
verity_dev_keys.x509 x86_64_cuttlefish_defconfig: enable verity cert 2018-08-28 17:15:17 +05:30

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.