Skip to content

Reproducer for ghostlock

Andrea Cervesato ltp 10 versions – In review

Get series with b4
b4 am [email protected] change-id 20260801-cve-ghostlock-6ee4b2f69fd6

Versions newest first

  1. v10 Latest5 patches 2 repliesIn review
  2. v95 patches 2 repliesSuperseded
  3. v85 patches 8 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v75 patches2 repliesSuperseded
v63 patches2 repliesSuperseded
v53 patches2 repliesSuperseded
v42 patches3 repliesSuperseded
v32 patches7 repliesSuperseded
v22 patches1 replySuperseded
v12 patches3 repliesSuperseded

Changes in v10 from the cover letter

- use tst_syscall() directly in safe_sched_setattr() to fix build on glibc 2.41+
- Link to v9: https://lore.kernel.org/[email protected]

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5sched_setattr: Convert to new APIruntest/syscalls testcases/kernel/syscalls/sched_setattr/.gitignore testcases/kernel/syscalls/sched_setattr/Makefile +2 more+182 -991 reply
2/5sched_getattr01: Convert to new APItestcases/kernel/syscalls/sched_getattr/Makefile testcases/kernel/syscalls/sched_getattr/sched_getattr01.c+57 -870 replies
3/5lapi/sched: add SAFE_SCHED_SETATTR()include/lapi/sched.h testcases/kernel/syscalls/sched_getattr/sched_getattr01.c testcases/kernel/syscalls/sched_setattr/sched_setattr01.c+39 -40 replies
4/5lapi/prctl: add more fallback definitionsconfigure.ac include/lapi/prctl.h+26 -00 replies
5/5cve: add CVE-2026-43499 reproducerruntest/cve testcases/cve/.gitignore testcases/cve/Makefile +1 more+280 -10 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchCyril Hrubis
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v10 thread

Cover letter [LTP] [PATCH v10 0/5] Reproducer for ghostlock

Test for CVE-2026-43499 (GhostLock), a stack use-after-free in the rtmutex PI code, fixed in kernel v7.1:
3bfdc63936dd ("rtmutex: Use waiter::task instead of current in remove_waiter()")

Reproducer based on the Nebula Security writeup and open-sourced PoC
(https://nebusec.ai/research/ionstack-part-2/, https://github.com/NebuSec/CyberMeowfia).
Beware, this test will crash the system on a vulnerable kernel.

Assisted by Kimi K3 for the analysis and written mostly with Gemini Pro 3.1 Max.

---
Changes in v10:
- use tst_syscall() directly in safe_sched_setattr() to fix build on glibc 2.41+
- Link to v9: https://lore.kernel.org/[email protected]

Changes in v9:
- split sched_setattr test into sched_setattr01 (positive) and sched_setattr02 (negative)
- register sched_setattr02 in runtest/syscalls and .gitignore
- update commit message to reflect the split
- Link to v8: https://lore.kernel.org/[email protected]

Changes in v8:
- remove PR_SET_MM_MAP_SIZE from commit message
- remove redundant assignment in ghostlock
- Link to v7: https://lore.kernel.org/[email protected]

Changes in v7:
- wrap doc-comment lines in sched_setattr01 to stay under 80 columns
- allocate read_attr via .bufs in sched_getattr01
- keep const in sched_setattr() fallback prototype in lapi/sched.h
- update SAFE_SCHED_SETATTR() commit message to describe test usage and remove forward references
- remove unused PR_SET_MM_MAP_SIZE fallback definition from lapi/prctl.h
- wrap doc-comment lines in ghostlock.c to stay under 80 columns
- format multi-line comment in ghostlock.c spray loop
- add explanation comment for try_sizes[] in ghostlock.c
- check return values of TST_THREAD_STATE_WAIT() in ghostlock.c
- check futex_lock_pi() and futex_unlock_pi() returns, report ENOSYS as TCONF, and abort on errors
- add ENOSYS checks for FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI in ghostlock.c
- Link to v6: https://lore.kernel.org/[email protected]

Changes in v6:
- drop const from sched_setattr() and safe_sched_setattr() prototypes to match glibc 2.41+
- add kernel-doc comment for SAFE_SCHED_SETATTR()
- fix struct prctl_mm_map fallback guard in lapi/prctl.h
- validate futex_wait_requeue_pi() outcome before waking spray checkpoint
- sort ghostlock entry in testcases/cve/.gitignore
- Link to v5: https://lore.kernel.org/[email protected]

Changes in v5:
- reduced synchronization checkpoints from 5 to 3
- introduced and used SAFE_SCHED_SETATTR() in lapi/sched.h
- dropped unused PR_SET_MM_MAP_SIZE probe in setup()
- fixed duplicated -pthread entry in Makefile
- fixed CVE numerical ordering in runtest/cve
- Link to v4: https://lore.kernel.org/[email protected]

Changes in v4:
- handle runtime inside the test
- increase futext wait so we don't TBROK before runtime
- comment prctl() syscall
- move static vars out of the run function
- Link to v3: https://lore.kernel.org/[email protected]

Changes in v3:
- improve sync mechanism
- fix lapi imports
- Link to v2: https://lore.kernel.org/[email protected]

Changes in v2:
- fix build
- fix 32bit run
- Link to v1: https://lore.kernel.org/[email protected]

To: Linux Test Project <[email protected]>

---
Andrea Cervesato (5):
sched_setattr: Convert to new API
sched_getattr01: Convert to new API
lapi/sched: add SAFE_SCHED_SETATTR()
lapi/prctl: add more fallback definitions
cve: add CVE-2026-43499 reproducer

 configure.ac                                       |   2 +
 include/lapi/prctl.h                               |  24 ++
 include/lapi/sched.h                               |  36 +++
 runtest/cve                                        |   1 +
 runtest/syscalls                                   |   1 +
 testcases/cve/.gitignore                           |   1 +
 testcases/cve/Makefile                             |   2 +-
 testcases/cve/ghostlock.c                          | 277 +++++++++++++++++++++
 testcases/kernel/syscalls/sched_getattr/Makefile   |   1 -
 .../syscalls/sched_getattr/sched_getattr01.c       | 134 ++++------
 testcases/kernel/syscalls/sched_setattr/.gitignore |   1 +
 testcases/kernel/syscalls/sched_setattr/Makefile   |   1 -
 .../syscalls/sched_setattr/sched_setattr01.c       | 138 +++-------
 .../syscalls/sched_setattr/sched_setattr02.c       | 140 +++++++++++
 14 files changed, 576 insertions(+), 183 deletions(-)

---
base-commit: f6933a16f304f36045ec39300c6496dae452933d
change-id: 20260801-cve-ghostlock-6ee4b2f69fd6

Best regards,

Signature · 5 lines
Andrea Cervesato <[email protected]>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp