Page MenuHomeFreeBSD

Add NT_FREEBSD_FEATURE_CTL ELF note to csu
ClosedPublic

Authored by emaste on Oct 5 2018, 7:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 8:20 AM
Unknown Object (File)
Sat, Dec 21, 8:12 AM
Unknown Object (File)
Sat, Dec 21, 7:56 AM
Unknown Object (File)
Nov 17 2024, 5:27 PM
Unknown Object (File)
Nov 13 2024, 3:07 PM
Unknown Object (File)
Oct 3 2024, 12:17 PM
Unknown Object (File)
Oct 3 2024, 11:12 AM
Unknown Object (File)
Oct 3 2024, 10:41 AM
Subscribers

Details

Summary

This note will be used to allow binaries to opt out of, or in to, upcoming vulnerability mitigation and other features. It is not yet connected but being added now to facilitate testing and ensure compatibility with existing kernels and tools.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste created this revision.

With context

emaste added inline comments.
lib/csu/common/feature.c
42 ↗(On Diff #48801)

I wrote it this way to suggest we might expand this in the future

I do not see a reason not to provide the feature_ctl note definition in crtbrand.c.

lib/csu/common/feature.c
42 ↗(On Diff #48801)

I suggest we define one MI and one MD flags fields from the start.

There seems to be inconsistent use of tab/space between type and member name.

Put in crtbrand.c as kib suggests

emaste added inline comments.
lib/csu/common/crtbrand.c
76 ↗(On Diff #48803)

space changed to tab here locally

lib/csu/common/crtbrand.c
76 ↗(On Diff #48803)

I'd be tempted toward desc[3]; to make this an even 32 bytes and provide a bit more future-proofing.

lib/csu/common/crtbrand.c
76 ↗(On Diff #48803)

I already asked to provide MI and MD flag words from the beginning.

emaste added inline comments.
lib/csu/common/crtbrand.c
76 ↗(On Diff #48803)

As much as possible I'd really like to make this MI; even things that are x86-only right now (say, PTI control) could be extended to other architectures in the future and could use a MI bit.

My suggestion is that we just define MD_1, MD_2, etc. bits as needed and give them MD aliases. That said, reserving 3 3-bit ints now and making the whole note 32 bytes seems fine.

  • move to crtbrand.c
  • rebase after rS340076 (add note definition separately so readelf change can be MFC'd)
  • leave as int desc[1] for now and assume primarily MI for now, based on discussion
This revision is now accepted and ready to land.Nov 3 2018, 5:43 PM

If keeping it as is is the consensus, that's fine by me.

This revision was automatically updated to reflect the committed changes.