public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Can I use la_symbind to change the shared object file where it's binded?
@ 2022-10-06 17:05 Farid Zakaria
  2022-10-10  8:43 ` Florian Weimer
  0 siblings, 1 reply; 2+ messages in thread
From: Farid Zakaria @ 2022-10-06 17:05 UTC (permalink / raw)
  To: Libc-help

Hello!

I am looking to see if I can replicate LD_PRELOAD using la_symbind in
the rltd-audit API.

I would like to provide the audit API a: symbol -> shared object file
(perhaps with offset) and have the audit API override it.

Is this possible?
I am thinking perhaps I can dlopen the file in the audit method and
then use dlsym as well.

(Hopefully this question makes sense and appreciate any advice)

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

* Re: Can I use la_symbind to change the shared object file where it's binded?
  2022-10-06 17:05 Can I use la_symbind to change the shared object file where it's binded? Farid Zakaria
@ 2022-10-10  8:43 ` Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2022-10-10  8:43 UTC (permalink / raw)
  To: Farid Zakaria via Libc-help; +Cc: Farid Zakaria

* Farid Zakaria via Libc-help:

> I am looking to see if I can replicate LD_PRELOAD using la_symbind in
> the rltd-audit API.
>
> I would like to provide the audit API a: symbol -> shared object file
> (perhaps with offset) and have the audit API override it.
>
> Is this possible?
> I am thinking perhaps I can dlopen the file in the audit method and
> then use dlsym as well.

It's possible to use la_symbind to alter some symbol bindings.  Where
the replacement symbol address comes from does not matter.

You may have to use dlmopen, to inject the shared object into the main
namespace, not the auditor namespace.  You probably have to open the
shared object before the la_symbind callback happens.

Be sure to use a recent glibc versions (2.34 and later) because many
bugs in auditor support have been fixed.

Thanks,
Florian


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

end of thread, other threads:[~2022-10-10  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06 17:05 Can I use la_symbind to change the shared object file where it's binded? Farid Zakaria
2022-10-10  8:43 ` Florian Weimer

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).