• Chao Yu's avatar
    f2fs: fix to detect corrupted meta ino · fcc2d8cc
    Chao Yu authored
    It is possible that ino of dirent or orphan inode is corrupted in a
    fuzzed image, occasionally, if corrupted ino is equal to meta ino:
    meta_ino, node_ino or compress_ino, caller of f2fs_iget() from below
    call paths will get meta inode directly, it's not allowed, let's
    add sanity check to detect such cases.
    
    case #1
    - recover_dentry
     - __f2fs_find_entry
     - f2fs_iget_retry
    
    case #2
    - recover_orphan_inode
     - f2fs_iget_retry
    Signed-off-by: default avatarChao Yu <chao@kernel.org>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    fcc2d8cc
inode.c 26 KB