lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 10 Apr 2022 03:08:28 -0500
From:   Rob Landley <rob@...dley.net>
To:     Greg Ungerer <gerg@...ux-m68k.org>,
        Finn Thain <fthain@...ux-m68k.org>
Cc:     Daniel Palmer <daniel@...f.com>, Arnd Bergmann <arnd@...db.de>,
        Christoph Hellwig <hch@...radead.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arch <linux-arch@...r.kernel.org>,
        "moderated list:H8/300 ARCHITECTURE" 
        <uclinux-h8-devel@...ts.sourceforge.jp>,
        "open list:TENSILICA XTENSA PORT (xtensa)" 
        <linux-xtensa@...ux-xtensa.org>, Max Filippov <jcmvbkbc@...il.com>,
        Linux-sh list <linux-sh@...r.kernel.org>,
        linux-m68k <linux-m68k@...ts.linux-m68k.org>,
        Damien Le Moal <damien.lemoal@....com>,
        linux-riscv <linux-riscv@...ts.infradead.org>
Subject: Re: [RFC PULL] remove arch/h8300

On 4/10/22 02:26, Rob Landley wrote:
>> FWIW this will do it:
>> 
>>      qemu-system-m68k -nographic -machine mcf5208evb -kernel vmlinux
>> 
>> That will boot an m5208evb_defconfig generated vmlinux.
>> But you will need a user space to get a full boot to login/shell.
> 
> No FDPIC support. :(

First stab at switching on CONFIG_BINFMT_FDPIC in the coldfire config and adding
enough stuff to shut up the compiler. Maybe it'll let me load a PIE binary?
Dunno yet, but it compiled a vmlinux that booted to the same panic as the
previous one because I haven't fed it an initramfs yet...

I also had to disable CONFIG_ELF_CORE or else the link died with:

m68k-linux-musl-ld: fs/binfmt_elf_fdpic.o: in function `elf_dump_thread_status':
binfmt_elf_fdpic.c:(.text+0x18): undefined reference to `task_user_regset_view'
make: *** [Makefile:1155: vmlinux] Error 1

But when I did THAT it compiled. :)

diff --git a/arch/m68k/include/asm/elf.h b/arch/m68k/include/asm/elf.h
index 3d387ceaea3f..bcb072396640 100644
--- a/arch/m68k/include/asm/elf.h
+++ b/arch/m68k/include/asm/elf.h
@@ -114,4 +114,6 @@ typedef struct user_m68kfp_struct elf_fpregset_t;

 #define ELF_PLATFORM  (NULL)

+#define ELF_FDPIC_CORE_EFLAGS 0
+
 #endif
diff --git a/arch/m68k/include/asm/mmu.h b/arch/m68k/include/asm/mmu.h
index 5c15aacb1370..6f6d83b731ed 100644
--- a/arch/m68k/include/asm/mmu.h
+++ b/arch/m68k/include/asm/mmu.h
@@ -8,6 +8,10 @@ typedef unsigned long mm_context_t;
 #else
 typedef struct {
 	unsigned long		end_brk;
+#ifdef CONFIG_BINFMT_ELF_FDPIC
+        unsigned long           exec_fdpic_loadmap;
+        unsigned long           interp_fdpic_loadmap;
+#endif
 } mm_context_t;
 #endif

diff --git a/arch/m68k/include/uapi/asm/ptrace.h
b/arch/m68k/include/uapi/asm/ptrace.h
index 19a1b9d0d858..869601381f30 100644
--- a/arch/m68k/include/uapi/asm/ptrace.h
+++ b/arch/m68k/include/uapi/asm/ptrace.h
@@ -71,6 +71,10 @@ struct switch_stack {
 #define PTRACE_SETREGS            13
 #define PTRACE_GETFPREGS          14
 #define PTRACE_SETFPREGS          15
+#define PTRACE_GETFDPIC           31
+
+#define PTRACE_GETFDPIC_EXEC      0
+#define PTRACE_GETFDPIC_INTERP    1

 #define PTRACE_GET_THREAD_AREA    25

diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
index 4d5ae61580aa..073360aa982c 100644
--- a/fs/Kconfig.binfmt
+++ b/fs/Kconfig.binfmt
@@ -45,7 +45,7 @@ config ARCH_USE_GNU_PROPERTY
 config BINFMT_ELF_FDPIC
 	bool "Kernel support for FDPIC ELF binaries"
 	default y if !BINFMT_ELF
-	depends on (ARM || (SUPERH && !MMU))
+	depends on (ARM || (SUPERH && !MMU) || M68K)
 	select ELFCORE
 	help
 	  ELF FDPIC binaries are based on ELF, but allow the individual load



Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ