In the Linux kernel, the following vulnerability has been resolved:
erofs: reliably distinguish block based and fscache mode
When erofskillsb() is called in block dev based mode, sbdev may not have been initialised yet, and if CONFIGEROFSFSONDEMAND is enabled, it will be mistaken for fscache mode, and then attempt to free an anon_dev that has never been allocated, triggering the following warning:
============================================ idafree called for id=0 which is not allocated. WARNING: CPU: 14 PID: 926 at lib/idr.c:525 idafree+0x134/0x140 Modules linked in: CPU: 14 PID: 926 Comm: mount Not tainted 6.9.0-rc3-dirty #630 RIP: 0010:idafree+0x134/0x140 Call Trace: <TASK> erofskillsb+0x81/0x90 deactivatelockedsuper+0x35/0x80 gettreebdev+0x136/0x1e0 vfsgettree+0x2c/0xf0 donew_mount+0x190/0x2f0
Now when erofskillsb() is called, erofssbinfo must have been initialised, so use sbi->fsid to distinguish between the two modes.