CVSROOT: /cvs Module name: src Changes by: bl...@cvs.openbsd.org 2025/02/13 14:01:34
Modified files: sys/net : if_gre.c route.c route.h rtsock.c sys/netinet : if_ether.c sys/netinet6 : nd6.c Log message: Fix route entry race when accessing rt_gwroute. Kassert in rt_getll() was triggered as rt_gwroute could be NULL. Problem was introduced by shared netlock around tcp_timer_rexmt(). PMTU discovery calls rtrequest_delete() which was missing proper locking around rt_gwroute. As rt_getll() is called by ARP and ND6 resolve in the hot path, use SMR to provide the pointer to rt_gwroute lockless. Reference count of the returned route is incremented, caller has to free it. Modifying rt_gwroute or rt_cachecnt in rt_putgwroute() is protected by per route lock. OK mvs@