Defending mounted filesystems from the root user
Defending mounted filesystems from the root user
Posted Aug 22, 2023 11:57 UTC (Tue) by pizza (subscriber, #46)In reply to: Defending mounted filesystems from the root user by leromarinvit
Parent article: Defending mounted filesystems from the root user
And it's often only possible to tell if a given on-disk metedata structure is "conformant" after loading *every other* bit of metadata into memory and effectively doing a full consistency/fsck pass. Of course you're still vulnerable to stuff being written to disk behind your back, so the only way to handle that is to always keep the full metadata in memory, and never re-read anything from disk.
Posted Aug 22, 2023 13:39 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link] (8 responses)
Posted Aug 22, 2023 14:10 UTC (Tue)
by leromarinvit (subscriber, #56850)
[Link] (3 responses)
Posted Aug 22, 2023 16:08 UTC (Tue)
by DemiMarie (subscriber, #164188)
[Link]
Posted Aug 22, 2023 17:19 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link] (1 responses)
I don't know…the trust line has to go somewhere here. For example, Rust is not safe against `/proc/self/mem` editing. I'm not sure what one *could* do in the face of such power because the only thing you have is "my registers are not accessible" and "the program counter will keep moving".
Note that I am usually all about defensive programming and covering bases, but I also don't interface with hardware directly and have some baseline level of viable behavior. The tales I've heard here (and from linked blogs, etc.) make me happy about my course so far. I am extremely grateful for those that do that work, but I do not envy their jobs.
Posted Aug 23, 2023 17:13 UTC (Wed)
by leromarinvit (subscriber, #56850)
[Link]
I also should probably have qualified the "never crash" with "in a way that potentially allows privilege escalation". If removable media were by default mounted using something like lklfuse, that would IMHO be a big step in the right direction. But I think this should be mainlined, or decoupled from the actual driver code so much that it can use arbitrary kernel images or modules. Using different versions of the same fs driver (with a different set of features and bugs), potentially interchangeably on the same device, sounds like a recipe for compatibility issues.
Posted Aug 24, 2023 7:12 UTC (Thu)
by Karellen (subscriber, #67644)
[Link] (3 responses)
Posted Aug 24, 2023 12:33 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link] (2 responses)
Posted Aug 24, 2023 14:16 UTC (Thu)
by Karellen (subscriber, #67644)
[Link] (1 responses)
Posted Aug 30, 2023 9:45 UTC (Wed)
by taladar (subscriber, #68407)
[Link]
Defending mounted filesystems from the root user
Defending mounted filesystems from the root user
Defending mounted filesystems from the root user
Defending mounted filesystems from the root user
Defending mounted filesystems from the root user
Defending mounted filesystems from the root user
Anything less and you're just deferring discovering the bogus writes until the next mount time.
Why is that a problem?
Defending mounted filesystems from the root user
Defending mounted filesystems from the root user
you're just deferring "something edited my FS" problems from "direct memory access" to "when I load from disk next time".
I get that. I just don't see why it's a problem. Surely checking for consistency and deciding what to do if there's a problem is easier at mount time than it is while the filesystem is in use?
Defending mounted filesystems from the root user
