summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2012-07-02 07:02:20 +0000
committerBryan Cantrill <bryan@joyent.com>2012-07-02 07:02:20 +0000
commiteacaebb5596d5ce236b6af1e1a9785f7297498c8 (patch)
tree699ea657614bc066405331f65a2af74dc3bf0097
parent9e2c15275b19fac8574abebd3249581c12032685 (diff)
downloadillumos-joyent-eacaebb5596d5ce236b6af1e1a9785f7297498c8.tar.gz
OS-1364 local auditors specifying LA_FLG_BINDTO miss bindings via elf_bndr()
-rw-r--r--usr/src/cmd/sgs/rtld/amd64/amd64_elf.c4
-rw-r--r--usr/src/cmd/sgs/rtld/common/dlfcns.c4
-rw-r--r--usr/src/cmd/sgs/rtld/i386/i386_elf.c4
-rw-r--r--usr/src/cmd/sgs/rtld/sparc/sparc_elf.c4
-rw-r--r--usr/src/cmd/sgs/rtld/sparcv9/sparc_elf.c4
5 files changed, 15 insertions, 5 deletions
diff --git a/usr/src/cmd/sgs/rtld/amd64/amd64_elf.c b/usr/src/cmd/sgs/rtld/amd64/amd64_elf.c
index a6ac1a7c50..ddc44484a6 100644
--- a/usr/src/cmd/sgs/rtld/amd64/amd64_elf.c
+++ b/usr/src/cmd/sgs/rtld/amd64/amd64_elf.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/*
@@ -297,7 +298,8 @@ elf_bndr(Rt_map *lmp, ulong_t pltndx, caddr_t from)
rtldexit(lml, 1);
}
- if ((lml->lm_tflags | AFLAGS(lmp)) & LML_TFLG_AUD_SYMBIND) {
+ if ((lml->lm_tflags | AFLAGS(lmp) | AFLAGS(nlmp)) &
+ LML_TFLG_AUD_SYMBIND) {
uint_t symndx = (((uintptr_t)nsym -
(uintptr_t)SYMTAB(nlmp)) / SYMENT(nlmp));
symval = audit_symbind(lmp, nlmp, nsym, symndx, symval,
diff --git a/usr/src/cmd/sgs/rtld/common/dlfcns.c b/usr/src/cmd/sgs/rtld/common/dlfcns.c
index a8aaf3805e..74432c1686 100644
--- a/usr/src/cmd/sgs/rtld/common/dlfcns.c
+++ b/usr/src/cmd/sgs/rtld/common/dlfcns.c
@@ -24,6 +24,7 @@
* All Rights Reserved
*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/*
@@ -1390,7 +1391,8 @@ dlsym_core(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp,
DBG_CALL(Dbg_bind_global(clmp, 0, 0, (Xword)-1, PLT_T_NONE,
*dlmp, addr, sym->st_value, sr.sr_name, binfo));
- if ((lml->lm_tflags | AFLAGS(clmp)) & LML_TFLG_AUD_SYMBIND) {
+ if ((lml->lm_tflags | AFLAGS(clmp) | AFLAGS(*dlmp)) &
+ LML_TFLG_AUD_SYMBIND) {
uint_t sb_flags = LA_SYMB_DLSYM;
/* LINTED */
uint_t symndx = (uint_t)(((Xword)sym -
diff --git a/usr/src/cmd/sgs/rtld/i386/i386_elf.c b/usr/src/cmd/sgs/rtld/i386/i386_elf.c
index f1320605dd..4bf825e4d9 100644
--- a/usr/src/cmd/sgs/rtld/i386/i386_elf.c
+++ b/usr/src/cmd/sgs/rtld/i386/i386_elf.c
@@ -24,6 +24,7 @@
* All Rights Reserved
*
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/*
@@ -276,7 +277,8 @@ elf_bndr(Rt_map *lmp, ulong_t reloff, caddr_t from)
rtldexit(lml, 1);
}
- if ((lml->lm_tflags | AFLAGS(lmp)) & LML_TFLG_AUD_SYMBIND) {
+ if ((lml->lm_tflags | AFLAGS(lmp) | AFLAGS(nlmp)) &
+ LML_TFLG_AUD_SYMBIND) {
uint_t symndx = (((uintptr_t)nsym -
(uintptr_t)SYMTAB(nlmp)) / SYMENT(nlmp));
symval = audit_symbind(lmp, nlmp, nsym, symndx, symval,
diff --git a/usr/src/cmd/sgs/rtld/sparc/sparc_elf.c b/usr/src/cmd/sgs/rtld/sparc/sparc_elf.c
index dff287349d..4387276e26 100644
--- a/usr/src/cmd/sgs/rtld/sparc/sparc_elf.c
+++ b/usr/src/cmd/sgs/rtld/sparc/sparc_elf.c
@@ -24,6 +24,7 @@
* All Rights Reserved
*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/*
@@ -448,7 +449,8 @@ elf_bndr(Rt_map *lmp, ulong_t pltoff, caddr_t from)
rtldexit(lml, 1);
}
- if ((lml->lm_tflags | AFLAGS(lmp)) & LML_TFLG_AUD_SYMBIND) {
+ if ((lml->lm_tflags | AFLAGS(lmp) | AFLAGS(nlmp)) &
+ LML_TFLG_AUD_SYMBIND) {
ulong_t symndx = (((uintptr_t)nsym -
(uintptr_t)SYMTAB(nlmp)) / SYMENT(nlmp));
diff --git a/usr/src/cmd/sgs/rtld/sparcv9/sparc_elf.c b/usr/src/cmd/sgs/rtld/sparcv9/sparc_elf.c
index 66e30f2ba6..1a719329da 100644
--- a/usr/src/cmd/sgs/rtld/sparcv9/sparc_elf.c
+++ b/usr/src/cmd/sgs/rtld/sparcv9/sparc_elf.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/*
@@ -589,7 +590,8 @@ elf_bndr(Rt_map *lmp, ulong_t pltoff, caddr_t from)
rtldexit(lml, 1);
}
- if ((lml->lm_tflags | AFLAGS(lmp)) & LML_TFLG_AUD_SYMBIND) {
+ if ((lml->lm_tflags | AFLAGS(lmp) | AFLAGS(nlmp)) &
+ LML_TFLG_AUD_SYMBIND) {
/* LINTED */
uint_t symndx = (uint_t)(((uintptr_t)nsym -
(uintptr_t)SYMTAB(nlmp)) / SYMENT(nlmp));