Post #3969054
2026-07-20 20:33 UTC
Fun Linux fact:
On a Linux system where /tmp/ is tmpfs, if you create the following directories:
/tmp/pathwalktest/tmp/pathwalktest/a/tmp/pathwalktest/a/b/tmp/pathwalktest/c
and call
rename("/tmp/pathwalktest/a/b", "/tmp/pathwalktest/b")
then a concurrent
open("/tmp/pathwalktest/a/b/../c", O_RDONLY)
normally won't end up opening /tmp/pathwalktest/c.
But a concurrent
open("/proc/self/root/tmp/pathwalktest/a/b/../c", O_RDONLY)
can end up doing that with a simple ABA race ordering.
(This is all working as intended, this is just a difference between rcu-walk and ref-walk; going through procfs magiclinks forces ref-walk mode.)
Replies (1)
-
@madcoder@infosec.exchange 2026-07-20 21:50
@jann@infosec.exchange file systems are terrible, exhibit #