Skip to content
Commit b9770b0b authored by Pavel Skripkin's avatar Pavel Skripkin Committed by Gerd Hoffmann
Browse files

udmabuf: fix general protection fault in udmabuf_create



Syzbot reported general protection fault in udmabuf_create. The problem
was in wrong error handling.

In commit 16c243e9 ("udmabuf: Add support for mapping hugepages (v4)")
shmem_read_mapping_page() call was replaced with find_get_page_flags(),
but find_get_page_flags() returns NULL on failure instead PTR_ERR().

Wrong error checking was causing GPF in get_page(), since passed page
was equal to NULL. Fix it by changing if (IS_ER(!hpage)) to if (!hpage)

Reported-by: default avatar <syzbot+e9cd3122a37c5d6c51e8@syzkaller.appspotmail.com>
Fixes: 16c243e9 ("udmabuf: Add support for mapping hugepages (v4)")
Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20210811175052.21254-1-paskripkin@gmail.com


Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 83326a73
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment