Skip to content

Patch kernel to fix CVE-2026-46333#17416

Closed
omkhar wants to merge 1696 commits into
microsoft:3.0-devfrom
omkhar:omkhar/cve-2026-46333-kernel-mariner2
Closed

Patch kernel to fix CVE-2026-46333#17416
omkhar wants to merge 1696 commits into
microsoft:3.0-devfrom
omkhar:omkhar/cve-2026-46333-kernel-mariner2

Conversation

@omkhar
Copy link
Copy Markdown

@omkhar omkhar commented May 23, 2026

Backport upstream fix for CVE-2026-46333.

CVE-2026-46333ptrace_may_access() skips the get_dumpable() check
whenever the target task's mm pointer is NULL, allowing a local
unprivileged user (matching uid/gid only) to ptrace kernel threads or
any task whose mm has been torn down. Reported by Qualys Security
Advisory.

Upstream commit: torvalds/linux@31e62c2
Author: Linus Torvalds torvalds@linux-foundation.org
Reported-by: Qualys Security Advisory qsa@qualys.com

The stable backport for 5.15.y landed at upstream linux-5.15.207
(commit 15b828a46f305ae9f05a7c16914b3ce273474205 on linux-stable).
Mariner 2.0 ships 5.15.202.1 (five stable revs behind), so this PR
adds a single forward-ported patch file. The forward-port reuses the
6.6 backport hunk verbatim because the surrounding task_struct,
exit_mm(), and __ptrace_may_access() shapes are identical between
5.15.y and 6.6.y in the affected region (no sched_rt_mutex:1
bitfield refactor on 5.15.y).

No follow-up Fixes: commits found on torvalds/master as of
2026-05-23.

Validation evidence

Carried over from /Users/oarasara/src/kernel/ptrace-exploit/ (prior
in-house validation; full transcript available on request):

  • Azure Linux 3 (kernel 6.6.138.1, identical hunk): stock kernel
    reproduced the exploit — pidfd_getfd against a kernel thread
    exfiltrated /etc/shadow content and a 4096-byte RSA SSH host
    private key. Patched kernel survived 15,000,000 pidfd_getfd
    attempts with zero leakage.
  • CBL-Mariner 2 (kernel 5.15.202.1 with this exact patch):
    rebuilt cleanly, installed, booted, fingerprinted. Patched-phase
    PoCs returned exploit-blocked across 500 spawn rounds. (Stock
    baseline was not captured separately on Mariner 2 because the
    kernel had already been upgraded — relying on the shared-hunk
    argument with the Azure Linux 3 stock-vs-patched proof.)
  • Patch is byte-identical to the validated Azure Linux 3 hunk; only
    the trailer line [Forward-ported for Azure Linux 3 / CBL-Mariner- Linux-Kernel 6.6.138.1: ...] is preserved verbatim.

Mariner 2.0 caveat: AKS support ended 2025-11-30 per
https://learn.microsoft.com/en-us/azure/azure-linux/support-cycle ;
the 2.0 branch still receives kernel auto-upgrades and this PR is
intended for non-AKS Mariner 2.0 consumers.

PR checklist

  • Patch attribution preserved verbatim (From:, Reported-by:,
    Signed-off-by: lines from upstream git format-patch -1).
  • Single-purpose, single-CVE, single-commit, human-reviewable.
  • Release: incremented 12.
  • PoC reproduces ≥7/10 on unpatched (15M/15M on the shared-hunk
    lane) and 0/10 on patched.
  • kernel-64k spec parity — N/A (Mariner 2.0 ships only the
    non-64k spec).
  • LTP baseline-vs-patched diff — pending. Will run on request;
    LTP runltp was deprecated upstream so the run uses kirk.

CBL-Mariner-Bot and others added 30 commits December 1, 2025 14:28
…IGH] - branch main (microsoft#15189)

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…] and CVE-2025-12969 [Medium] - branch main" microsoft#15207

Co-authored-by: BinduSri-6522866 <v-badabala@microsoft.com>
…-66031 [High] and CVE-2025-66030 [Medium] - branch main" microsoft#15208

Co-authored-by: Akhila Guruju <v-guakhila@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
… main" microsoft#15223

Signed-off-by: Kanishk Bansal <kanbansal@microsoft.com>
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
Co-authored-by: Kanishk Bansal <kanbansal@microsoft.com>
…es-base' - branch main" microsoft#15232

Co-authored-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…6.52 for CVE-2025-66293 [HIGH] - branch main" microsoft#15234

Co-authored-by: jslobodzian <joslobo@microsoft.com>
…in (microsoft#15229)

Co-authored-by: Archana Shettigar <v-shettigara@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…VE-2025-65637 [HIGH] - branch main" microsoft#15312

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…VE-2025-65637 [HIGH] - branch main" microsoft#15313

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…VE-2025-65637 [HIGH] - branch main" microsoft#15314

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
…-2025-65637 [HIGH] - branch main" microsoft#15315

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…65637 [HIGH] - branch main" microsoft#15316

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…2025-65637 [HIGH] - branch main" microsoft#15317

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…VE-2025-65637 [HIGH] - branch main" microsoft#15318

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…VE-2025-66293 [HIGH] - branch main" microsoft#15319

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
Co-authored-by: Archana Shettigar <v-shettigara@microsoft.com>
…-2025-65637 [HIGH] - branch main" microsoft#15320

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…025-65637 [HIGH] - branch main" microsoft#15321

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…VE-2025-65637 [HIGH] - branch main" microsoft#15322

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
…- branch main" microsoft#15323

Co-authored-by: Ratiranjan5 <v-ratbehera@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…-2025-65637 [HIGH] - branch main" microsoft#15325

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
…rovider for CVE-2025-65637 [HIGH] - branch main" microsoft#15326

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: jslobodzian <joslobo@microsoft.com>
azurelinux-security and others added 15 commits April 27, 2026 13:25
…026-1965 [MEDIUM] (microsoft#16207)

Co-authored-by: akhila-guruju <v-guakhila@microsoft.com>
…[MEDIUM] (microsoft#16354)

Co-authored-by: SumitJenaHCL <v-sumitjena@microsoft.com>
…-68146 [MEDIUM] (microsoft#16212)

Co-authored-by: Archana Shettigar <v-shettigara@microsoft.com>
…[HIGH] - branch main (microsoft#16860)

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
…[HIGH] - branch main (microsoft#16863)

Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Co-authored-by: akhila-guruju <v-guakhila@microsoft.com>
…VE-2025-49010 [LOW] (microsoft#16452)

Co-authored-by: Ratiranjan Behera <v-ratbehera@microsoft.com>
…E-2026-32776 [MEDIUM] (microsoft#16229)

Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
Co-authored-by: Aditya Singh <v-aditysing@microsoft.com>
…6004)

Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
Co-authored-by: Archana Shettigar <v-shettigara@microsoft.com>
…16647)

Co-authored-by: akhila-guruju <v-guakhila@microsoft.com>
…icrosoft#16432)

Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
Co-authored-by: akhila-guruju <v-guakhila@microsoft.com>
Backport upstream fix for CVE-2026-46333: ptrace 'get_dumpable()' logic
allowed local unprivileged users with matching uid/gid to bypass
CAP_SYS_PTRACE checks against kernel threads or any task whose mm has
been torn down. Reported by Qualys Security Advisory.

Upstream commit: torvalds/linux@31e62c2
  Author:        Linus Torvalds <torvalds@linux-foundation.org>
  Reported-by:   Qualys Security Advisory <qsa@qualys.com>

The stable backport for 5.15.y landed at commit 15b828a46f305ae9 in
upstream linux-5.15.207. Mariner 2.0 currently ships 5.15.202.1 (five
stable revs behind), so this PR pulls the fix in via a single forward-
ported patch file. The forward-port reuses the same hunk as the 6.6
backport because the surrounding task_struct/exit_mm/ptrace.c shape is
identical between 5.15.y and 6.6.y in the affected region (no
sched_rt_mutex:1 bitfield refactor between those branches).

Evidence (from prior validation work, /Users/oarasara/src/kernel/ptrace-exploit):
- Azure Linux 3 kernel 6.6.138.1 with identical hunk: stock leaked
  /etc/shadow and SSH host private key via pidfd_getfd; patched kernel
  survived 15,000,000 pidfd_getfd attempts with zero leakage.
- CBL-Mariner 2 kernel 5.15.202.1 with this exact patch: built clean,
  installed, booted; patched-phase PoCs returned exploit-blocked across
  500 spawn rounds (stock baseline was not captured separately because
  the kernel had already been upgraded — relying on the shared-hunk
  argument with the Azure Linux 3 stock-vs-patched proof).
- Hunk reused verbatim across 5.15 and 6.6 because the surrounding
  task_struct, exit_mm(), and __ptrace_may_access() shapes are
  identical between the two LTS branches.

Mariner 2.0 caveat: AKS support ended 2025-11-30 per
https://learn.microsoft.com/en-us/azure/azure-linux/support-cycle; the
2.0 branch still receives kernel auto-upgrades and this PR is intended
for non-AKS Mariner 2.0 consumers.

No follow-up Fixes: commits found on torvalds/master as of 2026-05-23.

Signed-off-by: Omkhar Arasaratnam <omkhar@linkedin.com>
@omkhar omkhar requested a review from a team as a code owner May 23, 2026 22:44
@omkhar omkhar changed the base branch from main to 3.0-dev May 26, 2026 04:40
@omkhar omkhar requested review from a team as code owners May 26, 2026 04:40
@microsoft-github-policy-service microsoft-github-policy-service Bot added specs-extended PR to fix SPECS-EXTENDED documentation Improvements or additions to documentation Tools Schema Changes to image configurations 3.0-dev PRs Destined for AzureLinux 3.0 labels May 26, 2026
@omkhar
Copy link
Copy Markdown
Author

omkhar commented May 26, 2026

Closing — this is a Mariner 2.0 kernel backport (head branch is kernel-2.0 / kernel-mariner2, kernel.spec edits target 5.15.y) and should have been filed against microsoft/CBL-Mariner, not this repo. The misfile is on me; I retargeted the base to 3.0-dev earlier today which made the diff explode to ~2.9k files because the branch was never compatible with 3.0-dev. Sorry for the noise.

Holding on opening the equivalent PR on microsoft/CBL-Mariner until I hear back from the Mariner-2.0 maintainers on whether OOT carries are wanted there post-AKS-EOL — open question raised on #17414.

@omkhar omkhar closed this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0-dev PRs Destined for AzureLinux 3.0 documentation Improvements or additions to documentation main PR Destined for main Packaging Schema Changes to image configurations specs-extended PR to fix SPECS-EXTENDED Tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.