This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/cet/property updated. glibc-2.25-642-gd929beb
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 29 Jun 2017 16:26:19 -0000
- Subject: GNU C Library master sources branch hjl/cet/property updated. glibc-2.25-642-gd929beb
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/cet/property has been updated
via d929bebeb2d313f0623600bfa0f17dcf3a795084 (commit)
from bf59d6e2cb3dfce06d57e8bca4a66a74e9bcadeb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d929bebeb2d313f0623600bfa0f17dcf3a795084
commit d929bebeb2d313f0623600bfa0f17dcf3a795084
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Jun 29 09:26:01 2017 -0700
dl-cet
diff --git a/sysdeps/unix/sysv/linux/x86/dl-cet-nonshared.c b/sysdeps/unix/sysv/linux/x86/dl-cet-nonshared.c
index eb6841e..570c0a3 100644
--- a/sysdeps/unix/sysv/linux/x86/dl-cet-nonshared.c
+++ b/sysdeps/unix/sysv/linux/x86/dl-cet-nonshared.c
@@ -63,10 +63,35 @@ _dl_setup_cet (const ElfW(Phdr) *phdr, size_t phnum,
if ((ptr + datasz) > ptr_end)
break;
- if (type == GNU_PROPERTY_X86_FEATURE_1_AND)
+ if (type == GNU_PROPERTY_X86_FEATURE_1_AND
+ && datasz == 4)
{
- GL(dl_x86_feature_1) = ptr[0];
- goto found;
+ unsigned int feature_1 = ptr[0];
+
+ if ((feature_1 & GNU_PROPERTY_X86_FEATURE_1_IBT))
+ {
+ if (CPU_FEATURES_CPU_P (cpu_features, IBT))
+ {
+ /* FIXME: Set up IBT. */
+ }
+ else
+ /* Disable IBT. */
+ feature_1 &= ~GNU_PROPERTY_X86_FEATURE_1_IBT;
+ }
+
+ if ((feature_1 & GNU_PROPERTY_X86_FEATURE_1_SHSTK))
+ {
+ if (CPU_FEATURES_CPU_P (cpu_features, SHSTK))
+ {
+ /* FIXME: Set up SHSTK. */
+ }
+ else
+ /* Disable SHSTK. */
+ feature_1 &= ~GNU_PROPERTY_X86_FEATURE_1_SHSTK;
+ }
+
+ GL(dl_x86_feature_1) = feature_1;
+ return;
}
}
}
@@ -75,28 +100,5 @@ _dl_setup_cet (const ElfW(Phdr) *phdr, size_t phnum,
+ ROUND_NOTE (note->n_descsz));
}
}
-
-found:
- if (CPU_FEATURES_CPU_P (cpu_features, IBT)
- && (GL(dl_x86_feature_1) & GNU_PROPERTY_X86_FEATURE_1_IBT))
- {
- /* FIXME: Set up IBT. */
- }
- else
- {
- /* Disable IBT. */
- GL(dl_x86_feature_1) &= ~GNU_PROPERTY_X86_FEATURE_1_IBT;
- }
-
- if (CPU_FEATURES_CPU_P (cpu_features, SHSTK)
- && (GL(dl_x86_feature_1) & GNU_PROPERTY_X86_FEATURE_1_SHSTK))
- {
- /* FIXME: Set up SHSTK. */
- }
- else
- {
- /* Disable SHSTK. */
- GL(dl_x86_feature_1) &= ~GNU_PROPERTY_X86_FEATURE_1_SHSTK;
- }
}
#endif
diff --git a/sysdeps/unix/sysv/linux/x86/dl-cet.h b/sysdeps/unix/sysv/linux/x86/dl-cet.h
index b16e0f2..1b4b866 100644
--- a/sysdeps/unix/sysv/linux/x86/dl-cet.h
+++ b/sysdeps/unix/sysv/linux/x86/dl-cet.h
@@ -62,12 +62,13 @@ dl_process_cet_property_note (struct link_map *l,
if ((ptr + datasz) > ptr_end)
break;
- if (type == GNU_PROPERTY_X86_FEATURE_1_AND)
+ if (type == GNU_PROPERTY_X86_FEATURE_1_AND
+ && datasz == 4)
{
- unsigned int pr_data = ptr[0];
- if ((pr_data & GNU_PROPERTY_X86_FEATURE_1_IBT))
+ unsigned int feature_1 = ptr[0];
+ if ((feature_1 & GNU_PROPERTY_X86_FEATURE_1_IBT))
l->l_cet |= lc_ibt;
- if ((pr_data & GNU_PROPERTY_X86_FEATURE_1_SHSTK))
+ if ((feature_1 & GNU_PROPERTY_X86_FEATURE_1_SHSTK))
l->l_cet |= lc_shstk;
return;
}
-----------------------------------------------------------------------
Summary of changes:
sysdeps/unix/sysv/linux/x86/dl-cet-nonshared.c | 54 ++++++++++++-----------
sysdeps/unix/sysv/linux/x86/dl-cet.h | 9 ++--
2 files changed, 33 insertions(+), 30 deletions(-)
hooks/post-receive
--
GNU C Library master sources