All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <willy@w.ods.org>
To: Bill Pringlemeir <bpringle@sympatico.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Process system call access list.
Date: Sun, 16 Jan 2005 20:07:42 +0100	[thread overview]
Message-ID: <20050116190742.GL7048@alpha.home.local> (raw)
In-Reply-To: <m2wtudqjw9.fsf@sympatico.ca>

Hi,

On Sun, Jan 16, 2005 at 02:00:22PM -0500, Bill Pringlemeir wrote:
> 
> [please CC me.]
> 
> I was looking at phrack and many of the remote exploits rely on
> injecting some arbitrary code.  Generally is is something like
> 'exec("/bin/sh")' or something like that.
> 
> I was wondering if a section could be added to the link phase of a
> user application that would keep a list/bit mask of all kernel calls
> that the compiler had encountered in some section.
> 
> When the kernel loaded a process, it would keep a copy of the bit mask
> and perform a comparison to see if the process was intended to make
> the system call (perhaps only a sub-set of the entire system calls are
> needed).

A friend of mine worked on something a bit like this for kernel 2.2. He
had a module which accepted syscall-based sets of rules based on prog
name, pid, uid, argument size and values, etc... He could even execute
code before and after the syscall (he could use it to keep an image of
what 'make install' touches). The goal was to identify all syscalls
needed from opensource programs through code reviewing, and try to
identify them using strace for closed-source programs (or simply let
them be vulnerable). We found it useful to protect against some attacks
on network-only programs; For example, a reverse-proxy has no reason to
either fork, exec, mount, mknod, etc... We did not have time to port this
to 2.4. However, now that the syscall_table is unexported, this is history.

There are other programs which do more or less the same (systrace comes
to mind). But in your case where the compiler gives the syscall list itself,
I have no knowledge of any similar tool. But I fear that if the bitmask is
kept within an ELF section, the attacker would first have to rewrite the
mask before using syscalls again (or put it in an RO section ?).

Regards,
Willy


      reply	other threads:[~2005-01-16 19:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-16 19:00 Process system call access list Bill Pringlemeir
2005-01-16 19:07 ` Willy Tarreau [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=20050116190742.GL7048@alpha.home.local \
    --to=willy@w.ods.org \
    --cc=bpringle@sympatico.ca \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.