All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Frediano Ziglio" <freddy77@gmail.com>,
	xen-devel@lists.xenproject.org,
	"Frediano Ziglio" <frediano.ziglio@cloud.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Teddy Astie" <teddy.astie@vates.tech>,
	"Frediano Ziglio" <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v3 4/4] x86: Split .init section to satisfy UEFI CA memory mitigation
Date: Tue, 16 Jun 2026 17:08:45 +0200	[thread overview]
Message-ID: <ajFm_U8NBiNlynns@mail-itl> (raw)
In-Reply-To: <4c577b14-30ed-4fac-84fb-45d248e8feeb@citrix.com>

[-- Attachment #1: Type: text/plain, Size: 1772 bytes --]

On Tue, Jun 16, 2026 at 03:58:27PM +0100, Andrew Cooper wrote:
> On 16/06/2026 12:20 pm, Marek Marczykowski-Górecki wrote:
> > On Tue, Jun 16, 2026 at 11:13:36AM +0100, Frediano Ziglio wrote:
> >> From: Frediano Ziglio <frediano.ziglio@cloud.com>
> >>
> >> Currently .init section is both writeable and executable, split data and code
> >> to have 2 sections satisfying W^X rule.
> >>
> >> It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms
> >> in the pagetables.
> >>
> >> NX_COMPAT is a requirement from shim-review,
> >> https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-shim-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-done-to-ensure-such-compatibility
> >>
> >> Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
> > Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> >
> > Is that the last piece necessary to satisfy the NX_COMPAT requirement? If
> > so, I suppose a subsequent patch should actually set the
> > IMAGE_DLLCHARACTERISTICS_NX_COMPAT bit (IIUC ld --nxcompat option), right?
> 
> The manpage says:
> 
>        --nxcompat
>        --disable-nxcompat
>            The image is compatible with the Data Execution Prevention. 
> This feature was introduced with MS Windows XP SP2 for i386 PE targets. 
> The option is enabled by default.
> 
> It turns out that Xen is being marked NX_COMPAT even prior to this
> series, which is deeply suspicious as it has an RWX init section.

My reading of binutils sources says it's enabled by default only for
mingw target. And indeed, inspection of xen.efi says only DYNAMIC_BASE
is set.

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2026-06-16 15:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 10:13 [PATCH v3 0/4] Various patches to improve Secure Boot support Frediano Ziglio
2026-06-16 10:13 ` [PATCH v3 1/4] Align relevant sections to 4KB Frediano Ziglio
2026-06-16 10:44   ` Marek Marczykowski-Górecki
2026-06-16 12:27   ` Jan Beulich
2026-06-16 14:38     ` Frediano Ziglio
2026-06-16 14:54       ` Marek Marczykowski-Górecki
2026-06-16 15:07       ` Jan Beulich
2026-06-16 10:13 ` [PATCH v3 2/4] x86/efi: discard multiboot support for PE binary Frediano Ziglio
2026-06-16 10:55   ` Marek Marczykowski-Górecki
2026-06-16 10:13 ` [PATCH v3 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot() Frediano Ziglio
2026-06-16 11:04   ` Marek Marczykowski-Górecki
2026-06-16 10:13 ` [PATCH v3 4/4] x86: Split .init section to satisfy UEFI CA memory mitigation Frediano Ziglio
2026-06-16 11:20   ` Marek Marczykowski-Górecki
2026-06-16 11:29     ` Andrew Cooper
2026-06-16 12:30       ` Jan Beulich
2026-06-16 12:40         ` Andrew Cooper
2026-06-16 13:50           ` Frediano Ziglio
2026-06-16 13:50           ` Jan Beulich
2026-06-16 14:46             ` Andrew Cooper
2026-06-16 14:58     ` Andrew Cooper
2026-06-16 15:05       ` Jan Beulich
2026-06-16 15:08       ` Marek Marczykowski-Górecki [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=ajFm_U8NBiNlynns@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=freddy77@gmail.com \
    --cc=frediano.ziglio@citrix.com \
    --cc=frediano.ziglio@cloud.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=teddy.astie@vates.tech \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.