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]
Date:	Tue, 31 Dec 2013 17:33:44 +0100
From:	jjhiblot@...phandler.com
To:	nicolas.ferre@...el.com
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	jean-jacques hiblot <jean-jacques.hiblot@...u.com>,
	Jean-Jacques Hiblot <jjhiblot@...phandler.com>
Subject: [PATCH] at91: ohci: fixed broken sanity check

From: jean-jacques hiblot <jean-jacques.hiblot@...u.com>

The test (pdev->resource[1].flags != IORESOURCE_IRQ) is broken because the flags
value may contain not only the information IORESSOURCE_IRQ but also the IRQ type
(IORESOURCE_IRQ_HIGHLEVEL for example).

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@...phandler.com>
---
 drivers/usb/host/ohci-at91.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 418444e..df9c8a4 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -142,8 +142,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
 		return -ENODEV;
 	}
 
-	if ((pdev->resource[0].flags != IORESOURCE_MEM)
-			|| (pdev->resource[1].flags != IORESOURCE_IRQ)) {
+	if (!(pdev->resource[0].flags & IORESOURCE_MEM)
+			|| !(pdev->resource[1].flags & IORESOURCE_IRQ)) {
 		pr_debug("hcd probe: invalid resource type\n");
 		return -ENODEV;
 	}
-- 
1.8.4.2

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