public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v9 0/3] minimal run-time audit support
@ 2023-03-03 12:06 Stas Sergeev
  2023-03-03 12:06 ` [PATCH 1/3] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stas Sergeev @ 2023-03-03 12:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stas Sergeev

Changes in v9: address the review comment of Jonathon Anderson:
add "cookie" arg to dlload_audit_module(), and la_dynload() call-back
that takes this cookie. This allows the auditor to be notified about
the dynamic (rather than the usual static) loading. la_dynload()
can even reject the loading. Extend test-case for these new features.

Changes in v8: resolve conflicts on abilists...

Changes in v7: address the review comment of Jonathon Anderson:
allow dynamically loaded audit module to work with previously
loaded modules. The technique is the same as in dl_main(): call
la_objopen() for every pre-existing object to "introduce" it to
an auditor.

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] 6+ messages in thread
* [PATCH v8 0/3] minimal run-time audit support
@ 2023-03-02 20:40 Stas Sergeev
  2023-03-02 20:40 ` [PATCH 3/3] dlfcn,elf: impl dlload_audit_module [BZ #30127] Stas Sergeev
  0 siblings, 1 reply; 6+ messages in thread
From: Stas Sergeev @ 2023-03-02 20:40 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stas Sergeev

Changes in v8: resolve conflicts on abilists...

Changes in v7: address the review comment of Jonathon Anderson:
allow dynamically loaded audit module to work with previously
loaded modules. The technique is the same as in dl_main(): call
la_objopen() for every pre-existing object to "introduce" it to
an auditor.

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] 6+ messages in thread
* [PATCH v7 0/3] minimal run-time audit support
@ 2023-03-02 19:40 Stas Sergeev
  2023-03-02 19:40 ` [PATCH 3/3] dlfcn,elf: impl dlload_audit_module [BZ #30127] Stas Sergeev
  0 siblings, 1 reply; 6+ messages in thread
From: Stas Sergeev @ 2023-03-02 19:40 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stas Sergeev

Changes in v7: address the review comment of Jonathon Anderson:
allow dynamically loaded audit module to work with previously
loaded modules. The technique is the same as in dl_main(): call
la_objopen() for every pre-existing object to "introduce" it to
an auditor.

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] 6+ messages in thread

end of thread, other threads:[~2023-03-03 12:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 12:06 [PATCH v9 0/3] minimal run-time audit support Stas Sergeev
2023-03-03 12:06 ` [PATCH 1/3] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127] Stas Sergeev
2023-03-03 12:06 ` [PATCH 2/3] dl-audit: avoid closing fake ld.so " Stas Sergeev
2023-03-03 12:06 ` [PATCH 3/3] dlfcn,elf: impl dlload_audit_module " Stas Sergeev
  -- strict thread matches above, loose matches on Subject: below --
2023-03-02 20:40 [PATCH v8 0/3] minimal run-time audit support Stas Sergeev
2023-03-02 20:40 ` [PATCH 3/3] dlfcn,elf: impl dlload_audit_module [BZ #30127] Stas Sergeev
2023-03-02 19:40 [PATCH v7 0/3] minimal run-time audit support Stas Sergeev
2023-03-02 19:40 ` [PATCH 3/3] dlfcn,elf: impl dlload_audit_module [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).