add minimal reproducer for qtbase wayland screen use-after-free
This commit is contained in:
parent
92afaa7f32
commit
b05861de78
4 changed files with 120 additions and 0 deletions
44
test/screen-uaf-reproducer/trigger.sh
Executable file
44
test/screen-uaf-reproducer/trigger.sh
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env bash
|
||||
# Trigger rapid output power-cycling to provoke the Qt Wayland screen UAF.
|
||||
# Run the reproducer binary first, then this script in another terminal.
|
||||
#
|
||||
# Usage: ./trigger.sh [iterations]
|
||||
# iterations: number of off/on cycles (default 20)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cycles="${1:-20}"
|
||||
|
||||
if command -v niri &>/dev/null && niri msg version &>/dev/null; then
|
||||
echo "Detected Niri - using niri msg"
|
||||
for i in $(seq 1 "$cycles"); do
|
||||
echo "cycle $i/$cycles"
|
||||
niri msg action power-off-monitors
|
||||
sleep 0.3
|
||||
niri msg action power-on-monitors
|
||||
sleep 0.5
|
||||
done
|
||||
elif command -v wlr-randr &>/dev/null; then
|
||||
output=$(wlr-randr --json 2>/dev/null | python3 -c \
|
||||
"import sys,json; print(next(o['name'] for o in json.load(sys.stdin) if o['enabled']))" 2>/dev/null \
|
||||
|| wlr-randr | grep -oP '^\S+' | head -1)
|
||||
if [ -z "$output" ]; then
|
||||
echo "error: could not detect an output via wlr-randr" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Detected wlroots compositor - toggling output $output"
|
||||
for i in $(seq 1 "$cycles"); do
|
||||
echo "cycle $i/$cycles"
|
||||
wlr-randr --output "$output" --off
|
||||
sleep 0.3
|
||||
wlr-randr --output "$output" --on
|
||||
sleep 0.5
|
||||
done
|
||||
else
|
||||
echo "error: neither niri nor wlr-randr found" >&2
|
||||
echo "Manually unplug/replug a monitor while the reproducer is running." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Done. If the reproducer is still alive, the bug did not trigger."
|
||||
echo "Try increasing iterations or adding more surfaces."
|
||||
Loading…
Add table
Add a link
Reference in a new issue