Skip to content

Instantly share code, notes, and snippets.

View mrpre's full-sized avatar
💭
I may be slow to respond.

mrpre mrpre

💭
I may be slow to respond.
  • 01:35 (UTC +08:00)
View GitHub Profile
@mrpre
mrpre / ip_rt_bug_race.c
Created January 28, 2026 08:49
ip_rt_bug reproducer
/*
* ip_rt_bug race condition reproducer
*
* Requires kernel with mdelay(2000) in icmp_route_lookup before ip_route_input.
*
* Race scenario:
* 1. Send packet with src=172.20.20.1 (not local), dst=172.30.0.1
* 2. Malformed IP option triggers icmp_send -> icmp_route_lookup
* 3. First xfrm_lookup returns -EPERM (block policy), enters reverse path
* 4. Kernel delays 2s before ip_route_input