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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1361275648-6259-1-git-send-email-peterhuewe@gmx.de>
Date:	Tue, 19 Feb 2013 13:07:27 +0100
From:	Peter Huewe <peterhuewe@....de>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Devendra Naga <devendra.aaru@...il.com>,
	Peter Huewe <peterhuewe@....de>,
	"Robert P. J. Day" <rpjday@...shcourse.ca>,
	Joe Perches <joe@...ches.com>, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] staging/sep: Fix smatch false positive about potential NULL dereference in sep_main.c

Smatch complains about a potential NULL pointer dereference:

sep_main.c:2312 sep_construct_dma_tables_from_lli() error: potential
NULL dereference 'info_out_entry_ptr'.

info_out_entry_ptr is initialized with NULL and if info_in_entry_ptr is
not NULL it gets derefenced.
However info_out_entry_ptr is only NULL in the first iteration of the
while loop and in this case info_in_entry_ptr is also NULL (as indicated
by the comment /* If info entry is null - this is the first table built */
-> this is a false positive.

Nevertheless we add a check for info_out_entry_ptr to silence this
warning and make it more robust in regard to code changes.

Signed-off-by: Peter Huewe <peterhuewe@....de>
---
 drivers/staging/sep/sep_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 30e8d25..366d56b 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -2276,7 +2276,7 @@ static int sep_construct_dma_tables_from_lli(
 			table_data_size);
 
 		/* If info entry is null - this is the first table built */
-		if (info_in_entry_ptr == NULL) {
+		if (info_in_entry_ptr == NULL || info_out_entry_ptr == NULL) {
 			/* Set the output parameters to physical addresses */
 			*lli_table_in_ptr =
 			sep_shared_area_virt_to_bus(sep, dma_in_lli_table_ptr);
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ