@gregkh @sima @sourcejedi Even if the path is never reused, the device major and minor number can still be reused. Right now I think one needs a custom FUSE filesystem if one wants opening e.g. /dev/disk/by-diskseq/1 to be race-free, and that’s bad.
Notices by Demi Marie Obenour (alwayscurious@infosec.exchange)
-
Embed this notice
Demi Marie Obenour (alwayscurious@infosec.exchange)'s status on Monday, 13-Jan-2025 15:42:13 JST Demi Marie Obenour -
Embed this notice
Demi Marie Obenour (alwayscurious@infosec.exchange)'s status on Monday, 13-Jan-2025 15:40:38 JST Demi Marie Obenour @gregkh @sima Some more questions:
- Which entry in sysfs correspond to physical (as opposed to logical) topology? Is it the path under /sys/devices?
- How can I go from this path to a PCI bus/slot/function?
- Will this path change when other cards are added or removed or if the system firmware is updated?
- Is there a way for driver probing to be deferred until after userspace can check the device against the actual topology of the machine? That would allow checking if the device that claims to be a serial port in slot X is actually supposed to be a serial port, or if it is a GPU passed through to a VM that the VM compromised and is now pretending to be a serial console. In the latter case the device would never be allowed to be used except for passthrough.
-
Embed this notice
Demi Marie Obenour (alwayscurious@infosec.exchange)'s status on Sunday, 12-Jan-2025 18:45:57 JST Demi Marie Obenour @gregkh @sima @sourcejedi I really wish that the kernel never reused /dev nodes or major:minor numbers. RIght now, one must do verification after calling open() if one wants to avoid race conditions. Of course, lots of programs do not do that.
-
Embed this notice
Demi Marie Obenour (alwayscurious@infosec.exchange)'s status on Sunday, 12-Jan-2025 18:42:33 JST Demi Marie Obenour @sima @gregkh What should one use to get a persistent identifier for PCI devices? Anyone doing PCI device passthrough that persists across reboots needs this.
-
Embed this notice
Demi Marie Obenour (alwayscurious@infosec.exchange)'s status on Sunday, 12-Jan-2025 18:42:32 JST Demi Marie Obenour @sima @gregkh What is actually wanted is to be able to detect the physical topology of the system, as determined by what card is plugged into what slot.
-
Embed this notice
Demi Marie Obenour (alwayscurious@infosec.exchange)'s status on Tuesday, 05-Sep-2023 19:38:33 JST Demi Marie Obenour @gregkh Are you saying that people who cannot reboot every week should not use Linux?
That’s a valid position to have, but if it is accurate, it needs to be much more widely known so that embedded systems vendors know not to use Linux for their uptime-critical products.