Skip to main content
Menu
CVEs

Linux kernel crash from NULL pointer dereference in BPF task work

CVE-2026-139346Published November 30, 2026, updated

Exploited
No known exploitation
Fix
No fix listed
Who is exposed
Not reported

Summary

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix NULL task dereference in task work cancellation

bpf_task_work_irq() publishes ctx->work with task_work_add() before changing the context from SCHEDULING to SCHEDULED. The target task can run the callback on another CPU before the handler reaches its final state transition.

The handler then reloads ctx->task for cancellation if its final cmpxchg observes FREED. By that point the callback or context destruction may already have cleared ctx->task, causing task_work_cancel() to dereference a NULL task pointer.

One concrete interleaving is:

  1. CPU 0 changes PENDING to SCHEDULING and successfully queues ctx->work with task_work_add(), but has not attempted the final state cmpxchg.
  2. The target task on CPU 1 runs the callback. It changes SCHEDULING to RUNNING, executes the BPF subprogram, resets ctx->task, publishes STANDBY and drops the callback's context reference.
  3. CPU 2 deletes the map value. It changes STANDBY to FREED and drops the map's context reference without queuing asynchronous cancellation.
  4. CPU 0 resumes. Its SCHEDULING-to-SCHEDULED cmpxchg observes FREED, and the cancellation attempt passes NULL to task_work_cancel().

If deletion publishes FREED before the callback claims RUNNING, the callback takes its FREED exit and drops its context reference. Context destruction can then clear ctx->task before CPU 0 attempts cancellation.

A controlled reproducer with a delay before the final cmpxchg triggered the following fault on a v7.3-rc3 based x86-64 KVM guest:

BUG: kernel NULL pointer dereference, address: 0000000000000890 RIP: 0010:task_work_cancel+0xd/0xa0 RDI: 0000000000000000 CR2: 0000000000000890 Call Trace: <IRQ> bpf_task_work_irq+0x95/0x100 irq_work_run_list+0x4f/0x90 irq_work_run+0x18/0x50 </IRQ>

0x890 is the task_struct::task_works offset in that build, read through the NULL task argument.

Capture ctx->task before task_work_add() publishes the callback and use that pointer for the handler's cancellation attempt. The round still holds its task reference when the pointer is captured. Releasing that reference uses bpf_task_release(), which calls put_task_struct_rcu_user(), so the handler's existing RCU read-side section keeps the captured task alive even if ctx->task is subsequently cleared.

The asynchronous cancellation path reads ctx->task directly, which is safe there: queuing it requires deletion to observe SCHEDULED, and that xchg wins against the callback's transition to RUNNING, so the callback takes its FREED exit without resetting ctx->task, while the map reference transferred to the cancellation handler prevents context destruction until cancellation completes.

The handler-tail and asynchronous cancellation attempts are mutually exclusive: asynchronous cancellation is queued only if deletion observes SCHEDULED after the scheduling handler's final cmpxchg has succeeded. If that cmpxchg instead observes FREED, the scheduling handler attempts cancellation with the captured pointer.

What to do

Check your systems with an agent

Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.

Check whether my systems are affected by CVE-2026-139346 (bpf: Fix NULL task dereference in task work cancellation), using the cve.now data below.

Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.

What cve.now has for CVE-2026-139346 (entry last updated 2026-11-30):
Affected:
- Linux Linux: version range not reported
- Linux Linux: versions 6.18
Fixed versions: none listed yet.
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
CISA KEV: CVE-2026-139346 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-139346 only. If you also check another CVE, look up its own KEV status; never assume it from this one.

How to check:
- Installed software: check what is actually running, not what a repo declares. Read the version from each host, container image and Kubernetes node (the binary's version output, the OS package database, image layers), and check whether the conditions above hold there. Distribution packages may carry a backported fix under an older version number; confirm against the distribution's own advisory.

Verify against the linked advisories before concluding, and cite the date you read each one:
- https://git.kernel.org/stable/c/fd91c41b1d4ab85ce806d61c8e5b7add292046dc
- https://git.kernel.org/stable/c/2fd1c3f2128a59d118e6656dcbd065a588a5aac7
- https://git.kernel.org/stable/c/c961f7b41a108313a4705baac7b27d2174cc8035
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.

Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.

Entry: https://cve.now/CVE-2026-139346
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-139346"}.

Affected versions

cve.now Index

25Pof 100 · provisional · methodology v3
  • Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
  • Exposure?/25Unknown. No advisory context yet
  • Reach20/20Affects Linux kernel (software on nearly every server, desktop or phone)
  • Severity?/10Unknown. No CVSS score or vendor rating
  • No patch5/5No patch listed yet

What would change the score

  • Would score about 80 if added to CISA KEV
  • Would score about 75 if CISA's SSVC rates exploitation active
  • Would score about 47 if advisories confirm default setups are exposed

Timeline

  1. CVE published
  2. First seen by cve.now

Evidence 5

Questions about CVE-2026-139346

Is CVE-2026-139346 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.

Source: cve.now feed data

Which versions are affected by CVE-2026-139346?

Linux: version 6.18.

Source: cve.now feed data

No corrections so far. Something wrong on this page? Report an error.