lkml.org 
[lkml]   [2008]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectOOPS: how to hook system_call_table in redhat es5.1 on x86_64 platform
Hi,

as you know, Linux kernel (>2.6.18) set some pages read-only, we can
not hook system_call_table directly like before, the new source code
on i386 is

#ifdef CONFIG_DEBUG_RODATA
// fix kernel perms
change_page_attr(virt_to_page(syscall_table), 1, PAGE_KERNEL);
global_flush_tlb();
#endif

// hook syscall_table, change some system call to your function
syscall_table[__NR_open] = my_sys_open;

#ifdef CONFIG_DEBUG_RODATA
// fix kernel perms
change_page_attr(virt_to_page(syscall_table), 1, PAGE_KERNEL_RO);
global_flush_tlb();
#endif

but I use the source code above to redhat es5.1 on x86_64, this will
bring Linux crash, who can help me to hook system_call_table in
redhat es5.1 on x86_64 platform.

Thanks
Gang


\
 
 \ /
  Last update: 2008-03-02 02:43    [W:0.035 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site