From: Rusty Lynch <rusty@linux.co.intel.com>
To: alan@lxorguk.ukuu.org.uk
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH][2.5.47]Add exported valid_kernel_address()
Date: Wed, 13 Nov 2002 12:13:43 -0800 [thread overview]
Message-ID: <200211132013.gADKDhS01389@linux.intel.com> (raw)
The following is a small patch to the 2.5.47 kernel that adds an exported
function called valid_kernel_address() that allows kernel code to verify
a kernel-mapped address is valid.
valid_kernel_address just calls the static inline kernel_text_address()
function defined in arch/i386/kernel/traps.c
-rustyl
diff -urN linux-2.5.47/arch/i386/kernel/i386_ksyms.c linux-2.5.47-vka-patch/arch/i386/kernel/i386_ksyms.c
--- linux-2.5.47/arch/i386/kernel/i386_ksyms.c 2002-11-10 19:28:32.000000000 -0800
+++ linux-2.5.47-vka-patch/arch/i386/kernel/i386_ksyms.c 2002-11-13 11:46:49.000000000 -0800
@@ -59,6 +59,8 @@
extern unsigned long cpu_khz;
extern unsigned long get_cmos_time(void);
+extern int valid_kernel_address(unsigned long addr);
+
/* platform dependent support */
EXPORT_SYMBOL(boot_cpu_data);
#ifdef CONFIG_EISA
@@ -91,6 +93,7 @@
EXPORT_SYMBOL(get_cmos_time);
EXPORT_SYMBOL(cpu_khz);
EXPORT_SYMBOL(apm_info);
+EXPORT_SYMBOL(valid_kernel_address);
#ifdef CONFIG_DEBUG_IOVIRT
EXPORT_SYMBOL(__io_virt_debug);
diff -urN linux-2.5.47/arch/i386/kernel/traps.c linux-2.5.47-vka-patch/arch/i386/kernel/traps.c
--- linux-2.5.47/arch/i386/kernel/traps.c 2002-11-10 19:28:05.000000000 -0800
+++ linux-2.5.47-vka-patch/arch/i386/kernel/traps.c 2002-11-13 11:51:58.000000000 -0800
@@ -129,6 +129,11 @@
#endif
+int valid_kernel_address(unsigned long addr)
+{
+ return kernel_text_address(addr);
+}
+
void show_trace(unsigned long * stack)
{
int i;
next reply other threads:[~2002-11-13 20:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-13 20:13 Rusty Lynch [this message]
2002-11-13 20:46 ` [PATCH][2.5.47]Add exported valid_kernel_address() Arjan van de Ven
[not found] <200211132013.gADKDhS01389@linux.intel.com.suse.lists.linux.kernel>
[not found] ` <1037220406.2889.4.camel@localhost.localdomain.suse.lists.linux.kernel>
2002-11-13 21:14 ` Andi Kleen
2002-11-13 21:24 ` Rusty Lynch
2002-11-13 22:30 ` Rusty Lynch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200211132013.gADKDhS01389@linux.intel.com \
--to=rusty@linux.co.intel.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox