lkml.org 
[lkml]   [2008]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/4] integrity: IMA as an integrity service provider
From
Date
On Thu, 2008-11-20 at 11:43 -0500, Mimi Zohar wrote:
>
> + /* Invalidate PCR, if a measured file is already open for read
> */
> + if ((mask == MAY_WRITE) || (mask == MAY_APPEND)) {
> + int mask_sav = data->mask;
> + int rc;
> +
> + data->mask = MAY_READ;
> + rc = ima_must_measure(&idata);
> + if (!rc) {
> + if (atomic_read(&(data->dentry->d_count)) - 1 >
> + atomic_read(&(inode->i_writecount)))
> + ima_add_violation(inode, data->filename,
> + "invalid_pcr", "ToMToU");
> + }
> + data->mask = mask_sav;
> + goto out;
> + }

Following up on Christoph's comment...

I'm worried that this calculation isn't very precise. The calculation
that you're trying to come up with here is the number of opens (d_count)
vs. the number of writers (i_writecount). When they don't match, you
know that the new open is the first write, and you must 'invalidate the
PCR'?

There are a number of things that elevate d_count, and it is a lot more
than just an open() that can do it. Is that OK?

-- Dave



\
 
 \ /
  Last update: 2008-11-20 22:25    [W:0.140 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site