]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
arm: Use "nr" constraint for Systemtap probes [BZ #24164]
authorFlorian Weimer <fweimer@redhat.com>
Tue, 5 Feb 2019 12:49:02 +0000 (13:49 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 5 Feb 2019 12:49:03 +0000 (13:49 +0100)
With the default "nor" constraint, current GCC will use the "o"
constraint for constants, after emitting the constant to memory.  That
results in unparseable Systemtap probe notes such as "-4@.L1052".
Removing the "o" alternative and using "nr" instead avoids this.

(cherry picked from commit f1ac7455831546e5dca0ed98fe8af2686fae7ce6)

ChangeLog
NEWS
include/stap-probe.h
sysdeps/arm/stap-probe-machine.h [new file with mode: 0644]
sysdeps/generic/stap-probe-machine.h [new file with mode: 0644]

index e0969afd8017b952920115a2ef9135f67a4a9dc8..9517ff9e823a8fc5c3e8b8183f057b82e98166da 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-02-05  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #24164]
+       arm: Use "nr" constraint for Systemtap probes, to avoid the
+       compiler using memory operands for constants, due to the "o"
+       alternative in the default "nor" constraint.
+       * include/stap-probe.h [USE_STAP_PROBE]: Include
+       <stap-probe-machine.h>
+       * sysdeps/generic/stap-probe-machine.h: New file.
+       * sysdeps/arm/stap-probe-machine.h: Likewise.
+
 2019-02-04  H.J. Lu  <hongjiu.lu@intel.com>
 
        [BZ #24155]
diff --git a/NEWS b/NEWS
index 1751ed118a5067052af0eb8b43cdc5ec9cc4564d..1f0fc4b3cb6f47339befa33017bcfe81e3af8057 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Version 2.29.1
 The following bugs are resolved with this release:
 
   [24155] x32 memcmp can treat positive length as 0 (if sign bit in RDX is set) (CVE-2019-7309)
+  [24164] Systemtap probes need to use "nr" constraint on 32-bit Arm
 
 Security related changes:
 
index c53dd86592a26cf769da2eb6b16ec7520e6d1ba7..8c26292edd4d5180db3de19a24f94c2252c4fbf2 100644 (file)
@@ -21,6 +21,7 @@
 
 #ifdef USE_STAP_PROBE
 
+# include <stap-probe-machine.h>
 # include <sys/sdt.h>
 
 /* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn).
diff --git a/sysdeps/arm/stap-probe-machine.h b/sysdeps/arm/stap-probe-machine.h
new file mode 100644 (file)
index 0000000..d27ca22
--- /dev/null
@@ -0,0 +1,22 @@
+/* Macros for customizing Systemtap <sys/sdt.h>.  Arm version.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* The default "nor" constraint produces unparseable memory references
+   for constants.  Omit the problematic "o" constraint.  See bug 24164
+   and GCC PR 89146.  */
+#define STAP_SDT_ARG_CONSTRAINT nr
diff --git a/sysdeps/generic/stap-probe-machine.h b/sysdeps/generic/stap-probe-machine.h
new file mode 100644 (file)
index 0000000..2e5790c
--- /dev/null
@@ -0,0 +1,19 @@
+/* Macros for customizing Systemtap <sys/sdt.h>.  Generic version.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* By default, there are no customizations.  */