mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: mulix <mulix@actcom.co.il>
Cc: Andreas Ferber <aferber@techfak.uni-bielefeld.de>,
	linux-kernel@vger.kernel.org, Theodore Tso <tytso@mit.edu>,
	SA products <super.aorta@ntlworld.com>,
	choo@actcom.co.il
Subject: Re: faking time
Date: Tue, 12 Feb 2002 12:39:54 +0000	[thread overview]
Message-ID: <20020212123954.A108@toy.ucw.cz> (raw)
In-Reply-To: <20020212093355.A29445@devcon.net> <Pine.LNX.4.33.0202121052160.25841-100000@alhambra.merseine.nu>
In-Reply-To: <Pine.LNX.4.33.0202121052160.25841-100000@alhambra.merseine.nu>; from mulix@actcom.co.il on Tue, Feb 12, 2002 at 10:56:17AM +0200


Hi!
> > > Here's an LD_PRELOAD shared library that will do the trick... just
> > > export the environment variable FAKETIME with the time that you'd
> > > like, and then export the LD_PRELOAD environment variable to point
> > > that the faketime.so library, and then execute your program.  All
> > > programs that have these two environment variables set will have their
> > > time faked out accordingly.
> >
> > But note that this doesn't work with programs linked statically. If
> > you must fool one of those, ptrace() is the only way to do it without
> > some sort of kernel patch or module I think.

subterfugue.sf.net can do this. It has ready-to-use timeshift/timemultiply
module.

> it's in alpha stages right now, but it seems pretty stable so far (It
> Works For Me - i run it regularly on all of my machines). note that we
> currently support only logging system calls (a-la strace) and failing
> them with a user given parameter- rewriting system call parameters will
> require additional hackery, but not too much of it - on the order of one
> day of work. volunteers are welcome.

Why do you need kernel module at all?

BTW syscall rewriting is pretty hard (subterfugue solves that, but it definitely
took more than a day.

Imagine open('/foo/bar')

you rewrite it to open('/funny/bar')

then another thread comes and rewrites it back to '/foo/bar'.

Or imagine open(address in read-only memory).
								Pavel

-- 
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.


  reply	other threads:[~2002-02-12 21:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-11 11:49 SA products
2002-02-11 13:33 ` Alan Cox
2002-02-11 20:31 ` Pavel Machek
2002-02-11 21:29 ` Nerijus Baliunas
2002-02-11 23:08 ` Kilobug
2002-02-12  3:47 ` Theodore Tso
2002-02-12  8:33   ` Andreas Ferber
2002-02-12  8:56     ` mulix
2002-02-12 12:39       ` Pavel Machek [this message]
2002-02-12 21:43         ` guy keren
2002-02-12  6:00 ` David Schwartz
2002-02-12  6:09 ` Nick 'Sharkey' Moore

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=20020212123954.A108@toy.ucw.cz \
    --to=pavel@suse.cz \
    --cc=aferber@techfak.uni-bielefeld.de \
    --cc=choo@actcom.co.il \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mulix@actcom.co.il \
    --cc=super.aorta@ntlworld.com \
    --cc=tytso@mit.edu \
    /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®