163 points · by rrampage · 2y ago · 67 comments
From the kernel point of view, the filesystem code runs in kernel mode and expects a trusted block device
Some people (from gnome etc) do auto-mount filesystems, which is a crazy idea and they know it but they do not care
That being said, basically every file system ever is vulnerable to the malicious image. Kernel drivers assume that the metadata is sane enough and mistakes are from simple bugs, not deliberate attacks.
More specifically, the cluster chain got overwritten with junk data, so all files got truncated down to one cluster in length.
This is why metadata Journalling exists for file systems.
Fast forward 20 or 30 years: We're back to using a FAT[32] partition for booting, just with a very different mini-OS to do the job.
le sigh.
- "The default file system selected in most cases is ext4; for /boot partitions ext2 will be selected by default when guided partitioning is used."
https://www.debian.org/releases/bookworm/amd64/ch06s03.en.ht... ("Debian GNU/Linux Installation Guide (Bookworm/amd64)")
The ext4 driver is fully compatible with ext2.
You can use tune2fs to upgrade file systems, downgrading is not (usually) possible without a full backup and restore.
The on-disk format for these three is the same; the difference is that the later ones understand more of the "incompatible" additions to the on-disk format (IIRC, the main ones being the journal for ext3, and extents for ext4, but there are others). You can convert an "ext2" filesystem into an "ext4" one by just enabling the relevant filesystem format flags on the superblock, and making a few necessary adjustments (for instance, creating a journal when enabling the "has journal" flag).
But I think your question is why they're being deprecated now.
I'm retired now but fully expecting to dust off a bunch of Unix skills in late 2037, early 2038. I suspect by then many people who know how to, say, build a Linux kernel from the command line will either be dead, retired, or too busy doing more fun things.
(e2fsck, resize2fs, etc)
e2fsprogs is already comprehensive of 2, 3, and 4 versions: <https://sourceforge.net/projects/e2fsprogs/>
https://github.com/y2038/y2038-list?tab=readme-ov-file#file-...
Note that the earliest date on the list is 2028 with isofs (used on CDs).
1) mkfs is a userspace utility. Its defaults have no consideration for which kernel driver implements this interface; I'd bet a dollar that mkfs has been hitting the ext4 driver for ages. 2) As stated in sister comments, support for actual ext2 filesystems is unaffected. 3) Using a very simple fs by default seems like a good thing. FAT (variants) has survived forever by being dirt-simple, despite its faults. 4) Who in the world doesn't specify options to mkfs? It's one of the few operations that really doesn't have "sane defaults".
Is there a "better" default fs? I dunno. I've looked at a few, but most seem... troubled. So many trade-offs.
However, the ext4 driver also supports the ext2 format, and there are no plans to deprecate the ext4 driver.
> This mkfs frontend is deprecated in favour of filesystem specific mkfs.<type> utils.