Daniel Jacobowitz | 1 May 15:51 2006
Picon

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

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
(Continue reading)

Jeff Dike | 1 May 15:45 2006

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

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?
(Continue reading)

Daniel Jacobowitz | 1 May 17:01 2006
Picon

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

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
Jeff Dike | 1 May 18:39 2006

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

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 <jdike <at> addtoit.com>

Index: linux-2.6.16/arch/um/Makefile
===================================================================
--- linux-2.6.16.orig/arch/um/Makefile	2006-05-01 13:23:13.000000000 -0400
+++ linux-2.6.16/arch/um/Makefile	2006-05-01 13:28:47.000000000 -0400
 <at>  <at>  -96,7 +96,7  <at>  <at>  PHONY += linux
 all: linux

 linux: vmlinux
-	 <at> echo '  SYMLINK $ <at> '
+	 <at> echo '  LINK $ <at> '
 	$(Q)ln -f $< $ <at> 

 define archhelp

Jeff Dike | 1 May 18:46 2006

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

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
Blaisorblade | 1 May 19:52 2006
Picon

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

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 <jdike <at> addtoit.com>

Good catch:

Acked-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade <at> yahoo.it>
--

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

Jeff Dike | 1 May 19:02 2006

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

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.
(Continue reading)

Jeff Dike | 1 May 22:46 2006

[PATCH] UML - Change timer initialization

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 <jdike <at> addtoit.com>

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.000000000 -0500
+++ linux-2.6.17-mm/arch/um/kernel/time_kern.c	2006-05-01 17:34:41.000000000 -0400
 <at>  <at>  -209,4 +209,4  <at>  <at>  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
Andrew Morton | 1 May 23:58 2006

Re: [PATCH] UML - Change timer initialization

Jeff Dike <jdike <at> addtoit.com> 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.
Jeff Dike | 2 May 00:31 2006

Re: [PATCH] UML - Change timer initialization

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

Gmane