Commit 663ccdb1 authored by Roberto Sassu's avatar Roberto Sassu Committed by sanglipeng
Browse files

memfd: check for non-NULL file_seals in memfd_create() syscall

stable inclusion
from stable-v5.10.186
commit 051d6421337b473803bf6ae50ae05be1f0db64fb
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8L5XP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=051d6421337b473803bf6ae50ae05be1f0db64fb

--------------------------------

[ Upstream commit 935d44ac ]

Ensure that file_seals is non-NULL before using it in the memfd_create()
syscall.  One situation in which memfd_file_seals_ptr() could return a
NULL pointer when CONFIG_SHMEM=n, oopsing the kernel.

Link: https://lkml.kernel.org/r/20230607132427.2867435-1-roberto.sassu@huaweicloud.com


Fixes: 47b9012e ("shmem: add sealing support to hugetlb-backed memfd")
Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
Cc: Marc-Andr Lureau <marcandre.lureau@redhat.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 462d5bc9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment