LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Gang He" <hegang.linux@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: OOPS: how to hook system_call_table in redhat es5.1 on x86_64 platform
Date: Sun, 2 Mar 2008 09:40:14 +0800	[thread overview]
Message-ID: <4306ae870803011740k39d0769cy7fd6413b10146f74@mail.gmail.com> (raw)

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

             reply	other threads:[~2008-03-02  1:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02  1:40 Gang He [this message]
2008-03-02 20:04 ` Arjan van de Ven

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=4306ae870803011740k39d0769cy7fd6413b10146f74@mail.gmail.com \
    --to=hegang.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: OOPS: how to hook system_call_table in redhat es5.1 on x86_64 platform' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).