Skip to contentSkip to conversation

mm-fix-dereferencing-possible-err_ptr.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Sep 11, 2022 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: fix dereferencing possible ERR_PTR
has been removed from the -mm tree. Its filename was
mm-fix-dereferencing-possible-err_ptr.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Binyi Han <[email protected]>
Subject: mm: fix dereferencing possible ERR_PTR
Date: Sun, 4 Sep 2022 00:46:47 -0700

Smatch checker complains that 'secretmem_mnt' dereferencing possible ERR_PTR(). Let the function return if 'secretmem_mnt' is ERR_PTR, to avoid deferencing it.

Fixes 1507f51255c9f ("mm: introduce memfd_secret system call to create "secret" memory areas")
Cc Mike Rapoport <[email protected]>
Cc Ammar Faizi <[email protected]>
Cc Hagen Paul Pfeifer <[email protected]>
Cc James Bottomley <[email protected]>

---

 mm/secretmem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/secretmem.c renamed from mm/secretmem.c~mm-fix-dereferencing-possible-err_ptr +1 -1
@@ -285,7 +285,7 @@ static int secretmem_init(void)
 
 	secretmem_mnt = kern_mount(&secretmem_fs);
 	if (IS_ERR(secretmem_mnt))
-		ret = PTR_ERR(secretmem_mnt);
+		return PTR_ERR(secretmem_mnt);
 
 	/* prevent secretmem mappings from ever getting PROT_EXEC */
 	secretmem_mnt->mnt_flags |= MNT_NOEXEC;

_

Patches currently in -mm which might be from [email protected] are