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  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:   Fri, 18 Dec 2020 14:23:35 +0800
From:   Jiahui Cen <cenjiahui@...wei.com>
To:     <linux-kernel@...r.kernel.org>
CC:     Wei Xu <xuwei5@...ilicon.com>, Arnd Bergmann <arnd@...db.de>,
        John Garry <john.garry@...wei.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        <xieyingtai@...wei.com>, Jiahui Cen <cenjiahui@...wei.com>
Subject: [PATCH] lib/logic_pio: Fix overlap check for pio registery

Since the [start, end) is a half-open interval, a range with the end equal
to the start of another range should not be considered as overlapped.

Signed-off-by: Jiahui Cen <cenjiahui@...wei.com>
---
 lib/logic_pio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/logic_pio.c b/lib/logic_pio.c
index f32fe481b492..445d611f1dc1 100644
--- a/lib/logic_pio.c
+++ b/lib/logic_pio.c
@@ -57,7 +57,7 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range)
 		    new_range->flags == LOGIC_PIO_CPU_MMIO) {
 			/* for MMIO ranges we need to check for overlap */
 			if (start >= range->hw_start + range->size ||
-			    end < range->hw_start) {
+			    end <= range->hw_start) {
 				mmio_end = range->io_start + range->size;
 			} else {
 				ret = -EFAULT;
-- 
2.28.0

Powered by blists - more mailing lists