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]
Date:   Sun, 23 Apr 2017 18:10:49 +0800
From:   Pan Bian <bianpan201602@....com>
To:     Eli Billauer <eli.billauer@...il.com>
Cc:     linux-kernel@...r.kernel.org, Pan Bian <bianpan2016@....com>
Subject: [PATCH 1/1] char: xillybus: check return value

From: Pan Bian <bianpan2016@....com>

Function of_address_to_resource() tries to translate device tree address
and return as resource. If the translation fails, it will return a
negative errno. However, function xilly_drv_probe() does not validate
its return value, which may result in a bad memory access bug. This
patch fixes the bug.

Signed-off-by: Pan Bian <bianpan2016@....com>
---
 drivers/char/xillybus/xillybus_of.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/char/xillybus/xillybus_of.c b/drivers/char/xillybus/xillybus_of.c
index 78a492f..57b295a 100644
--- a/drivers/char/xillybus/xillybus_of.c
+++ b/drivers/char/xillybus/xillybus_of.c
@@ -137,6 +137,8 @@ static int xilly_drv_probe(struct platform_device *op)
 	dev_set_drvdata(dev, endpoint);
 
 	rc = of_address_to_resource(dev->of_node, 0, &res);
+	if (rc < 0)
+		return rc;
 	endpoint->registers = devm_ioremap_resource(dev, &res);
 
 	if (IS_ERR(endpoint->registers))
-- 
1.9.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ