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, 4 Mar 2019 10:33:55 +0000
From:   Peng Fan <peng.fan@....com>
To:     "dennis@...nel.org" <dennis@...nel.org>,
        "tj@...nel.org" <tj@...nel.org>, "cl@...ux.com" <cl@...ux.com>
CC:     "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "van.freenix@...il.com" <van.freenix@...il.com>,
        Peng Fan <peng.fan@....com>
Subject: [PATCH 2/2] percpu: pcpu_next_md_free_region: inclusive check for
 PCPU_BITMAP_BLOCK_BITS

If the block [contig_hint_start, contig_hint_start + contig_hint)
matches block->right_free area, need use "<=", not "<".

Signed-off-by: Peng Fan <peng.fan@....com>
---

V1:
  Based on https://patchwork.kernel.org/cover/10832459/ applied linux-next
  boot test on qemu aarch64

 mm/percpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/percpu.c b/mm/percpu.c
index 5ee90fc34ea3..0f91f1d883c6 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -390,7 +390,8 @@ static void pcpu_next_md_free_region(struct pcpu_chunk *chunk, int *bit_off,
 		 */
 		*bits = block->contig_hint;
 		if (*bits && block->contig_hint_start >= block_off &&
-		    *bits + block->contig_hint_start < PCPU_BITMAP_BLOCK_BITS) {
+		    *bits + block->contig_hint_start <=
+		    PCPU_BITMAP_BLOCK_BITS) {
 			*bit_off = pcpu_block_off_to_off(i,
 					block->contig_hint_start);
 			return;
-- 
2.16.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ