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]
Message-ID: <20190308190233.jqgkw26dpryz5izy@pburton-laptop>
Date:   Fri, 8 Mar 2019 19:02:34 +0000
From:   Paul Burton <paul.burton@...s.com>
To:     Yasha Cherikovsky <yasha.che3@...il.com>
CC:     Ralf Baechle <ralf@...ux-mips.org>,
        James Hogan <jhogan@...nel.org>,
        "linux-mips@...ux-mips.org" <linux-mips@...ux-mips.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] MIPS: Ensure ELF appended dtb is relocated

Hi Yasha,

On Fri, Mar 08, 2019 at 02:58:51PM +0200, Yasha Cherikovsky wrote:
> This fixes booting with the combination of CONFIG_RELOCATABLE=y
> and CONFIG_MIPS_ELF_APPENDED_DTB=y.
> 
> Sections that appear after the relocation table are not relocated
> on system boot (except .bss, which has special handling).
> 
> With CONFIG_MIPS_ELF_APPENDED_DTB, the dtb is part of the
> vmlinux ELF, so it must be relocated together with everything else.

Do you have any ideas how CONFIG_RELOCATABLE interacts with
CONFIG_MIPS_RAW_APPENDED_DTB? I'm wondering whether we should move both
variants of appended DTB to before .data.reloc, but haven't yet thought
it through.

Thanks,
    Paul

> Fixes: 069fd766271d ("MIPS: Reserve space for relocation table")
> Signed-off-by: Yasha Cherikovsky <yasha.che3@...il.com>
> Cc: Ralf Baechle <ralf@...ux-mips.org>
> Cc: Paul Burton <paul.burton@...s.com>
> Cc: James Hogan <jhogan@...nel.org>
> Cc: linux-mips@...ux-mips.org
> Cc: linux-kernel@...r.kernel.org
> ---
>  arch/mips/kernel/vmlinux.lds.S | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
> index cb7e9ed7a453..33ee0d18fb0a 100644
> --- a/arch/mips/kernel/vmlinux.lds.S
> +++ b/arch/mips/kernel/vmlinux.lds.S
> @@ -140,6 +140,13 @@ SECTIONS
>  	PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
>  #endif
>  
> +#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
> +	.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
> +		*(.appended_dtb)
> +		KEEP(*(.appended_dtb))
> +	}
> +#endif
> +
>  #ifdef CONFIG_RELOCATABLE
>  	. = ALIGN(4);
>  
> @@ -164,11 +171,6 @@ SECTIONS
>  	__appended_dtb = .;
>  	/* leave space for appended DTB */
>  	. += 0x100000;
> -#elif defined(CONFIG_MIPS_ELF_APPENDED_DTB)
> -	.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
> -		*(.appended_dtb)
> -		KEEP(*(.appended_dtb))
> -	}
>  #endif
>  	/*
>  	 * Align to 64K in attempt to eliminate holes before the
> -- 
> 2.21.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ