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: <20240705160252.9628-1-amishin@t-argos.ru>
Date: Fri, 5 Jul 2024 19:02:52 +0300
From: Aleksandr Mishin <amishin@...rgos.ru>
To: Siddharth Gupta <sidgup@...eaurora.org>
CC: Aleksandr Mishin <amishin@...rgos.ru>, Bjorn Andersson
	<andersson@...nel.org>, Mathieu Poirier <mathieu.poirier@...aro.org>, Rishabh
 Bhatnagar <rishabhb@...eaurora.org>, <linux-remoteproc@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <lvc-project@...uxtesting.org>
Subject: [PATCH] remoteproc: Remove unneeded check in elf_strtbl_add()

In elf_strtbl_add() pointer 'strtab', which value is a result of shifting
after dereference of another pointer 'ehdr', is compared to NULL, which is
useless.

Fix this issue by removing unneeded check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: abc72b646066 ("remoteproc: coredump: Add minidump functionality")
Signed-off-by: Aleksandr Mishin <amishin@...rgos.ru>
---
 drivers/remoteproc/remoteproc_elf_helpers.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_elf_helpers.h b/drivers/remoteproc/remoteproc_elf_helpers.h
index e6de53a5000c..7c57fb553466 100644
--- a/drivers/remoteproc/remoteproc_elf_helpers.h
+++ b/drivers/remoteproc/remoteproc_elf_helpers.h
@@ -107,7 +107,7 @@ static inline unsigned int elf_strtbl_add(const char *name, void *ehdr, u8 class
 	shdr = ehdr + elf_size_of_hdr(class) + shstrndx * elf_size_of_shdr(class);
 	strtab = ehdr + elf_shdr_get_sh_offset(class, shdr);
 	idx = index ? *index : 0;
-	if (!strtab || !name)
+	if (!name)
 		return 0;
 
 	ret = idx;
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ