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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 14 May 2012 12:41:29 +0200
From:	Samuel Iglesias Gonsalvez <siglesias@...lia.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Samuel Iglesias Gonsalvez <siglesias@...lia.com>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 5/5] Staging: ipack/devices/ipoctal: check for availability of helper functions in ipoctal_match()

When installing the module, there could be a kernel oops due to a dereference of
a NULL pointer.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@...lia.com>
---
 drivers/staging/ipack/devices/ipoctal.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/ipack/devices/ipoctal.c b/drivers/staging/ipack/devices/ipoctal.c
index 7e370d3..df42b9b 100644
--- a/drivers/staging/ipack/devices/ipoctal.c
+++ b/drivers/staging/ipack/devices/ipoctal.c
@@ -799,6 +799,9 @@ static int ipoctal_match(struct ipack_device *dev)
 	int res;
 	unsigned char board_id;
 
+	if ((!dev->ops) || (!dev->ops->map_space) || (!dev->ops->unmap_space))
+		return -ENODEV;
+
 	res = dev->ops->map_space(dev, 0, IPACK_ID_SPACE);
 	if (res)
 		return res;
-- 
1.7.10

--
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