Re: [uml-devel] [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK

2006-05-01 Thread Daniel Jacobowitz
On Fri, Apr 28, 2006 at 09:49:56PM -0400, Jeff Dike wrote:
> On Fri, Apr 28, 2006 at 10:28:46PM +0200, Blaisorblade wrote:
> > 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);
> 
> Yup, I like this.

I really recommend you not do this.  One (better) suggestion earlier
was:

struct {
  int bitmask_length;
  int flags;
  char bitmask[0];
};

The difference between this case and the sigprocmask example is that
the size of a sigset_t is very hard to change - it's a userspace ABI
break.  If you want to model it after sigprocmask, don't look at the
man page, which describes the POSIX function.  Look at the more recent
RT version of the syscall instead:

sys_rt_sigprocmask(int how, sigset_t __user *set, sigset_t __user *oset, size_t 
sigsetsize)

Suppose the kernel knows about 32 more syscalls than userspace.  It's
going to read extra bits out of the bitmask that userspace didn't
initialize!

Also, if you store the mask with the child process, it risks surprising
existing tracers: attach, set mask, detach, then the next time someone
attaches an old version of strace some syscalls will be "hidden".


-- 
Daniel Jacobowitz
CodeSourcery


---
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


Re: [uml-devel] [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK

2006-05-01 Thread Jeff Dike
On Mon, May 01, 2006 at 09:51:27AM -0400, Daniel Jacobowitz wrote:
> On Fri, Apr 28, 2006 at 09:49:56PM -0400, Jeff Dike wrote:
> > On Fri, Apr 28, 2006 at 10:28:46PM +0200, Blaisorblade wrote:
> > > bitmask = 0;
> > > set_bit(__NR_tee, bitmask);
> > > ptrace(PTRACE_SET_TRACEONLY, bitmask);
> > 
> > Yup, I like this.
> 
> I really recommend you not do this.  

> Suppose the kernel knows about 32 more syscalls than userspace.  It's
> going to read extra bits out of the bitmask that userspace didn't
> initialize!

The example above is a sketch, not a fully formed, compilable user.  Every
proposed interface has had the mask length passed in - in the case
above in the data argument.

> Also, if you store the mask with the child process, it risks surprising
> existing tracers: attach, set mask, detach, then the next time someone
> attaches an old version of strace some syscalls will be "hidden".

Not if the mask only survives for the duration of a PTRACE_ATTACH, and
the mask is released on PTRACE_DETACH.

Jeff


---
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


Re: [uml-devel] [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK

2006-05-01 Thread Daniel Jacobowitz
On Mon, May 01, 2006 at 09:45:52AM -0400, Jeff Dike wrote:
> The example above is a sketch, not a fully formed, compilable user.  Every
> proposed interface has had the mask length passed in - in the case
> above in the data argument.

Oh.  Well, then, I must have missed a message when I read the thread
this morning - sorry.  I'll watch for the next posting.

-- 
Daniel Jacobowitz
CodeSourcery


---
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


[uml-devel] [PATCH] UML - uml-makefile-nicer uses SYMLINK incorrectly

2006-05-01 Thread Jeff Dike
Blaisorblade's uml-makefile-nicer makes a V=0 build say SYMLINK where what's
happening is really a LINK.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>

Index: linux-2.6.16/arch/um/Makefile
===
--- linux-2.6.16.orig/arch/um/Makefile  2006-05-01 13:23:13.0 -0400
+++ linux-2.6.16/arch/um/Makefile   2006-05-01 13:28:47.0 -0400
@@ -96,7 +96,7 @@ PHONY += linux
 all: linux
 
 linux: vmlinux
-   @echo '  SYMLINK $@'
+   @echo '  LINK $@'
$(Q)ln -f $< $@
 
 define archhelp



---
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


Re: [uml-devel] Re: [PATCH 0/6] UML - Small patches for 2.6.17

2006-05-01 Thread Jeff Dike
On Sat, Apr 29, 2006 at 08:44:30AM -0700, Andrew Morton wrote:
> Lindent doesn't do a terribly good job, and one ends up having to perform a
> lot of manual fixups.  Perhaps as many as are presently needed.

We are doing style cleanups as code is changed - this is slow, but I
think this is the best way to go, as it is fairly unobtrusive and
doesn't create any merge barriers.

Jeff


---
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


[uml-devel] Re: [PATCH] UML - uml-makefile-nicer uses SYMLINK incorrectly

2006-05-01 Thread Blaisorblade
On Monday 01 May 2006 18:39, Jeff Dike wrote:
> Blaisorblade's uml-makefile-nicer makes a V=0 build say SYMLINK where
> what's happening is really a LINK.
>
> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>

Good catch:

Acked-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
-- 
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


Re: [uml-devel] [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK

2006-05-01 Thread Jeff Dike
On Sat, Apr 29, 2006 at 10:49:07AM +0200, Heiko Carstens wrote:
> IMHO this is way too complicated. Introducing a ptrace call that returns
> the number of syscalls and forcing user space to pass a complete bitmask
> is much easier. Also the semantics are much easier to understand.

This sounds more complicated than what we are proposing.  

This would make the process care about the number of system calls
implemented by the kernel, which is something that doesn't even come
up in the normal case with the current interface.  You only care about
it if you get a -EINVAL and want to figure out exactly why.

>From a practical point of view, you would want code that looks like
this:
n = nsyscalls();
mask = malloc((n + 7)/8);
if(mask == NULL)
return;

/* Zero mask, set bits, call ptrace */

free(mask);

rather than code like this:

int mask[(BIGGEST_SYSCALL_I_CARE_ABOUT + 7) / 8];

/* Zero mask, set bits, call ptrace */

That doesn't seem like an improvement to me.

The second case would be more complicated if it wanted to figure out
what the problem was if ptrace returned -EINVAL.  However, some users
won't care, so that complexity is optional.  For example, UML will
already know by other means what system calls are implemented on the
host, so it won't bother looking at the mask in the case of a
failure.  I'm not sure what the right thing for strace is.

> In addition your proposal would already introduce a rather complicated
> interface to figure out how many syscalls the kernel has. I'm sure this
> will be (mis)used sooner or later.

How?  And, if so, why is that a problem?

There are already complicated ways to figure out what system calls the
kernel has, and I don't recall them causing problems.

Jeff


---
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


[uml-devel] Re: [PATCH] UML - Change timer initialization

2006-05-01 Thread Andrew Morton
Jeff Dike <[EMAIL PROTECTED]> wrote:
>
> This is definite 2.6.17 material...
> 
> As of rc3-mm1, inet_init, which schedules, is called before the UML 
> timer_init,
> which sets up the timer.  The result is the interval timers being manipulated
> before the appropriate signal handlers are established, causing unhandled
> timers.
> 

Which means nobody's tested uml against the last couple of -mm's.  Bad.


---
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


[uml-devel] [PATCH] UML - Change timer initialization

2006-05-01 Thread Jeff Dike
This is definite 2.6.17 material...

As of rc3-mm1, inet_init, which schedules, is called before the UML timer_init,
which sets up the timer.  The result is the interval timers being manipulated
before the appropriate signal handlers are established, causing unhandled
timers.

This is fixed by making timer_init be called earlier.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>

Index: linux-2.6.17-mm/arch/um/kernel/time_kern.c
===
--- linux-2.6.17-mm.orig/arch/um/kernel/time_kern.c 2006-03-23 
16:40:20.0 -0500
+++ linux-2.6.17-mm/arch/um/kernel/time_kern.c  2006-05-01 17:34:41.0 
-0400
@@ -209,4 +209,4 @@ int __init timer_init(void)
return(0);
 }
 
-__initcall(timer_init);
+arch_initcall(timer_init);



---
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


[uml-devel] Re: [PATCH] UML - Change timer initialization

2006-05-01 Thread Jeff Dike
On Mon, May 01, 2006 at 02:58:37PM -0700, Andrew Morton wrote:
> Which means nobody's tested uml against the last couple of -mm's.  Bad.

Yeah.

I didn't check rc2-mm1 because it came out after rc3, and I missed
rc1-mm3.  But rc1-mm2 was OK.

Jeff


---
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


Re: [uml-devel] [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK

2006-05-01 Thread Heiko Carstens
> This sounds more complicated than what we are proposing.  
> 
> This would make the process care about the number of system calls
> implemented by the kernel, which is something that doesn't even come
> up in the normal case with the current interface.  You only care about
> it if you get a -EINVAL and want to figure out exactly why.
> 
> From a practical point of view, you would want code that looks like
> this:

Yes.

[1]
>   n = nsyscalls();
>   mask = malloc((n + 7)/8);
>   if(mask == NULL)
>   return;
> 
>   /* Zero mask, set bits, call ptrace */
> 
>   free(mask);
> 

[2]
> rather than code like this:
> 
>   int mask[(BIGGEST_SYSCALL_I_CARE_ABOUT + 7) / 8];
> 
>   /* Zero mask, set bits, call ptrace */


> That doesn't seem like an improvement to me.
> 
> The second case would be more complicated if it wanted to figure out
> what the problem was if ptrace returned -EINVAL.  However, some users

That is actually my point. If you're checking for errors you will end up
first doing [2] and later on doing something like [1] anyway...

> > In addition your proposal would already introduce a rather complicated
> > interface to figure out how many syscalls the kernel has. I'm sure this
> > will be (mis)used sooner or later.
> 
> How?  And, if so, why is that a problem?

>From the proposal:


> 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.


So you just need to pass a large enough bitmask with all ones and the kernel
will put zeroes in the bitmask up to the bit number NR_sycalls - 1.
Counting the zeroes should work...


---
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