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: <20220310094303.2013165-1-jiasheng@iscas.ac.cn>
Date:   Thu, 10 Mar 2022 17:43:03 +0800
From:   Jiasheng Jiang <jiasheng@...as.ac.cn>
To:     djwong@...nel.org
Cc:     linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] xfs: xfs_rmap_item: Add ASSERT after calling kmem_zalloc

As the potential failure of the kmem_zalloc() without __GFP_NOFAIL,
it should be better to check it in order to avoid the dereference
of NULL pointer.

Fixes: 5880f2d78ff1 ("xfs: create rmap update intent log items")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
 fs/xfs/xfs_rmap_item.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xfs/xfs_rmap_item.c b/fs/xfs/xfs_rmap_item.c
index c3966b4c58ef..66395faeeb87 100644
--- a/fs/xfs/xfs_rmap_item.c
+++ b/fs/xfs/xfs_rmap_item.c
@@ -143,6 +143,7 @@ xfs_rui_init(
 	else
 		ruip = kmem_cache_zalloc(xfs_rui_cache,
 					 GFP_KERNEL | __GFP_NOFAIL);
+	ASSERT(ruip);
 
 	xfs_log_item_init(mp, &ruip->rui_item, XFS_LI_RUI, &xfs_rui_item_ops);
 	ruip->rui_format.rui_nextents = nextents;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ