From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: Jeff Dike <jdike@addtoit.com>,
linux-kernel@vger.kernel.org,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Bodo Stroesser <bstroesser@fujitsu-siemens.com>
Subject: Re: [uml-devel] [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK
Date: Fri, 28 Apr 2006 22:28:46 +0200 [thread overview]
Message-ID: <200604282228.46681.blaisorblade@yahoo.it> (raw)
In-Reply-To: <20060426154607.GA8628@ccure.user-mode-linux.org>
On Wednesday 26 April 2006 17:46, Jeff Dike wrote:
> On Wed, Apr 26, 2006 at 05:47:54PM +0200, Blaisorblade wrote:
> Why not just zero out the bits that the kernel knows about? Then, if
> we return -EINVAL, the process just looks at the remaining bits that
> are set to see what system calls the kernel didn't know about.
Good idea. When you're leaving the whole mask to 1 _except_ some bits set to 0
what do you suggest? Setting everything to 1 so the process sees the invalid
0 bits?
However, I've had a new idea for the API form - sigprocmask() is used to
either enable or disable some bits in the _signal_ mask. But you pass in both
cases the bits to toggle. Making the API more similar to this would be good.
Even if the semantics of both settings and clearing bits are unclear.
Probably, simply making both calls _set_ the mask but one of them (i.e.
MASK_DEFAULT_TRACE) reverse the mask before setting and after zero-extending
it to the right.
Ok, this gives us a definite proposal, which I finally like:
* to exclude sys_tee:
bitmask = 0;
set_bit(__NR_tee, bitmask);
ptrace(PTRACE_SET_NOTRACE, bitmask);
* to trace only sys_tee:
bitmask = 0;
set_bit(__NR_tee, bitmask);
ptrace(PTRACE_SET_TRACEONLY, bitmask);
Semantics:
in both cases, the mask is first zero-extended to the right (for syscalls not
known to userspace), bits for syscall not known to the kernel are checked and
the call fails if any of them is 1, and in the failure case E2BIG or
EOVERFLOW is returned (I want to avoid EINVAL and ENOSYS to avoid confusion)
and the part of the mask known to the kernel is 0-ed.
In case of success, for NOTRACE (which was DEFAULT_TRACE) the mask is reversed
before copying in the kernel syscall mask, for TRACEONLY it's copied there
directly.
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale!
http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2006-04-28 20:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-13 17:20 [uml-devel] [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK Jeff Dike
2006-04-18 12:57 ` [uml-devel] " Pavel Machek
2006-04-26 18:38 ` Jeff Dike
2006-04-20 9:05 ` Heiko Carstens
2006-04-20 14:17 ` Bodo Stroesser
2006-04-25 18:32 ` Jeff Dike
2006-04-26 20:26 ` Charles P. Wright
2006-04-26 19:40 ` Jeff Dike
2006-04-26 21:29 ` Charles P. Wright
2006-04-21 18:16 ` Blaisorblade
2006-04-21 18:38 ` Blaisorblade
2006-04-22 7:06 ` Heiko Carstens
2006-04-22 8:32 ` Blaisorblade
2006-04-25 15:59 ` Jeff Dike
2006-04-21 18:34 ` [uml-devel] " Blaisorblade
2006-04-25 16:29 ` Jeff Dike
2006-04-26 15:47 ` Blaisorblade
2006-04-26 15:46 ` Jeff Dike
2006-04-28 20:28 ` Blaisorblade [this message]
2006-04-29 1:49 ` Jeff Dike
2006-05-01 13:51 ` Daniel Jacobowitz
2006-05-01 13:45 ` Jeff Dike
2006-05-01 15:01 ` Daniel Jacobowitz
2006-04-29 8:49 ` Heiko Carstens
2006-05-01 17:02 ` Jeff Dike
2006-05-02 6:57 ` Heiko Carstens
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=200604282228.46681.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=bstroesser@fujitsu-siemens.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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