public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Thomas Lendacky <Thomas.Lendacky@amd.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	the arch/x86 maintainers <x86@kernel.org>,
	Yu-cheng Yu <yu-cheng.yu@intel.com>
Subject: Re: [PATCH 2/2] x86: Discard .note.gnu.property sections in vmlinux
Date: Thu, 30 Jan 2020 12:08:07 -0800	[thread overview]
Message-ID: <202001301206.13AF0512@keescook> (raw)
In-Reply-To: <CAMe9rOocT960KsofP9o_y49FdgY9NGix=GcYnpKLvp7RhieZNA@mail.gmail.com>

On Thu, Jan 30, 2020 at 12:04:54PM -0800, H.J. Lu wrote:
> > I don't understand this. "may not be incompatible"? Is there an error
> > generated? If so, what does it look like?
> 
> When -mx86-used-note=yes is passed to assembler, with my patch, I got
> 
> [hjl@gnu-skx-1 linux]$ readelf -n vmlinux
> 
> Displaying notes found in: .notes
>   Owner                Data size Description
>   Xen                  0x00000006 Unknown note type: (0x00000006)
>    description data: 6c 69 6e 75 78 00
>   Xen                  0x00000004 Unknown note type: (0x00000007)
>    description data: 32 2e 36 00
>   Xen                  0x00000008 Unknown note type: (0x00000005)
>    description data: 78 65 6e 2d 33 2e 30 00
>   Xen                  0x00000008 Unknown note type: (0x00000003)
>    description data: 00 00 00 80 ff ff ff ff
>   Xen                  0x00000008 Unknown note type: (0x0000000f)
>    description data: 00 00 00 00 80 00 00 00
>   Xen                  0x00000008 NT_VERSION (version)
>    description data: 80 a1 ba 82 ff ff ff ff
>   Xen                  0x00000008 NT_ARCH (architecture)
>    description data: 00 10 00 81 ff ff ff ff
>   Xen                  0x00000029 Unknown note type: (0x0000000a)
>    description data: 21 77 72 69 74 61 62 6c 65 5f 70 61 67 65 5f 74
> 61 62 6c 65 73 7c 70 61 65 5f 70 67 64 69 72 5f 61 62 6f 76 65 5f 34
> 67 62
>   Xen                  0x00000004 Unknown note type: (0x00000011)
>    description data: 01 88 00 00
>   Xen                  0x00000004 Unknown note type: (0x00000009)
>    description data: 79 65 73 00
>   Xen                  0x00000008 Unknown note type: (0x00000008)
>    description data: 67 65 6e 65 72 69 63 00
>   Xen                  0x00000010 Unknown note type: (0x0000000d)
>    description data: 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
>   Xen                  0x00000004 Unknown note type: (0x0000000e)
>    description data: 01 00 00 00
>   Xen                  0x00000004 Unknown note type: (0x00000010)
>    description data: 01 00 00 00
>   Xen                  0x00000008 Unknown note type: (0x0000000c)
>    description data: 00 00 00 00 00 80 ff ff
>   Xen                  0x00000008 Unknown note type: (0x00000004)
>    description data: 00 00 00 00 00 00 00 00
>   GNU                  0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)
>     Build ID: 11c73de2922f593e1b35b92ab3c70eaa1a80fa83
>   Linux                0x00000018 OPEN
>    description data: 35 2e 33 2e 39 2d 32 30 30 2e 30 2e 66 63 33 30
> 2e 78 38 36 5f 36 34 00
>   Xen                  0x00000008 Unknown note type: (0x00000012)
>    description data: 70 04 00 01 00 00 00 00
> [hjl@gnu-skx-1 linux]$
> 
> Without my patch,
> 
> [hjl@gnu-skx-1 linux]$ readelf -n vmlinux
> 
> Displaying notes found in: .notes
>   Owner                Data size Description
>   Xen                  0x00000006 Unknown note type: (0x00000006)
>    description data: 6c 69 6e 75 78 00
>   Xen                  0x00000004 Unknown note type: (0x00000007)
>    description data: 32 2e 36 00
>   xen-3.0              0x00000005 Unknown note type: (0x006e6558)
>    description data: 08 00 00 00 03
> readelf: Warning: note with invalid namesz and/or descsz found at offset 0x50
> readelf: Warning:  type: 0xffffffff, namesize: 0x006e6558, descsize:
> 0x80000000, alignment: 8
> [hjl@gnu-skx-1 linux]$

What is the source of this failure? Does readelf need updating instead?
Is the linking step producing an invalid section? It seems like
discarding the properties isn't the right solution here?

-- 
Kees Cook

  reply	other threads:[~2020-01-30 20:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 18:18 [PATCH 0/2] x86: Discard .note.gnu.property sections H.J. Lu
2020-01-24 18:18 ` [PATCH 1/2] x86: Discard .note.gnu.property sections in vDSO H.J. Lu
2020-01-24 18:18 ` [PATCH 2/2] x86: Discard .note.gnu.property sections in vmlinux H.J. Lu
2020-01-27 23:34   ` Kees Cook
2020-01-30 17:51     ` H.J. Lu
2020-01-30 19:51       ` Kees Cook
2020-01-30 20:04         ` H.J. Lu
2020-01-30 20:08           ` Kees Cook [this message]
2020-01-30 20:20             ` H.J. Lu
2020-01-30 20:48               ` [PATCH] Discard .note.gnu.property sections in generic NOTES H.J. Lu
2020-01-30 22:09                 ` Kees Cook
2020-01-30 22:06               ` [PATCH 2/2] x86: Discard .note.gnu.property sections in vmlinux Kees Cook

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=202001301206.13AF0512@keescook \
    --to=keescook@chromium.org \
    --cc=Thomas.Lendacky@amd.com \
    --cc=bp@alien8.de \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hjl.tools@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=samitolvanen@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yu-cheng.yu@intel.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