Mehdi Akiki

Posts tagged "c"

  • Published on
    PHP2Shell is two memory bugs in PHP's C core, CVE-2026-109618 and CVE-2026-109619. This short course explains what the bugs are, why no login is needed and why they can fire before your code runs, what to update today, and why the same use-after-free is a compile error in safe Rust.
  • Published on

    Investigation · Part 20 of 20 · From source to a running process

    What Happens When a Process Exits

    A line printed twice, output lost with _exit, a Drop that never runs, a zombie without memory. I followed the end of C and Rust processes with strace and /proc: stdio buffers, exit handlers, exit codes, exit_group, and what the kernel cleans up.
  • Published on

    Investigation · Part 19 of 20 · From source to a running process

    How Each Thread Gets Its Own Copy of a Variable: Thread-Local Storage

    One _Thread_local variable, four threads, four copies at four addresses, and one instruction to reach each of them. I followed the fs register, the TLS segment, the access models of the ELF TLS document, their cost, and Rust's thread_local! in the disassembly.
  • Published on

    Investigation · Part 18 of 20 · From source to a running process

    How a Stack Overflow Is Detected: Guard Pages and Signals

    A C program that overflows its stack dies without a word, a Rust program prints a message. I overflowed both on purpose, in the main thread and in a new thread, and followed the limit, the guard page, the SIGSEGV, the alternate signal stack and the abort.