This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/2] x86/CET: Stop if the GNU_PROPERTY_X86_UINT32_VALID bit is set

When updated linkers merge input sections into one section, it sets the GNU_PROPERTY_X86_UINT32_VALID
bit in the GNU_PROPERTY_X86_FEATURE_1_AND property.  This can be used
to detect if the NT_GNU_PROPERTY_TYPE_0 note is generated by updated
linkers.  If the GNU_PROPERTY_X86_UINT32_VALID bit is set, we can stop
checking for invalid section.

	* sysdeps/x86/dl-prop.h (_dl_process_cet_property_note): Stop
	if the GNU_PROPERTY_X86_UINT32_VALID bit is set.
 sysdeps/x86/dl-prop.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sysdeps/x86/dl-prop.h b/sysdeps/x86/dl-prop.h
index 9ab890d12b..5c06aa5fbc 100644
--- a/sysdeps/x86/dl-prop.h
+++ b/sysdeps/x86/dl-prop.h
@@ -115,6 +115,11 @@ _dl_process_cet_property_note (struct link_map *l,
 		  feature_1 = *(unsigned int *) ptr;
+		  /* Done if this property note is created by updated
+		     linker.  */
+		  if ((feature_1 & GNU_PROPERTY_X86_UINT32_VALID))
+		    goto found_feature_1;
 		  /* Keep searching for the next GNU property note
 		     generated by the older linker.  */
@@ -138,6 +143,7 @@ _dl_process_cet_property_note (struct link_map *l,
   /* We get here only if there is one or no GNU property note.  */
   if ((feature_1 & GNU_PROPERTY_X86_FEATURE_1_IBT))
     l->l_cet |= lc_ibt;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]