public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v5 0/2] minimal run-time audit support
@ 2023-02-28 16:51 Stas Sergeev
  2023-02-28 16:51 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
  2023-02-28 16:51 ` [PATCH 2/2] dlfcn,elf: impl dlload_audit_module " Stas Sergeev
  0 siblings, 2 replies; 8+ messages in thread
From: Stas Sergeev @ 2023-02-28 16:51 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stas Sergeev

Changes in v5: address the review comment of Jonathon Anderson:
Disabling existing audit call-backs may break some existing auditors
if they attempted to be loaded with dlload_audit_module(). Instead
return an error EINVAL and refuse to load an audit module that has
the unallowed call-backs (symbind, pltenter, pltexit).

Changes in v4: rebased, conflicts resolved.

Changes in v3: address the review comment of Jonathon Anderson:
Disable 3 audit call-backs for dynamically loaded modules. Namely
symbind, pltenter, pltexit. Extend test-case to make sure they
are not resolved and not called.

Changes in v2: address the review comment of Jonathon Anderson:
Add per-linkmap l_naudit counter to make sure each object is audited
only with the modules loaded before it. That avoids the possibility
of getting the "unrecognized" cookie. Test-case was enhanced to check
for unrecognized cookies.

This patch-set introduces the bare minimum functionality for working
with audit modules at run-time.

Patch1 fixes the check in dlmopen() which avoids loading solibs into
the auditing namespace. But RTLD_NOLOAD was forgotten to check, and
with that flags nothing gets loaded into auditing namespace, so dlmopen()
should succeed and return the handle for auditing object.

Patch2 adds dlload_audit_module() function and a test-case for it.

-- 
2.37.2


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH v6 0/2] minimal run-time audit support
@ 2023-03-01 15:08 Stas Sergeev
  2023-03-01 15:08 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
  0 siblings, 1 reply; 8+ messages in thread
From: Stas Sergeev @ 2023-03-01 15:08 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stas Sergeev

Changes in v6: fix what seems to be a problem in v5: call
unload_audit_module() before _dl_signal_error(), rather than after.
It seems _dl_signal_error() may involve longjmp() so it should be
called the last, after any clean-ups.

Changes in v5: address the review comment of Jonathon Anderson:
Disabling existing audit call-backs may break some existing auditors
if they attempted to be loaded with dlload_audit_module(). Instead
return an error EINVAL and refuse to load an audit module that has
the unallowed call-backs (symbind, pltenter, pltexit). Extend test
to make sure the error is reported as expected.

Changes in v4: rebased, conflicts resolved.

Changes in v3: address the review comment of Jonathon Anderson:
Disable 3 audit call-backs for dynamically loaded modules. Namely
symbind, pltenter, pltexit. Extend test-case to make sure they
are not resolved and not called.

Changes in v2: address the review comment of Jonathon Anderson:
Add per-linkmap l_naudit counter to make sure each object is audited
only with the modules loaded before it. That avoids the possibility
of getting the "unrecognized" cookie. Test-case was enhanced to check
for unrecognized cookies.

This patch-set introduces the bare minimum functionality for working
with audit modules at run-time.

Patch1 fixes the check in dlmopen() which avoids loading solibs into
the auditing namespace. But RTLD_NOLOAD was forgotten to check, and
with that flags nothing gets loaded into auditing namespace, so dlmopen()
should succeed and return the handle for auditing object.

Patch2 adds dlload_audit_module() function and a test-case for it.

-- 
2.37.2


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH v4 0/2] minimal run-time audit support
@ 2023-02-26 11:16 Stas Sergeev
  2023-02-26 11:16 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
  0 siblings, 1 reply; 8+ messages in thread
From: Stas Sergeev @ 2023-02-26 11:16 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stas Sergeev

Changes in v4: rebased, conflicts resolved.

Changes in v3: address the review comment of Jonathon Anderson:
Disable 3 audit call-backs for dynamically loaded modules. Namely
symbind, pltenter, pltexit. Extend test-case to make sure they
are not resolved and not called.

Changes in v2: address the review comment of Jonathon Anderson:
Add per-linkmap l_naudit counter to make sure each object is audited
only with the modules loaded before it. That avoids the possibility
of getting the "unrecognized" cookie. Test-case was enhanced to check
for unrecognized cookies.

This patch-set introduces the bare minimum functionality for working
with audit modules at run-time.

Patch1 fixes the check in dlmopen() which avoids loading solibs into
the auditing namespace. But RTLD_NOLOAD was forgotten to check, and
with that flags nothing gets loaded into auditing namespace, so dlmopen()
should succeed and return the handle for auditing object.

Patch2 adds dlload_audit_module() function and a test-case for it.

-- 
2.37.2


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH v3 0/2] minimal run-time audit support
@ 2023-02-24 16:53 Stas Sergeev
  2023-02-24 16:53 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
  0 siblings, 1 reply; 8+ messages in thread
From: Stas Sergeev @ 2023-02-24 16:53 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stas Sergeev

Changes in v3: address the review comment of Jonathon Anderson:
Disable 3 audit call-backs for dynamically loaded modules. Namely
symbind, pltenter, pltexit. Extend test-case to make sure they
are not resolved and not called.

Changes in v2: address the review comment of Jonathon Anderson:
Add per-linkmap l_naudit counter to make sure each object is audited
only with the modules loaded before it. That avoids the possibility
of getting the "unrecognized" cookie. Test-case was enhanced to check
for unrecognized cookies.

This patch-set introduces the bare minimum functionality for working
with audit modules at run-time.

Patch1 fixes the check in dlmopen() which avoids loading solibs into
the auditing namespace. But RTLD_NOLOAD was forgotten to check, and
with that flags nothing gets loaded into auditing namespace, so dlmopen()
should succeed and return the handle for auditing object.

Patch2 adds dlload_audit_module() function and a test-case for it.

-- 
2.37.2


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH v2 0/2] minimal run-time audit support
@ 2023-02-23  8:09 Stas Sergeev
  2023-02-23  8:09 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
  0 siblings, 1 reply; 8+ messages in thread
From: Stas Sergeev @ 2023-02-23  8:09 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stas Sergeev

Changes in v2: address the review comment of Jonathon Anderson:
Add per-linkmap l_naudit counter to make sure each object is audited
only with the modules loaded before it. That avoids the possibility
of getting the "unrecognized" cookie. Test-case was enhanced to check
for unrecognized cookies.

This patch-set introduces the bare minimum functionality for working
with audit modules at run-time.

Patch1 fixes the check in dlmopen() which avoids loading solibs into
the auditing namespace. But RTLD_NOLOAD was forgotten to check, and
with that flags nothing gets loaded into auditing namespace, so dlmopen()
should succeed and return the handle for auditing object.

Patch2 adds dlload_audit_module() function and a test-case for it.

-- 
2.37.2


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH 0/2] minimal run-time audit support
@ 2023-02-21 15:33 Stas Sergeev
  2023-02-21 15:33 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
  0 siblings, 1 reply; 8+ messages in thread
From: Stas Sergeev @ 2023-02-21 15:33 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stas Sergeev

This patch-set introduces the bare minimum functionality for working
with audit modules at run-time.

Patch1 fixes the check in dlmopen() which avoids loading solibs into
the auditing namespace. But RTLD_NOLOAD was forgotten to check, and
with that flags nothing gets loaded into auditing namespace, so dlmopen()
should succeed and return the handle for auditing object.

Patch2 adds dlload_audit_module() function and a test-case for it.

Stas Sergeev (2):
  elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127]
  dlfcn,elf: impl dlload_audit_module [BZ #30127]

 dlfcn/Makefile                                |   4 +-
 dlfcn/Versions                                |   3 +
 dlfcn/dlaudit.c                               |  62 ++++++++
 elf/Makefile                                  |   5 +
 elf/dl-audit.c                                |  46 +++---
 elf/dl-fini.c                                 |   2 +-
 elf/dl-load.c                                 |   4 +-
 elf/dl-object.c                               |   2 +-
 elf/dl-open.c                                 |   3 +-
 elf/dl-reloc.c                                |   4 +-
 elf/dl-runtime.c                              |   2 +-
 elf/dl-sym-post.h                             |   2 +-
 elf/do-rel.h                                  |   4 +-
 elf/rtld.c                                    |  44 ++++--
 elf/tst-loadaudit.c                           | 133 ++++++++++++++++++
 sysdeps/generic/ldsodefs.h                    |  11 +-
 sysdeps/mach/hurd/i386/libc.abilist           |   1 +
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |   1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |   1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      |   1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |   1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |   1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |   1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |   1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |   1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |   1 +
 .../sysv/linux/loongarch/lp64/libc.abilist    |   1 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |   1 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |   1 +
 .../sysv/linux/microblaze/be/libc.abilist     |   1 +
 .../sysv/linux/microblaze/le/libc.abilist     |   1 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |   1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |   1 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |   1 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |   1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |   1 +
 sysdeps/unix/sysv/linux/or1k/libc.abilist     |   1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |   1 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |   1 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |   1 +
 .../linux/powerpc/powerpc64/le/libc.abilist   |   1 +
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |   1 +
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |   1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |   1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist |   1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |   1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |   1 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |   1 +
 .../sysv/linux/sparc/sparc64/libc.abilist     |   1 +
 .../unix/sysv/linux/x86_64/64/libc.abilist    |   1 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |   1 +
 51 files changed, 313 insertions(+), 53 deletions(-)
 create mode 100644 dlfcn/dlaudit.c
 create mode 100644 elf/tst-loadaudit.c

-- 
2.37.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-01 15:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 16:51 [PATCH v5 0/2] minimal run-time audit support Stas Sergeev
2023-02-28 16:51 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
2023-02-28 16:51 ` [PATCH 2/2] dlfcn,elf: impl dlload_audit_module " Stas Sergeev
  -- strict thread matches above, loose matches on Subject: below --
2023-03-01 15:08 [PATCH v6 0/2] minimal run-time audit support Stas Sergeev
2023-03-01 15:08 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
2023-02-26 11:16 [PATCH v4 0/2] minimal run-time audit support Stas Sergeev
2023-02-26 11:16 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
2023-02-24 16:53 [PATCH v3 0/2] minimal run-time audit support Stas Sergeev
2023-02-24 16:53 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
2023-02-23  8:09 [PATCH v2 0/2] minimal run-time audit support Stas Sergeev
2023-02-23  8:09 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
2023-02-21 15:33 [PATCH 0/2] minimal run-time audit support Stas Sergeev
2023-02-21 15:33 ` [PATCH 1/2] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).