Skip to content

Commit 604af0d

Browse files
authored
Merge pull request #10 from lrh2000/revise
Demo enhancement and RCU correction
2 parents c50978a + 299137d commit 604af0d

4 files changed

Lines changed: 708 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
- name: Build the exploit
2121
run: make
2222
- name: Install QEMU
23-
run: sudo apt-get install -y qemu-system-x86-64
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y qemu-system-x86-64
2426
- name: Run the exploit
2527
id: test
2628
continue-on-error: true

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
[ci]: https://github.com/lrh2000/StackRot/actions
77

8+
![Demo](pic/demo.svg)
9+
810
A flaw was found in the handling of stack expansion in the Linux kernel 6.1
911
through 6.4, aka "Stack Rot". The maple tree, responsible for managing virtual
1012
memory areas, can undergo node replacement without properly acquiring the MM
@@ -358,12 +360,11 @@ solutions are as follows:
358360
period will not end.
359361
4. The iteration task is deliberately prolonged, allowing the RCU grace period
360362
to expire. This is the chosen solution. If the current RCU grace period
361-
surpasses RCU_TASK_IPI_DELAY (defaulting to 0.5 seconds), inter-processor
362-
interrupts (IPIs) are dispatched to all CPUs to verify that they are not in
363-
RCU critical sections. In the case of VMA iteration, the answer is
364-
negative, signifying that the RCU grace period concludes and the maple node
365-
is freed, effectively converting UAFBR into a genuine use-after-free (UAF)
366-
scenario.
363+
surpasses `jiffies_till_first_fqs` (defaulting to several jiffies), an
364+
inter-processor interrupt (IPI) will be dispatched to the victim CPU and
365+
trigger voluntary preemption. In the case of VMA iteration, the voluntary
366+
preemption can make the RCU grace period conclude and free the maple node,
367+
effectively converting UAFBR into a genuine use-after-free (UAF) scenario.
367368

368369
One significant observation is that during VMA iteration for
369370
`/proc/[pid]/maps`, it generates the entire file path for file-mapped memory

0 commit comments

Comments
 (0)