• Chao Yu's avatar
    f2fs: fix to avoid NULL pointer dereference · 61fbae2b
    Chao Yu authored
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    PC is at f2fs_free_dic+0x60/0x2c8
    LR is at f2fs_decompress_pages+0x3c4/0x3e8
    f2fs_free_dic+0x60/0x2c8
    f2fs_decompress_pages+0x3c4/0x3e8
    __read_end_io+0x78/0x19c
    f2fs_post_read_work+0x6c/0x94
    process_one_work+0x210/0x48c
    worker_thread+0x2e8/0x44c
    kthread+0x110/0x120
    ret_from_fork+0x10/0x18
    
    In f2fs_free_dic(), we can not use f2fs_put_page(,1) to release dic->tpages[i],
    as the page's mapping is NULL.
    Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    61fbae2b
compress.c 26.4 KB