Skip to content

Add FILE* structure manipulation exploit#35

Open
nataliakokoromyti wants to merge 2 commits intogpu-mode:masterfrom
nataliakokoromyti:exploit/file-struct
Open

Add FILE* structure manipulation exploit#35
nataliakokoromyti wants to merge 2 commits intogpu-mode:masterfrom
nataliakokoromyti:exploit/file-struct

Conversation

@nataliakokoromyti
Copy link
Contributor

C's fprintf() (which we use to write timing results) writes through glibc's internal FILE* struct so the exploit hijacks that struct to reroute the harness's timing output through a filter thread. the filter sees every line before the parent process does, so it can rewrite the reported times to whatever it wants while the kernel just computes the correct result normally.

here for example, the kernel itself is the same correct kernel as submission_correct.py but every measurement is rewritten to 1.0 µs before forwarding it to the real output.

Walks glibc's _IO_list_all linked list to find the FILE* for the
output pipe, then modifies its _fileno field to redirect fprintf
writes through a filtering thread that rewrites timing values.

Unlike pipe fd interposition, this modifies glibc-internal data
structures rather than OS-level file descriptors.
Updated comments to clarify the exploit's mechanism and defense strategies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant