linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Sami Tolvanen <samitolvanen@google.com>, Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>, "H . Peter Anvin" <hpa@zytor.com>,
	Nicholas Piggin <npiggin@gmail.com>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] x86: fix .bss with -fdata-sections
Date: Mon, 15 Apr 2019 22:23:28 -0500	[thread overview]
Message-ID: <CAGXu5jJ_UM3-9r+NHDmOWk1XxbO8c_=guzZEGrsGFWWv0z_bZA@mail.gmail.com> (raw)
In-Reply-To: <20190415164956.124067-1-samitolvanen@google.com>

On Mon, Apr 15, 2019 at 11:50 AM Sami Tolvanen <samitolvanen@google.com> wrote:
>
> With LD_DEAD_CODE_DATA_ELIMINATION, we compile the kernel with
> -fdata-sections, which also splits the .bss section. Use the
> common BSS_MAIN macro in the linker script to properly merge all
> the generated sections.
>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>

Nice work tracking this down! :)

Reviewed-by: Kees Cook <keescook@chromium.org>

Nit/tweak/clarification for commit title:
    x86/build: Fix truncated .bss with -fdata-sections

-Kees

> ---
>  arch/x86/kernel/vmlinux.lds.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
> index bad8c51fee6e..a5127b2c195f 100644
> --- a/arch/x86/kernel/vmlinux.lds.S
> +++ b/arch/x86/kernel/vmlinux.lds.S
> @@ -362,7 +362,7 @@ SECTIONS
>         .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
>                 __bss_start = .;
>                 *(.bss..page_aligned)
> -               *(.bss)
> +               *(BSS_MAIN)
>                 BSS_DECRYPTED
>                 . = ALIGN(PAGE_SIZE);
>                 __bss_stop = .;
> --
> 2.21.0.392.gf8f6787159e-goog
>


-- 
Kees Cook

  parent reply	other threads:[~2019-04-16  3:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 16:49 [PATCH] x86: fix .bss with -fdata-sections Sami Tolvanen
2019-04-15 17:33 ` Nick Desaulniers
2019-04-16  3:23 ` Kees Cook [this message]
2019-04-16  6:25 ` [tip:x86/urgent] x86/build/lto: Fix truncated " tip-bot for Sami Tolvanen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGXu5jJ_UM3-9r+NHDmOWk1XxbO8c_=guzZEGrsGFWWv0z_bZA@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=ndesaulniers@google.com \
    --cc=npiggin@gmail.com \
    --cc=samitolvanen@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).