On 01.02.2022 16:47, Theodore Ts'o wrote: > On Tue, Feb 01, 2022 at 03:19:54PM +0100, Jan Beulich wrote: >> Hello, >> >> in 5.16, due to (afaict) adad556efcdd ("crypto: api - Fix built-in >> testing dependency failures") booting a system with cryptmgr.ko not >> (perhaps manually) put in the initrd doesn't work when ext4.ko is >> responsible for / . I've contacted Herbert already after finding >> this issue with btrfs, but in the case of ext4 another aspect plays >> into it: I've observed the problem on a system where ext4.ko is used >> solely to service ext3 partitions (including / ), but aiui crc32c >> isn't used at all in this case. Yet it's the attempt of loading it >> which actually causes the mount (and hence booting) to fail. >> >> If my understanding is correct, wouldn't it make sense to skip the >> call to crypto_alloc_shash() unless an ext4 superblock is being >> processed? > > Sure, there are some subtleties, though. For example, we would need > to make sure that sbi->s_chksum_driver() is initialized before we > attempt to use it. That's because an malicious attacker (or syzbot > fuzzer --- is there a difference? :-) could force the file system > feature bits to be set after we decide whether or not to allocate the > crypto handle. This can happen by having a maliciously corrupted file > system image which sets the file system feature bits as part of the > journal replay, or simply by writing to the superblock after it is > mounted. Can any of this happen for an ext3 partition (without destroying its ext3 nature)? IOW would it be possible to set sbi->s_chksum_driver depending on just file system type rather than individual features? Jan