Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

OS-1364 local auditors specifying LA_FLG_BINDTO miss bindings via elf…

…_bndr()
  • Loading branch information...
commit eacaebb5596d5ce236b6af1e1a9785f7297498c8 1 parent 9e2c152
Bryan Cantrill bcantrill authored
4 usr/src/cmd/sgs/rtld/amd64/amd64_elf.c
View
@@ -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,
4 usr/src/cmd/sgs/rtld/common/dlfcns.c
View
@@ -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 -
4 usr/src/cmd/sgs/rtld/i386/i386_elf.c
View
@@ -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,
4 usr/src/cmd/sgs/rtld/sparc/sparc_elf.c
View
@@ -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));
4 usr/src/cmd/sgs/rtld/sparcv9/sparc_elf.c
View
@@ -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));
Please sign in to comment.
Something went wrong with that request. Please try again.