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] [day] [month] [year] [list]
Date:	Fri, 23 Dec 2011 22:14:41 +0900
From:	YOSHIDA Masanori <masanori.yoshida.tv@...achi.com>
To:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, hpa@...or.com, x86@...nel.org,
	linux-kernel@...r.kernel.org
Cc:	hpa@...or.com, Andrew Morton <akpm@...ux-foundation.org>,
	Andy Lutomirski <luto@....edu>,
	Borislav Petkov <borislav.petkov@....com>,
	Ingo Molnar <mingo@...hat.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Kevin Hilman <khilman@...com>,
	Marcelo Tosatti <mtosatti@...hat.com>,
	Michal Marek <mmarek@...e.cz>, Rik van Riel <riel@...hat.com>,
	Tejun Heo <tj@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	YOSHIDA Masanori <masanori.yoshida.tv@...achi.com>,
	Yinghai Lu <yinghai@...nel.org>, linux-kernel@...r.kernel.org,
	x86@...nel.org, yrl.pp-manager.tt@...achi.com
Subject: [RFC PATCH 1/5][RESEND] livedump: Add notifier-call-chain into
 do_page_fault

This patch adds notifier-call-chain that is called in do_page_fault.
This can be used to check whether page fault occurs for the normal reason,
or it is caused by special write protection, for example Live Dump.

Signed-off-by: YOSHIDA Masanori <masanori.yoshida.tv@...achi.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org
Cc: Andy Lutomirski <luto@....edu>
Cc: Rik van Riel <riel@...hat.com>
Cc: Marcelo Tosatti <mtosatti@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc: linux-kernel@...r.kernel.org
---

 arch/x86/include/asm/traps.h |    2 ++
 arch/x86/mm/fault.c          |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
index 0012d09..7bf6081 100644
--- a/arch/x86/include/asm/traps.h
+++ b/arch/x86/include/asm/traps.h
@@ -89,4 +89,6 @@ asmlinkage void smp_thermal_interrupt(void);
 asmlinkage void mce_threshold_interrupt(void);
 #endif
 
+extern struct atomic_notifier_head page_fault_notifier_list;
+
 #endif /* _ASM_X86_TRAPS_H */
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 5db0490..2f8e2a9 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -985,6 +985,8 @@ static int fault_in_kernel_space(unsigned long address)
 	return address >= TASK_SIZE_MAX;
 }
 
+ATOMIC_NOTIFIER_HEAD(page_fault_notifier_list);
+
 /*
  * This routine handles page faults.  It determines the address,
  * and the problem, and then passes it off to one of the appropriate
@@ -1008,6 +1010,11 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
 	/* Get the faulting address: */
 	address = read_cr2();
 
+	if (atomic_notifier_call_chain(
+				&page_fault_notifier_list, error_code, regs) &
+			NOTIFY_OK)
+		return;
+
 	/*
 	 * Detect and handle instructions that would cause a page fault for
 	 * both a tracked kernel page and a userspace page.

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