Fail a '..' after a missing /dev/bus/usb name
/dev/bus/usb/099/../001/001 answers as the usbfs node and 099/../../../null from a /dev/bus/usb cwd reaches /dev/null, where Linux answers ENOENT for both, because the layer applies a .. without checking that the name before it exists. On a sysroot with a dev/bus/usb/099 directory, /dev/bus/usb/099/../../other/f reaches the backing's file the same way. Review raised the sysroot case on #439, which left this change for a separate PR.
Reproduce with the fixture devices and a static aarch64 busybox:
$ ELFUSE_USB_FIXTURE=1 build/elfuse busybox stat -c %F /dev/bus/usb/099/../001/001
$ ELFUSE_USB_FIXTURE=1 build/elfuse busybox sh -c 'cd /dev/bus/usb && test -c 099/../../../null && echo reached || echo refused'
On main these print character special file and reached. With this change the first fails with No such file or directory and the second prints refused, as Linux does.
Tested on macOS 15.6.1 (24G90) with the 15.5 SDK on an Apple M1 (MacBookAir10,1). make check passes 100 of 101 and make test-matrix-elfuse-aarch64 gives 299 passed, 1 failed and 10 skipped. On main and on this branch alike, the one failure in each is test-thread-churn timing out, and it passes when run alone.
Summary by cubic
Fails .. after a missing /dev/bus/usb name with ENOENT, matching Linux. Previously /dev/bus/usb/099/../001/001 was served as the usbfs node and 099/../../../null from a /dev/bus/usb cwd reached /dev/null; on a sysroot with a dev/bus/usb/099 directory, 099/../../other/f reached the backing.
- The climb rewrite in
path_translate_atnow returnsENOENTwhen..follows a name under/dev/bus/usbthat is not a served directory. - Relative names fold only up to a node or a missing name, so cwd, fchdir, dirfd, and openat-retry spellings reach the same check.
- A
..after a name outside/dev/bus/usbis still applied unchecked, so/dev/bus/nosuch/../usb/001/001remains served. - Adds a
shadow-dotdotmatrix column andtest-usb-sysfscoverage for absolute, cwd, fchdir, dirfd, and openat-retry spellings.