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]
Message-ID: <20150723015354.GB1844@dhcp-17-102.nay.redhat.com>
Date:	Thu, 23 Jul 2015 09:53:54 +0800
From:	Baoquan He <bhe@...hat.com>
To:	tj@...nel.org, cl@...ux-foundation.org, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH v3 2/3] percpu: Add WARN_ON into percpu_init_late

In pcpu_setup_first_chunk() pcpu_reserved_chunk is assigned to point to
static chunk. While pcpu_first_chunk is got from below code:

	pcpu_first_chunk = dchunk ?: schunk;

pcpu_first_chunk might point to static chunk too with possibility. Add a
WARN_ON here to yell out if that happened.*/

Signed-off-by: Baoquan He <bhe@...hat.com>
---
 mm/percpu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/mm/percpu.c b/mm/percpu.c
index 8cf18dc..974600b 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -2275,6 +2275,13 @@ void __init percpu_init_late(void)
 	unsigned long flags;
 	int i;
 
+	/* In pcpu_setup_first_chunk() pcpu_reserved_chunk is assigned to point to
+	 * static chunk. While pcpu_first_chunk is got from below code:
+	 * 		pcpu_first_chunk = dchunk ?: schunk;
+	 * pcpu_first_chunk might point to static chunk too with possibility. Add a
+	 * WARN_ON here to yell out if that happened.*/
+	WARN_ON(pcpu_first_chunk == pcpu_reserved_chunk);
+
 	for (i = 0; (chunk = target_chunks[i]); i++) {
 		int *map;
 		const size_t size = PERCPU_DYNAMIC_EARLY_SLOTS * sizeof(map[0]);
-- 
2.4.3

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