LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Linux 2.4.31 with kdb and aslr (https://www.linuxquestions.org/questions/linux-software-2/linux-2-4-31-with-kdb-and-aslr-407462/)

iw05t 01-24-2006 12:47 PM

Linux 2.4.31 with kdb and aslr
 
Hi,

I'm running Linux 2.4.31 and I have patched it with PaX ASLRfor 2.4.31, which went smoothly. I then patched the kernel with kdb-v4.3-2.4.27-common-1 and kdb-v4.3-2.4.27-i386-1 since there is no patch for the 2.4.31 kernel.

I got a few errors but fixed that by hand.

>>> cat ../kdb-v4.3-2.4.27-common-1 | patch - p1 <<<
patching file Documentation/Configure.help
Hunk #1 succeeded at 22301 (offset 44 lines).
patching file Documentation/kdb/dump.txt
patching file Documentation/kdb/kdb.mm
patching file Documentation/kdb/kdb_bp.man
patching file Documentation/kdb/kdb_bt.man
patching file Documentation/kdb/kdb_env.man
patching file Documentation/kdb/kdb_ll.man
patching file Documentation/kdb/kdb_md.man
patching file Documentation/kdb/kdb_rd.man
patching file Documentation/kdb/kdb_sr.man
patching file Documentation/kdb/kdb_ss.man
patching file Documentation/kdb/slides
patching file Makefile
patching file drivers/char/keyboard.c
patching file drivers/char/serial.c
Hunk #2 succeeded at 603 with fuzz 1 (offset 11 lines).
Hunk #3 succeeded at 6030 (offset -6 lines).
patching file drivers/char/sn_serial.c
patching file drivers/sbus/char/sab82532.c
patching file drivers/sbus/char/su.c
Hunk #3 succeeded at 2991 (offset -7 lines).
patching file drivers/sbus/char/sunkbd.c
patching file drivers/sbus/char/sunkeymap.c
patching file drivers/usb/hid-core.c
Hunk #2 succeeded at 1458 (offset 22 lines).
patching file drivers/usb/host/usb-uhci.c
Hunk #2 succeeded at 2916 (offset -5 lines).
patching file drivers/usb/usbkbd.c
patching file include/linux/dis-asm.h
patching file include/linux/kallsyms.h
patching file include/linux/kdb.h
patching file include/linux/kdbprivate.h
patching file include/linux/module.h
patching file include/linux/sysctl.h
patching file init/main.c
Hunk #2 succeeded at 274 (offset 14 lines).
patching file kdb/ChangeLog
patching file kdb/Makefile
patching file kdb/kdb_bp.c
patching file kdb/kdb_bt.c
patching file kdb/kdb_cmds
patching file kdb/kdb_id.c
patching file kdb/kdb_io.c
patching file kdb/kdbmain.c
patching file kdb/kdbsupport.c
patching file kdb/modules/Makefile
patching file kdb/modules/kdbm_pg.c
patching file kdb/modules/kdbm_task.c
patching file kdb/modules/kdbm_vm.c
patching file kernel/Makefile
patching file kernel/kallsyms.c
patching file kernel/ksyms.c
Hunk #2 succeeded at 87 with fuzz 1.
Hunk #3 succeeded at 635 (offset 1 line).
patching file kernel/module.c
patching file kernel/printk.c
Hunk #1 succeeded at 297 (offset 1 line).
patching file kernel/sched.c
patching file kernel/signal.c
patching file kernel/sysctl.c
Hunk #2 FAILED at 281.
1 out of 2 hunks FAILED -- saving rejects to file kernel/sysctl.c.rej
patching file mm/memory.c
Hunk #1 succeeded at 1664 (offset 167 lines).


>>> cat ../kdb-v4.3-2.4.27-i386-1 | patch -p1 <<<
patching file arch/i386/Makefile
Hunk #1 succeeded at 105 (offset 4 lines).
Hunk #2 succeeded at 118 with fuzz 1.
patching file arch/i386/config.in
Hunk #1 succeeded at 483 (offset 4 lines).
patching file arch/i386/kdb/ChangeLog
patching file arch/i386/kdb/Makefile
patching file arch/i386/kdb/ansidecl.h
patching file arch/i386/kdb/bfd.h
patching file arch/i386/kdb/i386-dis.c
patching file arch/i386/kdb/kdba_bp.c
patching file arch/i386/kdb/kdba_bt.c
patching file arch/i386/kdb/kdba_id.c
patching file arch/i386/kdb/kdba_io.c
patching file arch/i386/kdb/kdbasupport.c
patching file arch/i386/kernel/bluesmoke.c
patching file arch/i386/kernel/entry.S
Hunk #2 succeeded at 411 with fuzz 2 (offset 11 lines).
patching file arch/i386/kernel/i8259.c
patching file arch/i386/kernel/io_apic.c
patching file arch/i386/kernel/irq.c
patching file arch/i386/kernel/nmi.c
patching file arch/i386/kernel/process.c
patching file arch/i386/kernel/smp.c
patching file arch/i386/kernel/smpboot.c
patching file arch/i386/kernel/traps.c
Hunk #3 succeeded at 81 (offset -5 lines).
Hunk #5 succeeded at 214 (offset -5 lines).
Hunk #6 FAILED at 236.
Hunk #8 succeeded at 398 (offset -5 lines).
Hunk #9 succeeded at 489 (offset 7 lines).
Hunk #10 succeeded at 566 with fuzz 2 (offset -6 lines).
Hunk #11 succeeded at 649 (offset 7 lines).
Hunk #12 succeeded at 1061 (offset 29 lines).
Hunk #13 succeeded at 1057 (offset 7 lines).
1 out of 13 hunks FAILED -- saving rejects to file arch/i386/kernel/traps.c.rej
patching file arch/i386/vmlinux.lds
Hunk #1 FAILED at 28.
Hunk #2 succeeded at 279 (offset 229 lines).
Hunk #3 FAILED at 305.
2 out of 3 hunks FAILED -- saving rejects to file arch/i386/vmlinux.lds.rej
patching file include/asm-i386/hw_irq.h
patching file include/asm-i386/kdb.h
patching file include/asm-i386/kdbprivate.h
patching file include/asm-i386/keyboard.h
patching file include/asm-i386/kmap_types.h
patching file include/asm-i386/ptrace.h
patching file kdb/modules/kdbm_x86.c


The number of rejects were very small and easily fixed manually. However, the arch/i386/vmlinux.lds file did not exist (when make mrproper) or was a blank file. Instead, there was arch/i386/vmlinux.lds.S, to which I applied the changes initially meant for vmlinux.lds.

On compilation, I get these errors

*** Instance 1 ***
ld:~/tmp/linux-2.4.31-test/arch/i386/vmlinux.lds:358: syntax error
make[1]: *** [kallsyms] Error 1
make[1]: Leaving directory `~/tmp/linux-2.4.31-test'
make: *** [vmlinux] Error 2

*** Instance 2 ***
kdb/kdb.o(.text.init+0x8e3): In function `kdb_inittab':
: undefined reference to `__kdb_initcall_start'
kdb/kdb.o(.text.init+0x911): In function `kdb_inittab':
: undefined reference to `__kdb_initcall_end'
kdb/kdb.o(.text.init+0x927): In function `kdb_inittab':
: undefined reference to `__kdb_initcall_end'
make[1]: *** [kallsyms] Error 1
make[1]: Leaving directory `~tmp/linux-2.4.31-test2'
make: *** [vmlinux] Error 2

I'd be grateful for any help. Thanks in advance.
-Ian

XavierP 01-24-2006 04:27 PM

Moved: This thread is more suitable in Linux-Software and has been moved accordingly to help your thread/question get the exposure it deserves.


All times are GMT -5. The time now is 09:25 PM.