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>] [day] [month] [year] [list]
Message-ID: <20240417003349.2520094-1-surenb@google.com>
Date: Tue, 16 Apr 2024 17:33:49 -0700
From: Suren Baghdasaryan <surenb@...gle.com>
To: akpm@...ux-foundation.org
Cc: kent.overstreet@...ux.dev, dan.carpenter@...aro.org, linux-mm@...ck.org, 
	linux-kernel@...r.kernel.org, Suren Baghdasaryan <surenb@...gle.com>, 
	kernel test robot <lkp@...el.com>
Subject: [PATCH 1/1] lib: fix alloc_tag_init() to prevent passing NULL to PTR_ERR()

codetag_register_type() never returns NULL, yet IS_ERR_OR_NULL() is used
to check its return value. This leads to a warning about possibility of
passing NULL to PTR_ERR(). Fix that by using IS_ERR() to exclude NULL.

Fixes: 6e8a230a6b1a ("lib: add allocation tagging support for memory allocation profiling")
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
Closes: https://lore.kernel.org/r/202404051340.7Wo7oiJ5-lkp@intel.com/
Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
---
 lib/alloc_tag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c
index b37e3430ed92..26af9982ddc4 100644
--- a/lib/alloc_tag.c
+++ b/lib/alloc_tag.c
@@ -233,7 +233,7 @@ static int __init alloc_tag_init(void)
 	};
 
 	alloc_tag_cttype = codetag_register_type(&desc);
-	if (IS_ERR_OR_NULL(alloc_tag_cttype))
+	if (IS_ERR(alloc_tag_cttype))
 		return PTR_ERR(alloc_tag_cttype);
 
 	if (!mem_profiling_support)

base-commit: 6723e3b1a668df6b8f305dea8fb62789155d965f
-- 
2.44.0.769.g3c40516874-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ