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]
Message-Id: <1432483292-23109-1-git-send-email-jungseoklee85@gmail.com>
Date:	Mon, 25 May 2015 01:01:32 +0900
From:	Jungseok Lee <jungseoklee85@...il.com>
To:	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Cc:	barami97@...il.com,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	linux-arm-kernel@...ts.infradead.org
Subject: [RFC PATCH 1/2] kernel/fork.c: add a function to calculate page address from thread_info

A current implementation assumes thread_info address is always correctly
calculated via virt_to_page. It restricts a different approach, such as
thread_info allocation from vmalloc space.

This patch, thus, introduces an independent function to calculate page
address from thread_info one.

Suggested-by: Sungjinn Chung <barami97@...il.com>
Signed-off-by: Jungseok Lee <jungseoklee85@...il.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc: linux-arm-kernel@...ts.infradead.org
---
 kernel/fork.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 03c1eaa..6300bbd 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -212,9 +212,14 @@ struct kmem_cache *vm_area_cachep;
 /* SLAB cache for mm_struct structures (tsk->mm) */
 static struct kmem_cache *mm_cachep;
 
+struct page * __weak arch_thread_info_to_page(struct thread_info *ti)
+{
+	return virt_to_page(ti);
+}
+
 static void account_kernel_stack(struct thread_info *ti, int account)
 {
-	struct zone *zone = page_zone(virt_to_page(ti));
+	struct zone *zone = page_zone(arch_thread_info_to_page(ti));
 
 	mod_zone_page_state(zone, NR_KERNEL_STACK, account);
 }
-- 
1.9.1

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