From: Helge Hafting <helgehaf@aitel.hist.no>
To: Libor Vanek <libor@conet.cz>
Cc: Anton Blanchard <anton@samba.org>, linux-kernel@vger.kernel.org
Subject: Re: Syscall table AKA hijacking syscalls
Date: Sat, 3 Jan 2004 16:41:58 +0100 [thread overview]
Message-ID: <20040103154158.GB5531@hh.idb.hist.no> (raw)
In-Reply-To: <3FF602C9.4080100@conet.cz>
On Sat, Jan 03, 2004 at 12:46:17AM +0100, Libor Vanek wrote:
> >>I'm writing some project which needs to hijack some syscalls in VFS
> >>layer. AFAIK in 2.6 is this "not-wanted" solution (even that there are
> >>some very nasty ways of doing it - see
> >>http://mail.nl.linux.org/kernelnewbies/2002-12/msg00266.html )
> >
> >
> >And it will fail miserably on many non x86 architectures for
> >various reasons:
> >
> >1. ppc64 and ia64 use function descriptors
> >2. sparc64 uses a 32bit call out table
> >
> >In short its not only an awful hack, its horribly non portable :)
>
> But in short you always get some syscall from userspace and have some table
> with function vectors assigned to each syscall, don't you?
>
> So you can have something like
> "append_this_function_before_syscall_sys_open" and
> "append_this_function_after_syscall_sys_open" which would be platform
> independent but will have platform dependent implementation.
Why bother overriding syscalls?
If you want a different sys_open, just modify/rewrite it. Then you get a kernel
that works your way without touching the syscall table (or other implementation of it)
at all.
Of course this sort of rewrite cannot be acitvated/deactivated by loading/unloading
a module. But that isn't necessary, use a writeable flag in /proc instead.
i.e.:
sys_open(...)
{
if (activated_in_proc) my_sys_open(...); else standard_sys_open(...);
}
Helge Hafting
prev parent reply other threads:[~2004-01-03 15:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-02 12:59 Libor Vanek
2004-01-02 13:08 ` Matti Aarnio
2004-01-02 13:26 ` Libor Vanek
2004-01-02 13:57 ` Ragnar Kjørstad
2004-01-02 15:39 ` Libor Vanek
2004-01-02 16:42 ` Jörn Engel
2004-01-02 15:12 ` Muli Ben-Yehuda
2004-01-02 15:38 ` Libor Vanek
2004-01-02 16:00 ` Christoph Hellwig
2004-01-02 16:35 ` Jörn Engel
2004-01-02 16:59 ` Libor Vanek
2004-01-02 18:04 ` Jörn Engel
2004-01-02 18:58 ` Libor Vanek
2004-01-02 19:15 ` Arjan van de Ven
2004-01-02 19:23 ` Libor Vanek
2004-01-02 19:18 ` Jörn Engel
2004-01-02 19:37 ` Libor Vanek
2004-01-02 19:56 ` Jörn Engel
2004-01-07 9:28 ` stefan.eletzhofer
2004-01-02 23:35 ` Anton Blanchard
2004-01-02 23:46 ` Libor Vanek
2004-01-03 15:41 ` Helge Hafting [this message]
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=20040103154158.GB5531@hh.idb.hist.no \
--to=helgehaf@aitel.hist.no \
--cc=anton@samba.org \
--cc=libor@conet.cz \
--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
all inboxes | Powered by JetHome®