lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221003070722.780081220@linuxfoundation.org>
Date:   Mon,  3 Oct 2022 09:10:56 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     linux-kernel@...r.kernel.org
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        stable@...r.kernel.org, Binyi Han <dantengknight@...il.com>,
        Andrew Morton <akpm@...ux-foudation.org>,
        Mike Rapoport <rppt@...nel.org>,
        Ammar Faizi <ammarfaizi2@...weeb.org>,
        Hagen Paul Pfeifer <hagen@...u.net>,
        James Bottomley <James.Bottomley@...senPartnership.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH 5.15 31/83] mm: fix dereferencing possible ERR_PTR

From: Binyi Han <dantengknight@...il.com>

commit 4eb5bbde3ccb710d3b85bfb13466612e56393369 upstream.

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

Link: https://lkml.kernel.org/r/20220904074647.GA64291@cloud-MacBookPro
Fixes: 1507f51255c9f ("mm: introduce memfd_secret system call to create "secret" memory areas")
Signed-off-by: Binyi Han <dantengknight@...il.com>
Reviewed-by: Andrew Morton <akpm@...ux-foudation.org>
Cc: Mike Rapoport <rppt@...nel.org>
Cc: Ammar Faizi <ammarfaizi2@...weeb.org>
Cc: Hagen Paul Pfeifer <hagen@...u.net>
Cc: James Bottomley <James.Bottomley@...senPartnership.com>
Cc: <stable@...r.kernel.org>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
 mm/secretmem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/secretmem.c
+++ b/mm/secretmem.c
@@ -283,7 +283,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;


Powered by blists - more mailing lists