Closed thesilvanator closed 2 years ago
Well spotted, thank you for the investigation. I will fix it soon, or if you want to submit a PR you're also welcome to do so.
As a note to myself, there's also a potential read out of bounds with the memcpy
call given enough group descriptors, say 33 with a 1024 block size.
Ok! Just sent in a pull request now.
I may take a look at the memcpy
issue as well sometime in the near future.
Thanks for the PR! I've opened #35 for the memcpy issue.
On my machine
mkfs.ext2
defaults to a 4096 byte block size. Cause of this I was getting a[ext2.c] unsupported inode type: 0
error that would then lead to a page fault stacktrace loop when trying to start the first process.I found the issue in the
group_descriptor_t* parse_group_descriptors(ext2_fs_t* fs)
function. It just assumed the block_size was 1024 and therefore the block group descriptors at block 2. Changing the function from:to
fixed the problem.