osxfuse / filesystems

Example file systems
379 stars 94 forks source link

Fix minixfs count_free causing segmentfault bug #30

Open JackDrogon opened 6 years ago

JackDrogon commented 6 years ago

In count_free function, bh->b_size = 4096, cause ((numbits - (numblocks - 1) bh->b_size 8) / 16) 2 => 2305843009213672946, so bh->b_data[j] visit novalid memory. Use linux 4.10.15 minix countfree code to replace the countfree* functions. The new code is efficient and strong.

JackDrogon commented 6 years ago

It's a simple way to fix the bug. Change bh->b_size = 1024. But I think it's a good idea to merge linux's new minix code.