mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Keerthana Kalyanasundaram <keerthanak@vmware.com>,
	"keescook@chromium.org" <keescook@chromium.org>,
	"linux-hardening@vger.kernel.org"
	<linux-hardening@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Alexey Makhalov <amakhalov@vmware.com>,
	Ajay Kaher <akaher@vmware.com>,
	Vasavi Sirnapalli <vsirnapalli@vmware.com>
Subject: Re: PROBLEM: Using Randomize structure layout GCC plugin doesn't generate proper debuginfo
Date: Thu, 25 May 2023 08:14:46 -0700	[thread overview]
Message-ID: <E226151B-FBAD-4FA2-B226-96231783D732@kernel.org> (raw)
In-Reply-To: <DF6066B2-35AE-40BE-A217-D3C48DBF6751@vmware.com>

On May 25, 2023 3:21:15 AM PDT, Keerthana Kalyanasundaram <keerthanak@vmware.com> wrote:
>Hello,
>
>I’m reporting this bug in randomize strcture layout plugin in GCC plugins code of linux kernel tree.
>When I compile the kernel with randomize structure layout GCC plugin, the resulting debuginfo does not have the randomised structures.
>
>To reproduce this, I have a C sample program and a script to compile the program with and without randomize_layout_plugin
>from linux kernel, the resulted debuginfo in both cases are same. Though the plugin shuffles the structure members, the resulting debuginfo 
>has unshuffled structure.
>
>I have found an old bug in GCC reporting the same https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84052 This bug has been closed as invalid though there was a conversation between PaX maintainers and GCC devs.
>
>I assume this issue has been there since the randomize_layout_plugin has been added in kernel. Please correct me if I’m wrong.

That's correct; it's a known issue with the plugin. (As you found with the GCC bug report.)

>Please let me know, if you need more information. I hope you are able to fix this issue.

I'm happy to take patches, but I'm unlikely to have time to figure this out myself.

If you want debug info and randstruct, I recommend switching to using Clang to build the kernel, which has its implementation upstream:
https://docs.kernel.org/kbuild/llvm.html

-Kees



-- 
Kees Cook

      parent reply	other threads:[~2023-05-25 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 10:21 Keerthana Kalyanasundaram
2023-05-25 10:32 ` Keerthana Kalyanasundaram
2023-05-25 15:14 ` Kees Cook [this message]

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=E226151B-FBAD-4FA2-B226-96231783D732@kernel.org \
    --to=kees@kernel.org \
    --cc=akaher@vmware.com \
    --cc=amakhalov@vmware.com \
    --cc=keerthanak@vmware.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vsirnapalli@vmware.com \
    /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

all inboxes | Powered by JetHome®