From mboxrd@z Thu Jan 1 00:00:00 1970 From: hsultan@thefroid.net Subject: Re: Detecting loading of libraries Date: Wed, 21 Jan 2015 17:30:07 -0800 Message-ID: References: <5dc8468401e6007eaad18a0b7d782927@thefroid.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0M1U9Fp017367 for ; Wed, 21 Jan 2015 20:30:09 -0500 Received: from homiemail-a59.g.dreamhost.com (sub5.mail.dreamhost.com [208.113.200.129]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0M1U8qj025878 for ; Wed, 21 Jan 2015 20:30:08 -0500 Received: from homiemail-a59.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a59.g.dreamhost.com (Postfix) with ESMTP id D6DD5564061 for ; Wed, 21 Jan 2015 17:30:07 -0800 (PST) Received: from webmail.thefroid.net (caiajhbihbdd.dreamhost.com [208.97.187.133]) (Authenticated sender: hsultan@thefroid.net) by homiemail-a59.g.dreamhost.com (Postfix) with ESMTPA id CE72856405C for ; Wed, 21 Jan 2015 17:30:07 -0800 (PST) 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 Ok, I now see the file descriptor in a context record for mmap *sometimes* 1300 - audit(1421886600.839:25623): arch=c000003e syscall=9 success=yes exit=140564293636096 a0=0 a1=1000 a2=3 a3=22 items=0 ppid=23505 pid=24942 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts5 ses=2 comm="sudo" exe="/usr/bin/sudo" key=(null) 1300 - audit(1421886600.839:25624): arch=c000003e syscall=9 success=yes exit=140564293636096 a0=0 a1=1000 a2=3 a3=22 items=0 ppid=23505 pid=24942 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts5 ses=2 comm="sudo" exe="/usr/bin/sudo" key=(null) 1300 - audit(1421886600.839:25625): arch=c000003e syscall=9 success=yes exit=140564239544320 a0=0 a1=2020f0 a2=5 a3=802 items=0 ppid=23505 pid=24942 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts5 ses=2 comm="sudo" exe="/usr/bin/sudo" key=(null) 1323 - audit(1421886600.839:25625): fd=10 flags=0x802 1300 - audit(1421886600.839:25626): arch=c000003e syscall=9 success=yes exit=140564241645568 a0=7fd7a9b10000 a1=2000 a2=3 a3=812 items=0 ppid=23505 pid=24942 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts5 ses=2 comm="sudo" exe="/usr/bin/sudo" key=(null) 1323 - audit(1421886600.839:25626): fd=10 flags=0x812 1300 - audit(1421886600.839:25627): arch=c000003e syscall=9 success=yes exit=140564293640192 a0=0 a1=1000 a2=3 a3=22 items=0 ppid=23505 pid=24942 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts5 ses=2 comm="sudo" exe="/usr/bin/sudo" key=(null) Any idea why the 1323 shows up sometimes and not each time an mmap call is made ? Is the record generated only on the 1st mmap call for a library ? Thanks, Hassan On 2015-01-21 16:01, hsultan@thefroid.net wrote: > Hi, > > 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). > > 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 ? > > Thanks, > > Hassan > > -- > Linux-audit mailing list > Linux-audit@redhat.com > https://www.redhat.com/mailman/listinfo/linux-audit