public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* Enabling AARCH64 BTI
@ 2024-02-06 19:00 William Roberts
  2024-02-06 21:10 ` DJ Delorie
  0 siblings, 1 reply; 5+ messages in thread
From: William Roberts @ 2024-02-06 19:00 UTC (permalink / raw)
  To: libffi-discuss

I was looking at packages that don't declare BTI in the GNU Notes
section of the ELF file, and found libffi was missing that.
Investigating libffi, it enables BTI, but does not add it to the notes
section and if it's not in the notes section the linker/loader will
disable BTI for the target process.

https://github.com/libffi/libffi/pull/822

Here are some helpful notes and details on it as explained by others:
  - https://maskray.me/blog/2023-03-05-linker-notes-on-aarch64
  - https://reviews.llvm.org/D62609

Thanks,
Bill

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enabling AARCH64 BTI
  2024-02-06 19:00 Enabling AARCH64 BTI William Roberts
@ 2024-02-06 21:10 ` DJ Delorie
  2024-02-06 22:26   ` William Roberts
  0 siblings, 1 reply; 5+ messages in thread
From: DJ Delorie @ 2024-02-06 21:10 UTC (permalink / raw)
  To: William Roberts; +Cc: libffi-discuss

William Roberts via Libffi-discuss <libffi-discuss@sourceware.org>
writes:
> https://github.com/libffi/libffi/pull/822

Are there any labels in that *.S that need to be tagged with BTI ?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enabling AARCH64 BTI
  2024-02-06 21:10 ` DJ Delorie
@ 2024-02-06 22:26   ` William Roberts
  2024-02-06 22:36     ` DJ Delorie
  0 siblings, 1 reply; 5+ messages in thread
From: William Roberts @ 2024-02-06 22:26 UTC (permalink / raw)
  To: DJ Delorie; +Cc: libffi-discuss

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

No, but it needs to be enabled in the good new notes for the ELF file or it
gets disabled. I have a PR up.

On Tue, Feb 6, 2024, 15:10 DJ Delorie <dj@redhat.com> wrote:

> William Roberts via Libffi-discuss <libffi-discuss@sourceware.org>
> writes:
> > https://github.com/libffi/libffi/pull/822
>
> Are there any labels in that *.S that need to be tagged with BTI ?
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enabling AARCH64 BTI
  2024-02-06 22:26   ` William Roberts
@ 2024-02-06 22:36     ` DJ Delorie
  2024-02-06 23:24       ` William Roberts
  0 siblings, 1 reply; 5+ messages in thread
From: DJ Delorie @ 2024-02-06 22:36 UTC (permalink / raw)
  To: William Roberts; +Cc: libffi-discuss

William Roberts <bill.c.roberts@gmail.com> writes:
> No, but it needs to be enabled in the good new notes for the ELF file
> or it gets disabled. I have a PR up.

I understood that part, I just didn't want it to go from "not enabled"
to "enabled but always crashes" ;-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enabling AARCH64 BTI
  2024-02-06 22:36     ` DJ Delorie
@ 2024-02-06 23:24       ` William Roberts
  0 siblings, 0 replies; 5+ messages in thread
From: William Roberts @ 2024-02-06 23:24 UTC (permalink / raw)
  To: DJ Delorie; +Cc: libffi-discuss

On Tue, Feb 6, 2024, 16:36 DJ Delorie <dj@redhat.com> wrote:
>
> William Roberts <bill.c.roberts@gmail.com> writes:
> > No, but it needs to be enabled in the good new notes for the ELF file
> > or it gets disabled. I have a PR up.
>
> I understood that part, I just didn't want it to go from "not enabled"
> to "enabled but always crashes" ;-)
>

At least then we know where we're missing them for labels :-p
My initial testing was using libffi make check, so I'm assuming
that tests these flows? I haven't done negative testing yet.

I'm testing on a Fedora 39 VM running on an Apple M2. Note you need
to set -cpu max -acel tcg. Apple's HVF seems to be lacking BTI/PAC
support passthrough to the guest.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-06 23:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 19:00 Enabling AARCH64 BTI William Roberts
2024-02-06 21:10 ` DJ Delorie
2024-02-06 22:26   ` William Roberts
2024-02-06 22:36     ` DJ Delorie
2024-02-06 23:24       ` William Roberts

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 read-only IMAP folder(s) and NNTP newsgroup(s).