Skip to content

[ciqlts9_4] ptrace: slightly saner 'get_dumpable()' logic#1236

Merged
roxanan1996 merged 1 commit into
ciqlts9_4from
{bmastbergen}_ciqlts9_4
May 18, 2026
Merged

[ciqlts9_4] ptrace: slightly saner 'get_dumpable()' logic#1236
roxanan1996 merged 1 commit into
ciqlts9_4from
{bmastbergen}_ciqlts9_4

Conversation

@ciq-kernel-automation

@ciq-kernel-automation ciq-kernel-automation Bot commented May 15, 2026

Copy link
Copy Markdown

Local test

[rnicolescu@localhost lts-9.4_tmp_2]$ git -C kernel-src-tree/ log -1 --format=%h
68858594d316
[rnicolescu@localhost lts-9.4_tmp_2]$ uname -r
5.14.0-rnicolescu_ciqlts9_4_tmp_2-68858594d316+                                                                      gcc -o dumpable_ptrace dumpable_ptrace.c && ./dumpable_ptrace dumpable_ptrace.c && ./dumpable_ptrace

=== ptrace dumpability bypass LPE (uid=1000 -> root) ===

[!] exploit did not land
[rnicolescu@localhost lts-9.4_tmp_2]$ cd ssh-keysign-pwn/
[rnicolescu@localhost ssh-keysign-pwn]$ make
cc -O2 -Wall -o sshkeysign_pwn sshkeysign_pwn.c
cc -O2 -Wall -o chage_pwn chage_pwn.c
cc -O2 -Wall -o vuln_target vuln_target.c
cc -O2 -Wall -o exploit_vuln_target exploit_vuln_target.c
[rnicolescu@localhost ssh-keysign-pwn]$ ./sshkeysign_pwn
uid=1000  target=/usr/libexec/openssh/ssh-keysign
no hit in 500 rounds
[rnicolescu@localhost ssh-keysign-pwn]$ ./chage_pwn root
no hit in 500 rounds

Summary

This PR has been automatically created after successful completion of all CI stages.

Commit Message(s)

ptrace: slightly saner 'get_dumpable()' logic

jira VULN-185425
cve CVE-2026-46333
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 31e62c2ebbfdc3fe3dbdf5e02c92a9dc67087a3a
upstream-diff |
	In order to avoid kabi breakage, user_dumpable is added in rh_reserved
	area in task_struct.

Test Results

✅ Build Stage

Architecture Build Time Total Time
x86_64 28m 10s 29m 3s
aarch64 15m 53s 16m 39s

✅ Boot Verification

✅ Kernel Selftests

Architecture Passed Failed Compared Against Status
x86_64 189 28 ciqlts9_4 ✅ No regressions
aarch64 144 31 ciqlts9_4 ✅ No regressions

✅ LTP Results

Architecture Passed Failed Compared Against Status
x86_64 1447 81 ciqlts9_4 ✅ No regressions
aarch64 1418 82 ciqlts9_4 ✅ No regressions

aarch64 newly passing:

  • af_alg04 (FAIL -> PASS)
  • fcntl14 (FAIL -> PASS)
  • fcntl14_64 (FAIL -> PASS)
  • fork14 (FAIL -> PASS)
  • mmap16 (FAIL -> PASS)

🤖 This PR was automatically generated by GitHub Actions
Run ID: 25935955211

jira VULN-185425
cve CVE-2026-46333
commit-author Linus Torvalds <torvalds@linux-foundation.org>
commit 31e62c2
upstream-diff |
	In order to avoid kabi breakage, user_dumpable is added in rh_reserved
	area in task_struct.

The 'dumpability' of a task is fundamentally about the memory image of
the task - the concept comes from whether it can core dump or not - and
makes no sense when you don't have an associated mm.

And almost all users do in fact use it only for the case where the task
has a mm pointer.

But we have one odd special case: ptrace_may_access() uses 'dumpable' to
check various other things entirely independently of the MM (typically
explicitly using flags like PTRACE_MODE_READ_FSCREDS).  Including for
threads that no longer have a VM (and maybe never did, like most kernel
threads).

It's not what this flag was designed for, but it is what it is.

The ptrace code does check that the uid/gid matches, so you do have to
be uid-0 to see kernel thread details, but this means that the
traditional "drop capabilities" model doesn't make any difference for
this all.

Make it all make a *bit* more sense by saying that if you don't have a
MM pointer, we'll use a cached "last dumpability" flag if the thread
ever had a MM (it will be zero for kernel threads since it is never
set), and require a proper CAP_SYS_PTRACE capability to override.

	Reported-by: Qualys Security Advisory <qsa@qualys.com>
	Cc: Oleg Nesterov <oleg@redhat.com>
	Cc: Kees Cook <kees@kernel.org>
	Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 31e62c2)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
@ciq-kernel-automation ciq-kernel-automation Bot added the created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI) label May 15, 2026
@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/25944644738

@github-actions

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit 1c5014715a0 (ptrace: slightly saner 'get_dumpable()' logic) → upstream 31e62c2ebbfd
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1549,8 +1549,6 @@
 	*/
 	RH_KABI_REPLACE_SPLIT(long rh_reserved[64],
 		int rh_kabi_dummy,   /* 0 */ /* Use this one first */
-		/* Save user-dumpable when mm goes away */
-		unsigned user_dumpable:1,
 	)
 
 	/*

################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1002,6 +1002,9 @@
 	unsigned			sched_rt_mutex:1;
 #endif
 
+	/* Save user-dumpable when mm goes away */
+	unsigned			user_dumpable:1;
+
 	/* Bit to tell TOMOYO we're in execve(): */
 	unsigned			in_execve:1;
 	unsigned			in_iowait:1;

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -999,6 +999,6 @@
-	*/
-	RH_KABI_REPLACE_SPLIT(long rh_reserved[64],
-		int rh_kabi_dummy,   /* 0 */ /* Use this one first */
-	)
+	unsigned			sched_rt_mutex:1;
+#endif
 
-	/*
+	/* Bit to tell TOMOYO we're in execve(): */
+	unsigned			in_execve:1;
+	unsigned			in_iowait:1;

This is an automated interdiff check for backported commits.

@github-actions

Copy link
Copy Markdown

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/25944644738

@roxanan1996 roxanan1996 merged commit dd4468f into ciqlts9_4 May 18, 2026
7 checks passed
@bmastbergen bmastbergen deleted the {bmastbergen}_ciqlts9_4 branch May 26, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI)

Development

Successfully merging this pull request may close these issues.

2 participants