From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Viro Subject: Re: close(2) not being audited? Date: Fri, 26 Jan 2007 18:20:51 -0500 Message-ID: <20070126232051.GG14621@devserv.devel.redhat.com> References: <200701261237.40345.sgrubb@redhat.com> <20070126221933.GF14621@devserv.devel.redhat.com> <20070126170112.6ac08156@crumpet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20070126170112.6ac08156@crumpet> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: "Timothy R. Chavez" Cc: linux-audit@redhat.com List-Id: linux-audit@redhat.com On Fri, Jan 26, 2007 at 05:01:12PM -0600, Timothy R. Chavez wrote: > > Please, define "access". Consider the following sequence: > > on April 1st: > > fd = open(foo, O_RDWR); > > p = mmap(..., fd, ...); > > close(fd); > > two days later: modify area pointed to by p > > a month later: munmap(p, ...); > > > > What do you want in the log? More specifically, _when_ do you want it? > > Write out a log when the last reference to the fd is put back... whether > that's from a close or an munmap. Sigh... One more time: there are two distinct classes of objects - opened files and opened descriptors. That's the point - by the time of munmap() there is no file descriptor at all. It's been gone for a month. Descriptor getting closed != file getting closed. If you are talking about the last reference to opened file - OK. But there won't necessary be any descriptors refering to it.