Skip to contentSkip to conversation

proc-test-how-it-holds-up-with-mappingless-process.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Oct 12, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: proc: test how it holds up with mapping'less process
has been removed from the -mm tree. Its filename was
proc-test-how-it-holds-up-with-mappingless-process.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Alexey Dobriyan <[email protected]>
Subject: proc: test how it holds up with mapping'less process
Date: Wed, 5 Oct 2022 23:14:00 +0300

Create process without mappings and check

	/proc/*/maps
	/proc/*/numa_maps
	/proc/*/smaps
	/proc/*/smaps_rollup

They must be empty (excluding vsyscall page) or full of zeroes.

Retroactively this test should've caught embarassing /proc/*/smaps_rollup oops:

[17752.703567] BUG: kernel NULL pointer dereference, address: 0000000000000000
[17752.703580] #PF: supervisor read access in kernel mode
[17752.703583] #PF: error_code(0x0000) - not-present page
[17752.703587] PGD 0 P4D 0
[17752.703593] Oops: 0000 [#1] PREEMPT SMP PTI
[17752.703598] CPU: 0 PID: 60649 Comm: cat Tainted: G        W         5.19.9-100.fc35.x86_64 #1
[17752.703603] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./X99 Extreme6/3.1, BIOS P3.30 08/05/2016
[17752.703607] RIP: 0010:show_smaps_rollup+0x159/0x2e0

Note 1:
ProtectionKey field in /proc/*/smaps is optional, so check most of its contents, not everything.

Note 2:
due to the nature of this test, child process hardly can signal its readiness (after unmapping everything!) to parent. I feel like "sleep(1)" is justified.
If you know how to do it without sleep please tell me.

Note 3:
/proc/*/statm is not tested but can be.

---

 tools/testing/selftests/proc/.gitignore      |    1 
 tools/testing/selftests/proc/Makefile        |    1 
 tools/testing/selftests/proc/proc-empty-vm.c |  386 +++++++++++++++++
 3 files changed, 388 insertions(+)
tools/testing/selftests/proc/.gitignore renamed from tools/testing/selftests/proc/.gitignore~proc-test-how-it-holds-up-with-mappingless-process +1 -0
@@ -5,6 +5,7 @@
 /proc-fsconfig-hidepid
 /proc-loadavg-001
 /proc-multiple-procfs
+/proc-empty-vm
 /proc-pid-vm
 /proc-self-map-files-001
 /proc-self-map-files-002
tools/testing/selftests/proc/Makefile renamed from tools/testing/selftests/proc/Makefile~proc-test-how-it-holds-up-with-mappingless-process +1 -0
@@ -8,6 +8,7 @@ TEST_GEN_PROGS += fd-001-lookup
 TEST_GEN_PROGS += fd-002-posix-eq
 TEST_GEN_PROGS += fd-003-kthread
 TEST_GEN_PROGS += proc-loadavg-001
+TEST_GEN_PROGS += proc-empty-vm
 TEST_GEN_PROGS += proc-pid-vm
 TEST_GEN_PROGS += proc-self-map-files-001
 TEST_GEN_PROGS += proc-self-map-files-002
tools/testing/selftests/proc/proc-empty-vm.c new file +386 -0

386 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

mm-more-vma-cache-removal.patch