DEV TOOLS Signal 126
40-year-old kernel bug makes fstat return different inodes on same UNIX domain socket end
Illustration only Photo by Kier in Sight Archives on Unsplash
A bug in the iOS kernel's UNIX domain socket implementation causes fstat() to return different inode numbers on successive calls to the same socket end, breaking any code that relies on inode stability to identify socket endpoints.
Any system code that caches inode numbers from fstat() on UNIX domain sockets to distinguish socket ends will hit assertion failures or incorrect behavior on first boot. The bug is deterministic and reproducible, making it particularly dangerous for production systems that rely on inode-based socket identification patterns.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
fstat() on a UNIX domain socket can return a different inode number on the second call to the same socket end
The bug is in uipc_sense in /bsd/kern/uipc_usrreq.c, where inode numbers are lazily assigned via unp_ino++
The bug is deterministic, occurring only after a fresh iOS boot and never on subsequent runs
THE CLUSTER