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:	Sun,  9 Aug 2009 11:36:40 +0200
From:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	rt-users <linux-rt-users@...r.kernel.org>,
	Nicolas Pitre <nico@...vell.com>,
	MinChan Kim <minchan.kim@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Li Zefan <lizf@...fujitsu.com>,
	Jens Axboe <jens.axboe@...cle.com>, linux-mm@...ck.org
Subject: [PATCH RT 9/6] [RFH] Build failure on 2.6.31-rc4-rt1 in mm/highmem.c

The two commits

	b38cb5a (mm: remove kmap_lock)

and

	3297e76 (highmem: atomic highmem kmap page pinning)

conflict (without causing a text based conflict) because the latter
introduces a usage of kmap_lock.

The actual compiler output is (e.g. for ARCH=arm, stmp378x_defconfig):

	  CC      mm/highmem.o
	mm/highmem.c: In function 'pkmap_try_free':
	mm/highmem.c:116: warning: unused variable 'addr'
	mm/highmem.c: In function 'kmap_high_get':
	mm/highmem.c:372: error: 'kmap_lock' undeclared (first use in this function)
	mm/highmem.c:372: error: (Each undeclared identifier is reported only once
	mm/highmem.c:372: error: for each function it appears in.)
	mm/highmem.c:375: error: invalid operands to binary < (have 'atomic_t' and 'int')
	mm/highmem.c:376: error: wrong type argument to increment

The problems in lines 116 and 375f are resolved by the patch below, but
I don't know highmem enough to fix the remaining error.  Moreover I
don't have a machine that makes use of highmem.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: Nicolas Pitre <nico@...vell.com>
Cc: MinChan Kim <minchan.kim@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Li Zefan <lizf@...fujitsu.com>
Cc: Jens Axboe <jens.axboe@...cle.com>
Cc: linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org
---
 mm/highmem.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/highmem.c b/mm/highmem.c
index 66e915a..4aa9eea 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -113,10 +113,10 @@ static int pkmap_try_free(int pos)
 	 */
 	if (!pte_none(pkmap_page_table[pos])) {
 		struct page *page = pte_page(pkmap_page_table[pos]);
-		unsigned long addr = PKMAP_ADDR(pos);
 		pte_t *ptep = &pkmap_page_table[pos];
 
-		VM_BUG_ON(addr != (unsigned long)page_address(page));
+		VM_BUG_ON((unsigned long)PKMAP_ADDR(pos) !=
+				(unsigned long)page_address(page));
 
 		if (!__set_page_address(page, NULL, pos))
 			BUG();
@@ -372,8 +372,8 @@ void *kmap_high_get(struct page *page)
 	lock_kmap_any(flags);
 	vaddr = (unsigned long)page_address(page);
 	if (vaddr) {
-		BUG_ON(pkmap_count[PKMAP_NR(vaddr)] < 1);
-		pkmap_count[PKMAP_NR(vaddr)]++;
+		BUG_ON(atomic_read(&pkmap_count[PKMAP_NR(vaddr)]) < 1);
+		atomic_add(1, pkmap_count[PKMAP_NR(vaddr)]);
 	}
 	unlock_kmap_any(flags);
 	return (void*) vaddr;
-- 
1.6.3.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