From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Grubb Subject: Re: Detecting loading of libraries Date: Mon, 26 Jan 2015 19:48:14 -0500 Message-ID: <1793689.Gn7jBOnND6@x2> References: <5dc8468401e6007eaad18a0b7d782927@thefroid.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5dc8468401e6007eaad18a0b7d782927@thefroid.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com List-Id: linux-audit@redhat.com On Wednesday, January 21, 2015 04:01:59 PM hsultan@thefroid.net wrote: > I'm wondering if there's a good way of detecting the loading of > libraries by processes (I am specifically NOT talking about the uselib > syscall). This has never been a problem people needed a solution for. Its always been assumed that the runtime linker does the right thing. > strace shows me apps do open(...)/mmap/mprotect > I'm currently intercepting mmap calls, however no additional context > records are given to provide the name of the library, and the file > descriptor is the 5th parameter, so I can't get that either to match it > to an open(...) > > Is there a way to do this that I'm missing ? I'd almost thing you'd want to patch ld.so to provide this...but then its not running as a privileged process. So, it can't do it. Ld is the thing that knows the _intent_ behind the open and mmap and mprot. Nothing else does. -Steve