summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/sgs/packages/common/SUNWonld-README1
-rw-r--r--usr/src/cmd/sgs/rtld/common/cap.c16
-rw-r--r--usr/src/cmd/sgs/rtld/common/rtld.msg1
3 files changed, 17 insertions, 1 deletions
diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README
index a618c6f9d4..4e453ca276 100644
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README
@@ -1638,3 +1638,4 @@ Bugid Risk Synopsis
3228 Want -zassert-deflib for ld
3230 ld.so.1 should check default paths for DT_DEPAUDIT
3260 linker is insufficiently careful with strtok
+3261 linker should ignore unknown hardware capabilities
diff --git a/usr/src/cmd/sgs/rtld/common/cap.c b/usr/src/cmd/sgs/rtld/common/cap.c
index d3c74c658e..9aa82022be 100644
--- a/usr/src/cmd/sgs/rtld/common/cap.c
+++ b/usr/src/cmd/sgs/rtld/common/cap.c
@@ -922,6 +922,8 @@ cap_modify(Xword tag, const char *str)
* Invalid indexes are ignored.
*/
if (val == 0) {
+ char *end;
+
if ((*ptr == '[') && (*(ptr + 2) == ']')) {
if (*(ptr + 1) == '1') {
ndx = tag;
@@ -942,9 +944,21 @@ cap_modify(Xword tag, const char *str)
ndx = tag;
errno = 0;
- if (((val = strtol(ptr, NULL, 16)) == 0) && errno)
+ if (((val = strtol(ptr, &end, 16)) == 0) && errno)
continue;
+
+ /*
+ * If the value wasn't an entirely valid hexadecimal
+ * integer, assume it was intended as a capability
+ * name and skip it.
+ */
+ if (*end != '\0') {
+ eprintf(NULL, ERR_WARNING,
+ MSG_INTL(MSG_CAP_IGN_UNKCAP), ptr);
+ continue;
+ }
}
+
cap_settings[ndx - 1].cs_val[mode] |= val;
cap_settings[ndx - 1].cs_set[mode]++;
diff --git a/usr/src/cmd/sgs/rtld/common/rtld.msg b/usr/src/cmd/sgs/rtld/common/rtld.msg
index 0d3811b003..0a3cb5d74a 100644
--- a/usr/src/cmd/sgs/rtld/common/rtld.msg
+++ b/usr/src/cmd/sgs/rtld/common/rtld.msg
@@ -300,6 +300,7 @@
@ MSG_STR_ONE "1"
@ MSG_CAP_DELIMIT ","
+@ MSG_CAP_IGN_UNKCAP "ignoring unknown capability: %s"
@ MSG_SUNW_OST_SGS "SUNW_OST_SGS"
@ MSG_SUNW_OST_OSLIB "SUNW_OST_OSLIB"