Skip to content

ptrace: backport upstream fix for CVE-2026-46333 (ssh-keysign-pwn)#481

Merged
SuperKali merged 1 commit into
armbian:rk-6.1-rkr5.1from
OpenSource-YYT:fix-ssh-keysign-pwn
May 15, 2026
Merged

ptrace: backport upstream fix for CVE-2026-46333 (ssh-keysign-pwn)#481
SuperKali merged 1 commit into
armbian:rk-6.1-rkr5.1from
OpenSource-YYT:fix-ssh-keysign-pwn

Conversation

@SuperKali
Copy link
Copy Markdown
Member

Summary

Backports mainline commit 31e62c2ebbfd (Linus Torvalds, 2026-05-13) to rk-6.1-rkr5.1, closing the __ptrace_may_access() logic flaw that lets an unprivileged local user race ssh-keysign's exit and steal SSH host private keys / /etc/shadow FDs via pidfd_getfd().

Closes #480.

Changes

  • include/linux/sched.h: add task_struct.user_dumpable:1 bitfield
  • kernel/exit.c: cache dumpability in exit_mm() before clearing mm
  • kernel/ptrace.c: new task_still_dumpable() helper; __ptrace_may_access() now requires CAP_SYS_PTRACE on the no-mm path

Context-only adaptation vs mainline: sched.h hunk rewritten for pre-6.7 (no sched_rt_mutex bitfield, LSM comment wording).

The 'dumpability' flag is fundamentally about the task's memory image
and makes no sense when there's no associated mm. ptrace_may_access()
however uses it for access control independently of the MM, including
for tasks whose mm has been cleared on exit and for kernel threads.

Cache the last user-dumpability when exit_mm() releases the mm, and
require CAP_SYS_PTRACE in the no-mm path. Kernel threads, which never
had a mm, keep the cached flag at zero and therefore require the
capability — closing the bypass path used by the exploit.

Addresses CVE-2026-46333 (ssh-keysign-pwn): an unprivileged local user
could race ssh-keysign's exit and use pidfd_getfd() to steal the open
file descriptors for /etc/ssh/ssh_host_*_key once task->mm was cleared.

Backport for linux-6.1.y: adapt sched.h hunk context (pre-6.7 lacks
the sched_rt_mutex bitfield; the adjacent comment reads "LSMs" instead
of "TOMOYO").

Reported-by: Qualys Security Advisory <qsa@qualys.com>
Signed-off-by: SuperKali <hello@superkali.me>
@SuperKali SuperKali requested a review from igorpecovnik May 15, 2026 19:29
@SuperKali SuperKali merged commit 6f525a1 into armbian:rk-6.1-rkr5.1 May 15, 2026
1 check passed
@SuperKali SuperKali deleted the fix-ssh-keysign-pwn branch May 15, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ssh-keysign-pwn Vulnerability

1 participant