Blaisorblade | 3 Feb 00:30 2006
Picon

Re: [PATCH] new version of ubd-many and uml_mconsole

On Monday 30 January 2006 00:16, James McMechan wrote:

> I also noted the your V3 cow format does not comply with the 64bit
> alignment rules and
> the compiler should insert a 32bit pad, or you could try __packed but that
> should
> segfault a real 64bit machine I think AMD64/EMT64 may allow unaligned
> access still someday PPC64/SPARC64/IA64 might get user mode linux and 64
> bit machines used to be picky about things like that.

We're (going to) use __packed but the thing doesn't work well yet - it 
compiles and runs, but a 64-bit uml_moo with packed still produces wrong 
results - one compiled as a 32-bit one works.

If you have any idea on this that may help...

For the alignment problem the format is not so good, however we can cope with 
that by reading 4-byte at once and reassembling them - the kernel has 
precoded get_unaligned() APIs to do such work (they work 1 byte at a time I 
guess, however).

I'm currently busy with exams so I can't work on the problem right now, 
however I should to finish soon and get back here.
--

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

		
____________________________________
(Continue reading)

roland | 4 Feb 03:07 2006
Picon

AoE with UML? have a strange problem with AoE root

Hello UML people,
 
unfortunately i wasn't into UML very much for the last months - but from time to time i take a look how the project is going. it`s nice to see that it's stell going on besides all of that virtualization "madness" out there in IT. 
 
i find UML very useful and this time gave it a try for testing a driver - but ì'm experience a rather strange problem and cannot explain what`s happening here - maybe someone can give me a hint how to dig into this.
 
 
i try to use AoE (Ata over Ethernet) inside UML.
 
for those who don`t know about AoE:
 
AoE is sort of iSCSI - but - without tcp/ip, just on ethernet layer
(btw: you don`t need to buy coraid's etherblade - there are software versions for that "AoE server part" on the net)
 
 
I don`t know yet if i can use it inside UML without problems at all - but - anyway what i'm experiencing is strange.
i would have expected a different behaviour.
 
I compiled an 2.6.15 vanilla kernel, manually patched with aoe6-21 driver from coraid`s (AoE inventor) website.
 
compile goes fine and i can start the kernel, seeing the AoE driver initialize
 
# ./linux
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...missing
Checking PROT_EXEC mmap in /tmp...OK
Checking for the skas3 patch in the host:
  - /proc/mm...found
  - PTRACE_FAULTINFO...found
  - PTRACE_LDT...found
UML running in SKAS3 mode
Linux version 2.6.15 (root <at> vmhost) (gcc version 3.3.3 (SuSE Linux)) #4 Sat Feb 4 02:35:50 CET 2006
Built 1 zonelists
Kernel command line: root=98:0
PID hash table entries: 256 (order: 8, 4096 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 29824k available
Mount-cache hash table entries: 512
Checking for host processor cmov support...Yes
Checking for host processor xmm support...No
Checking that host ptys support output SIGIO...Yes
Checking that host ptys support SIGIO on close...No, enabling workaround
Checking for /dev/anon on the host...Not available (open failed with errno 2)
Using 2.6 host AIO
NET: Registered protocol family 16
make_proc_exitcode : Failed to register /proc/exitcode
io scheduler noop registered
loop: loaded (max 8 devices)

aoe: aoe_init: AoE v21 initialised.        <- good - the AoE driver is initializing here
NET: Registered protocol family 17
Initialized stdio console driver
Console initialized on /dev/tty0
Failed to open 'root_fs', errno = 2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(98,0)
 
EIP: 0073:[<a00e20c1>] CPU: 0 Not tainted ESP: 007b:40001fb8 EFLAGS: 00000212
    Not tainted
EAX: 00000000 EBX: 000023b1 ECX: 00000013 EDX: 000023b1
ESI: 000023ae EDI: 00000000 EBP: 00000000 DS: 007b ES: 007b
a0253b60:  [<a003e2ad>] notifier_call_chain+0x2d/0x50
a0253b7c:  [<a002e871>] panic+0x71/0x110
a0253b94:  [<a0001ab8>] mount_block_root+0xc8/0x140
a0253bd8:  [<a0001b8c>] mount_root+0x5c/0x70
a0253bec:  [<a0001bc2>] prepare_namespace+0x22/0xf0
a0253c00:  [<a000c1d0>] init+0x0/0x180
a0253c04:  [<a000c1d0>] init+0x0/0x180
a0253c0c:  [<a000c2ec>] init+0x11c/0x180
a0253c28:  [<a0023a48>] run_kernel_thread+0x78/0xa0
a0253c38:  [<a000c1d0>] init+0x0/0x180
a0253c48:  [<a0023a10>] run_kernel_thread+0x40/0xa0
a0253cac:  [<a002ad87>] schedule_tail+0x27/0x1d0
a0253cd8:  [<a000c1d0>] init+0x0/0x180
a0253ce4:  [<a001a1de>] new_thread_handler+0xce/0x130
a0253ce8:  [<a000c1d0>] init+0x0/0x180
a0253d20:  [<a00e1f28>] __restore+0x0/0x8
a0253d60:  [<a00e20c1>] __kill+0x11/0x20
 
 
the panic is ok because  i didn`t supply anny params.
 
 
now comes the weird:
 
there is a new patch out which let's you use AoE for your root-device - just like NFS-root (which works inside UML).
 
The patch adds/changes just some lines in the AoE driver code and integrates into Kbuild.
 
If I set AoE-root(...)  to "yes" in .config compile goes fine again - but - the rather strange thing is, that i can`t even see the AoE driver initialize at all anymore.
 
The uml kernel get's stuck in the early beginning at boot time - look here:
 
# ./linux
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...missing
Checking PROT_EXEC mmap in /tmp...OK
Checking for the skas3 patch in the host:
  - /proc/mm...found
  - PTRACE_FAULTINFO...found
  - PTRACE_LDT...found
UML running in SKAS3 mode
---- hangs here forever. err - why that early ? -----
 
 
With a non UML kernel AoE and AoE root is working for me.
 
does anybody have a clue what is happening here ?
 
for those who want to take a closer look:
 
AoE driver is at:
 
AoE-root patch is at:
 
regards
roland
 
Jeff Dike | 4 Feb 05:16 2006

Re: AoE with UML? have a strange problem with AoE root

On Sat, Feb 04, 2006 at 03:07:23AM +0100, roland wrote:
> Checking that ptrace can change system call numbers...OK
> Checking syscall emulation patch for ptrace...missing
> Checking PROT_EXEC mmap in /tmp...OK
> Checking for the skas3 patch in the host:
>   - /proc/mm...found
>   - PTRACE_FAULTINFO...found
>   - PTRACE_LDT...found
> UML running in SKAS3 mode
> ---- hangs here forever. err - why that early ? -----

Ummm, strange...

Can you double-check that the config is the same, except for the new
AoE stuff.

Also, adding stderr=1 might give you some more output.

				Jeff

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
Ulf Bartelt | 4 Feb 09:57 2006
Picon

Re: [uml-user] Ich liebe Dich !!!

Na ich hoffe doch, daß Lissi sich für jemanden entscheidet, der ein
etwas korrekteres Deutsch zu schreiben in der Lage ist.

SCNR...

eeeehhh...
discard the S, I'm not sorry!

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
devzero | 4 Feb 11:17 2006
Picon

Re: AoE with UML? have a strange problem with AoE root

hi jeff, 

thanks for the quick response.

Jeff Dike <jdike <at> addtoit.com> schrieb am 04.02.06 05:15:38:
> 
> On Sat, Feb 04, 2006 at 03:07:23AM +0100, roland wrote:
> > Checking that ptrace can change system call numbers...OK
> > Checking syscall emulation patch for ptrace...missing
> > Checking PROT_EXEC mmap in /tmp...OK
> > Checking for the skas3 patch in the host:
> >   - /proc/mm...found
> >   - PTRACE_FAULTINFO...found
> >   - PTRACE_LDT...found
> > UML running in SKAS3 mode
> > ---- hangs here forever. err - why that early ? -----
> 
> Ummm, strange...
> 
> Can you double-check that the config is the same, except for the new
> AoE stuff.

yes - the only difference is the AoE-root stuff.

diff .config .config_aeoroot
4c4
< # Sat Feb  4 10:56:08 2006
---
> # Sat Feb  4 02:40:14 2006
222c222,224
< # CONFIG_ATA_OVER_ETH_ROOT is not set
---
> CONFIG_ATA_OVER_ETH_ROOT=y
> CONFIG_ATA_OVER_ETH_ROOT_SHELF=1
> CONFIG_ATA_OVER_ETH_ROOT_SLOT=1

> Also, adding stderr=1 might give you some more output.

you mean adding this to the commandline? 
mhh - doesn`t seem to make a difference.

if somewone might want to try if it behaves the same on their system, i put the working and the broken binary to

www.my-vserver.de/stuff/uml/linux.aoe_ok.bz2
www.my-vserver.de/stuff/uml/linux.aoeroot_notok.bz2

for taking a look into the relevant source, i tarred drivers/block/aoe, too :

www.my-vserver.de/stuff/uml/aoe.tar.bz2

TIA

roland

______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
info | 5 Feb 09:29 2006

突乳!Hなおねぇさんww -05

$B!!(B_/$B!'(B_/*_/$B!'(B_/*_/$B!'(B_/*_/$B!'(B_/*_/$B!'(B_/*_/$B!'(B

$B!!FM(-F}(-!*(-#H(-$J(-$*(-$M(-$'(-$5(-$s(-(B

$B!!(,(0(,(0(,(0(,(0(,(0(,(0(,(0(,(0(,(0(,(0(B

$B!!(B_/*_/$B!'(B_/*_/$B!'(B_/*_/$B!'(B_/*_/$B!'(B_/*_/$B!'(B_/*

$B!|KE9-9pBeM}E9$K6P$a$k<+>N%+%j%9%^1D6H%^%s!X#0;a!Y$,(B

$B7+$j9-$2$k>W7b$N<rCSFyNSNx0&3(4,%l%]!<%H(B!!

$B$G$-$k$ <at> $199?7$7$F%3%C%A4X78$N(B

$B1D6HJs9p=qBe$o$j$K8x3+$7$F$$$/$D$b$j$J%V%m%0(B!!

$B!X2G$K$_$D$+$i$J$$$h$&$K!#!#!#(B

$B$_$D$+$C$?$i;&$5$l$A$c$&$s$ <at> $m$&$J!!26#w#w!Y(B

$B(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B

$B!y!z!y!!(Bhttp://racoonlove.info/wty/ $B!!!y!z!y(B

$B(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B

$B"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#(B

---------------------------------------------

$B$*CN$i$;%a!<%kITMW$N>l9g$O2<5-%"%I%l%9$K$4JV?.$/$ <at> $5$$!#(B

refusal <at> ok.kz

--------------------------------------------->

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
Jeff Dike | 7 Feb 03:23 2006

[PATCH 1/8] UML - Compilation warning removal

With gcc 4.1.0, I get a bunch of warnings about consts being lost in the
copy_user code.  This patch fixes them by adding consts where necessary.

Signed-off-by: Jeff Dike <jdike <at> addtoit.com>

Index: linux-2.6.15/arch/um/include/skas/uaccess-skas.h
===================================================================
--- linux-2.6.15.orig/arch/um/include/skas/uaccess-skas.h	2006-02-06 17:33:55.000000000 -0500
+++ linux-2.6.15/arch/um/include/skas/uaccess-skas.h	2006-02-06 17:34:21.000000000 -0500
 <at>  <at>  -11,8 +11,8  <at>  <at> 
 /* No SKAS-specific checking. */
 #define access_ok_skas(type, addr, size) 0

-extern int copy_from_user_skas(void *to, const void __user *from, int n);
-extern int copy_to_user_skas(void __user *to, const void *from, int n);
+extern int copy_from_user_skas(const void *to, const void __user *from, int n);
+extern int copy_to_user_skas(const void __user *to, const void *from, int n);
 extern int strncpy_from_user_skas(char *dst, const char __user *src, int count);
 extern int __clear_user_skas(void __user *mem, int len);
 extern int clear_user_skas(void __user *mem, int len);
Index: linux-2.6.15/arch/um/include/tt/uaccess-tt.h
===================================================================
--- linux-2.6.15.orig/arch/um/include/tt/uaccess-tt.h	2006-02-06 17:33:55.000000000 -0500
+++ linux-2.6.15/arch/um/include/tt/uaccess-tt.h	2006-02-06 17:34:21.000000000 -0500
 <at>  <at>  -38,8 +38,8  <at>  <at>  extern int __do_clear_user(void *mem, si
 extern int __do_strnlen_user(const char *str, unsigned long n,
 			     void **fault_addr, void **fault_catcher);

-extern int copy_from_user_tt(void *to, const void __user *from, int n);
-extern int copy_to_user_tt(void __user *to, const void *from, int n);
+extern int copy_from_user_tt(const void *to, const void __user *from, int n);
+extern int copy_to_user_tt(const void __user *to, const void *from, int n);
 extern int strncpy_from_user_tt(char *dst, const char __user *src, int count);
 extern int __clear_user_tt(void __user *mem, int len);
 extern int clear_user_tt(void __user *mem, int len);
Index: linux-2.6.15/arch/um/include/um_uaccess.h
===================================================================
--- linux-2.6.15.orig/arch/um/include/um_uaccess.h	2006-01-03 17:39:46.000000000 -0500
+++ linux-2.6.15/arch/um/include/um_uaccess.h	2006-02-06 17:34:24.000000000 -0500
 <at>  <at>  -39,13 +39,13  <at>  <at> 
 	  segment_eq(get_fs(), KERNEL_DS) || \
 	  CHOOSE_MODE_PROC(access_ok_tt, access_ok_skas, type, addr, size)))

-static inline int copy_from_user(void *to, const void __user *from, int n)
+static inline int copy_from_user(const void *to, const void __user *from, int n)
 {
 	return(CHOOSE_MODE_PROC(copy_from_user_tt, copy_from_user_skas, to,
 				from, n));
 }

-static inline int copy_to_user(void __user *to, const void *from, int n)
+static inline int copy_to_user(const void __user *to, const void *from, int n)
 {
 	return(CHOOSE_MODE_PROC(copy_to_user_tt, copy_to_user_skas, to, 
 				from, n));
Index: linux-2.6.15/arch/um/kernel/skas/uaccess.c
===================================================================
--- linux-2.6.15.orig/arch/um/kernel/skas/uaccess.c	2006-02-06 17:33:55.000000000 -0500
+++ linux-2.6.15/arch/um/kernel/skas/uaccess.c	2006-02-06 17:34:24.000000000 -0500
 <at>  <at>  -136,10 +136,10  <at>  <at>  static int copy_chunk_from_user(unsigned
 	return(0);
 }

-int copy_from_user_skas(void *to, const void __user *from, int n)
+int copy_from_user_skas(const void *to, const void __user *from, int n)
 {
 	if(segment_eq(get_fs(), KERNEL_DS)){
-		memcpy(to, (__force void*)from, n);
+		memcpy((void *) to, (__force void*)from, n);
 		return(0);
 	}

 <at>  <at>  -157,7 +157,7  <at>  <at>  static int copy_chunk_to_user(unsigned l
 	return(0);
 }

-int copy_to_user_skas(void __user *to, const void *from, int n)
+int copy_to_user_skas(const void __user *to, const void *from, int n)
 {
 	if(segment_eq(get_fs(), KERNEL_DS)){
 		memcpy((__force void*)to, from, n);
Index: linux-2.6.15/arch/um/kernel/tt/uaccess.c
===================================================================
--- linux-2.6.15.orig/arch/um/kernel/tt/uaccess.c	2006-01-03 17:39:46.000000000 -0500
+++ linux-2.6.15/arch/um/kernel/tt/uaccess.c	2006-02-06 17:34:24.000000000 -0500
 <at>  <at>  -6,7 +6,7  <at>  <at> 
 #include "linux/sched.h"
 #include "asm/uaccess.h"

-int copy_from_user_tt(void *to, const void __user *from, int n)
+int copy_from_user_tt(const void *to, const void __user *from, int n)
 {
 	if(!access_ok(VERIFY_READ, from, n))
 		return(n);
 <at>  <at>  -15,7 +15,7  <at>  <at>  int copy_from_user_tt(void *to, const vo
 				   &current->thread.fault_catcher));
 }

-int copy_to_user_tt(void __user *to, const void *from, int n)
+int copy_to_user_tt(const void __user *to, const void *from, int n)
 {
 	if(!access_ok(VERIFY_WRITE, to, n))
 		return(n);
Index: linux-2.6.15/include/asm-um/uaccess.h
===================================================================
--- linux-2.6.15.orig/include/asm-um/uaccess.h	2005-10-28 12:58:15.000000000 -0400
+++ linux-2.6.15/include/asm-um/uaccess.h	2006-02-06 17:34:24.000000000 -0500
 <at>  <at>  -41,7 +41,7  <at>  <at> 

 #define __get_user(x, ptr) \
 ({ \
-        const __typeof__(ptr) __private_ptr = ptr; \
+        const __typeof__(ptr) __user __private_ptr = ptr; \
         __typeof__(*(__private_ptr)) __private_val; \
         int __private_ret = -EFAULT; \
         (x) = (__typeof__(*(__private_ptr)))0; \

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
Jeff Dike | 7 Feb 03:23 2006

[PATCH 0/8] UML - Eight patches for 2.6.16

The upcoming patch series fixes bugs, compilation failures, and warnings,
and removes a dead file.

				Jeff

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
Jeff Dike | 7 Feb 03:23 2006

[PATCH 2/8] UML - Define jmpbuf access constants

With newer libcs, the JB_* macros (which we shouldn't be using anyway, 
probably) go away.  This patch defines them if setjmp.h doesn't.  It'd
be nice to have a real way to do this, as sysrq-t requires a way to
get registers from out-of-context threads, which we store in jmpbufs.

Signed-off-by: Jeff Dike <jdike <at> addtoit.com>

Index: linux-2.6.15/arch/um/os-Linux/sys-i386/registers.c
===================================================================
--- linux-2.6.15.orig/arch/um/os-Linux/sys-i386/registers.c	2005-10-28 12:58:12.000000000 -0400
+++ linux-2.6.15/arch/um/os-Linux/sys-i386/registers.c	2006-02-06 17:34:36.000000000 -0500
 <at>  <at>  -127,6 +127,12  <at>  <at>  void get_safe_registers(unsigned long *r
 	memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long));
 }

+#ifndef JB_PC
+#define JB_PC 5
+#define JB_SP 4
+#define JB_BP 3
+#endif
+
 void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer)
 {
 	struct __jmp_buf_tag *jmpbuf = buffer;
Index: linux-2.6.15/arch/um/os-Linux/sys-x86_64/registers.c
===================================================================
--- linux-2.6.15.orig/arch/um/os-Linux/sys-x86_64/registers.c	2005-10-28 12:58:12.000000000 -0400
+++ linux-2.6.15/arch/um/os-Linux/sys-x86_64/registers.c	2006-02-06 17:34:36.000000000 -0500
 <at>  <at>  -75,6 +75,12  <at>  <at>  void get_safe_registers(unsigned long *r
 	memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long));
 }

+#ifndef JB_PC
+#define JB_PC 7
+#define JB_RSP 6
+#define JB_RBP 1
+#endif
+
 void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer)
 {
 	struct __jmp_buf_tag *jmpbuf = buffer;

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
Jeff Dike | 7 Feb 03:23 2006

[PATCH 4/8] UML - Close TUN/TAP file descriptors

When UML opens a TUN/TAP device, the file descriptor could be copied into
later, long-lived threads, holding the device open even after the interface
is taken down, preventing it from being brought up again.  This patch makes
these descriptors close-on-exec so that they disappear from helper processes,
and adds CLONE_FILES to a UML helper thread so that the descriptors are closed
in the thread when they are closed elsewhere in UML.

Signed-off-by: Jeff Dike <jdike <at> addtoit.com>

Index: linux-2.6.15/arch/um/drivers/chan_user.c
===================================================================
--- linux-2.6.15.orig/arch/um/drivers/chan_user.c	2006-01-03 17:39:46.000000000 -0500
+++ linux-2.6.15/arch/um/drivers/chan_user.c	2006-02-06 17:35:47.000000000 -0500
 <at>  <at>  -9,6 +9,7  <at>  <at> 
 #include <termios.h>
 #include <string.h>
 #include <signal.h>
+#include <sched.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 <at>  <at>  -73,7 +74,6  <at>  <at>  static void winch_handler(int sig)
 struct winch_data {
 	int pty_fd;
 	int pipe_fd;
-	int close_me;
 };

 static int winch_thread(void *arg)
 <at>  <at>  -84,7 +84,6  <at>  <at>  static int winch_thread(void *arg)
 	int count, err;
 	char c = 1;

-	os_close_file(data->close_me);
 	pty_fd = data->pty_fd;
 	pipe_fd = data->pipe_fd;
 	count = os_write_file(pipe_fd, &c, sizeof(c));
 <at>  <at>  -153,15 +152,16  <at>  <at>  static int winch_tramp(int fd, struct tt
 	}

 	data = ((struct winch_data) { .pty_fd 		= fd,
-				      .pipe_fd 		= fds[1],
-				      .close_me 	= fds[0] } );
-	err = run_helper_thread(winch_thread, &data, 0, &stack, 0);
+				      .pipe_fd 		= fds[1] } );
+	/* CLONE_FILES so this thread doesn't hold open files which are open
+	 * now, but later closed.  This is a problem with /dev/net/tun.
+	 */
+	err = run_helper_thread(winch_thread, &data, CLONE_FILES, &stack, 0);
 	if(err < 0){
 		printk("fork of winch_thread failed - errno = %d\n", errno);
 		goto out_close;
 	}

-	os_close_file(fds[1]);
 	*fd_out = fds[0];
 	n = os_read_file(fds[0], &c, sizeof(c));
 	if(n != sizeof(c)){
 <at>  <at>  -169,13 +169,12  <at>  <at>  static int winch_tramp(int fd, struct tt
 		printk("read failed, err = %d\n", -n);
 		printk("fd %d will not support SIGWINCH\n", fd);
                 err = -EINVAL;
-		goto out_close1;
+		goto out_close;
 	}
 	return err ;

  out_close:
 	os_close_file(fds[1]);
- out_close1:
 	os_close_file(fds[0]);
  out:
 	return err;
Index: linux-2.6.15/arch/um/os-Linux/drivers/tuntap_user.c
===================================================================
--- linux-2.6.15.orig/arch/um/os-Linux/drivers/tuntap_user.c	2006-01-03 17:39:46.000000000 -0500
+++ linux-2.6.15/arch/um/os-Linux/drivers/tuntap_user.c	2006-02-06 17:35:47.000000000 -0500
 <at>  <at>  -122,6 +122,7  <at>  <at>  static int tuntap_open_tramp(char *gate,
 		return(-EINVAL);
 	}
 	*fd_out = ((int *) CMSG_DATA(cmsg))[0];
+	os_set_exec_close(*fd_out, 1);
 	return(0);
 }

 <at>  <at>  -137,7 +138,8  <at>  <at>  static int tuntap_open(void *data)
 		return(err);

 	if(pri->fixed_config){
-		pri->fd = os_open_file("/dev/net/tun", of_rdwr(OPENFLAGS()), 0);
+		pri->fd = os_open_file("/dev/net/tun",
+				       of_cloexec(of_rdwr(OPENFLAGS())), 0);
 		if(pri->fd < 0){
 			printk("Failed to open /dev/net/tun, err = %d\n",
 			       -pri-≥fd);

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

Gmane