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-next>] [day] [month] [year] [list]
Message-ID: <84d7cd03-1cf8-401a-8edf-2524db0bd6d5@oppo.com>
Date: Wed, 28 Feb 2024 08:50:14 +0000
From: 刘海龙(LaoLiu) <liuhailong@...o.com>
To: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"urezki@...il.com" <urezki@...il.com>, "hch@...radead.org"
	<hch@...radead.org>, "lstoakes@...il.com" <lstoakes@...il.com>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: [PATCH] mm/vmalloc: Fix return value check for vb_alloc

If vm_map_ram(page, 0, 0) would cause panic by vmap_pages_range_noflush, so
change IS_ERR to IS_ERR_OR_NULL to fix this.

Signed-off-by: Hailong.Liu <liuhailong@...o.com>
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index d12a17fc0c17..109732006cf7 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2387,7 +2387,7 @@ void *vm_map_ram(struct page **pages, unsigned int
count, int node)

        if (likely(count <= VMAP_MAX_ALLOC)) {
                mem = vb_alloc(size, GFP_KERNEL);
-               if (IS_ERR(mem))
+               if (IS_ERR_OR_NULL(mem))
                        return NULL;
                addr = (unsigned long)mem;
        } else {
--
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ