Re: [PATCH] integrity: add ima_counts_put (updated)

From: hooanon05
Date: Mon Jun 29 2009 - 10:13:33 EST



Mimi Zohar:
> This patch fixes an imbalance message as reported by J.R. Okajima.
> The IMA file counters are incremented in ima_path_check. If the
> actual open fails, such as ETXTBSY, decrement the counters to
> prevent unnecessary imbalance messages.

Although I have no objection for this fix, I'd like to suggest you to
stop incrementing the counters in ima_path_check().
A while ago IMA_COUNT_LEAVE and ima_counts_get() were introduced, and
now ima_counts_put() appears.
Isn't it easier something like this,
- stop incrementing in ima_path_check().
- call ima_counts_get() in dentry_open() (or similar).
- delete IMA_COUNT_LEAVE/UPDATE and ima_counts_put().

How do you think?


J. R. Okajima
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/