linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] UML + skas
@ 2003-12-30 18:33 jeremie le-hen
  2003-12-30 19:08 ` BlaisorBlade
  2004-01-06  2:58 ` Jeff Dike
  0 siblings, 2 replies; 5+ messages in thread
From: jeremie le-hen @ 2003-12-30 18:33 UTC (permalink / raw)
  To: user-mode-linux-devel

Hi all,

I have just subscribed to this list because I found a strange bug while
compiling an UML within an SKAS'd host.  Here is the problem :

(my host is a 2.4.23 kernel with the SKAS patch released on 2002/11/11)

--- cut here ---

droopy:tmp$ wget -q http://heanet.dl.sourceforge.net/sourceforge/user-mode-linux/uml-patch-2.4.23-1.bz2
droopy:tmp$ bzip2 -d uml-patch-2.4.23-1.bz2 
droopy:tmp$ wget -q http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.23.tar.bz2
droopy:tmp$ tar xfj linux-2.4.23.tar.bz2 
droopy:tmp$ cd linux-2.4.23
droopy:linux-2.4.23$ patch -p1 < ../uml-patch-2.4.23-1 
[... no error ...]
droopy:linux-2.4.23$ make menuconfig ARCH=um
[... do not change anything, just quit ...]
droopy:linux-2.4.23$ make dep ARCH=um
[...]
droopy:linux-2.4.23$ make linux ARCH=um
[...]
gcc   -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -U__i386__ -Ui386 -DUM_FASTCALL -g -D__arch_um__ -DSUBARCH=\"i386\" -D_LARGEFILE64_SOURCE  -I/space/kernel/tmp/linux-2.4.23/arch/um/include -I/space/kernel/tmp/linux-2.4.23/arch/um/kernel/tt/include -I/space/kernel/tmp/linux-2.4.23/arch/um/kernel/skas/include -D_GNU_SOURCE -c -o process.o process.c
[...]
In file included from process.c:27:
/space/kernel/tmp/linux-2.4.23/arch/um/include/skas_ptrace.h:9: redefinition of `struct ptrace_faultinfo'
/space/kernel/tmp/linux-2.4.23/arch/um/include/skas_ptrace.h:14: redefinition of `struct ptrace_ldt'
make[3]: *** [process.o] Error 1
[...]

--- cut here ---


After preprocessing the process.c file, I found that
`struct ptrace_faultinfo' and `struct ptrace_ldt' were first defined
in file `/usr/include/asm/ptrace.h' and then in
`arch/um/include/skas_ptrace.h'.  Since `/usr/include/asm/' is a symlink
in  `/usr/src/linux/` which in turn points to my kernel source, I thought
that it was maybe due to some tricky patch I have applied on my host's
kernel.  So I used a clean kernel source instead, and I made
`/usr/include/asm/' point in it.  And everything compiled perfectly.

Therefore I went through my various patches to see which one modified
`asm-i386/ptrace.h'.  And what a surprise when I saw the following in
`host-skas3.patch' :


--- cut here ---

diff -urN linux-2.4.23/include/asm-i386/ptrace.h linux-2.4.23-host_skas3_20031111/include/asm-i386/ptrace.h
--- linux-2.4.23/include/asm-i386/ptrace.h      2001-09-14 23:04:08.000000000 +0200
+++ linux-2.4.23-host_skas3_20031111/include/asm-i386/ptrace.h  2003-12-04 21:08:46.000000000 +0100
@@ -51,6 +51,22 @@
 
 #define PTRACE_SETOPTIONS         21
 
+struct ptrace_faultinfo {
+       int is_write;
+       unsigned long addr;
+};
+
+struct ptrace_ldt {
+       int func;
+       void *ptr;
+       unsigned long bytecount;
+};
+
+#define PTRACE_FAULTINFO 52
+#define PTRACE_SIGPENDING 53
+#define PTRACE_LDT 54
+#define PTRACE_SWITCH_MM 55

--- cut here ---

This is *exactly* the same content as `arch/um/include/skas_ptrace.h'.
From what I googled, it seems to be a known bug.  But it think it would
not be very difficult to make some #define protection around theses
structures to prevent from changing the destination of `/usr/src/linux/'
to a source without the SKAS patch applied.

Regards,
-- 
Jeremie LE HEN aka TtZ/TataZ                          jeremie.le-hen@epita.fr
                                                                 ttz@epita.fr
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-06 20:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-30 18:33 [uml-devel] UML + skas jeremie le-hen
2003-12-30 19:08 ` BlaisorBlade
2004-01-06  2:58 ` Jeff Dike
2004-01-06  4:33   ` attriel
2004-01-06 20:42   ` jeremie le-hen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox