Re: [PATCH 2/6] integrity: IMA as an integrity service provider

From: Serge E. Hallyn
Date: Tue Feb 03 2009 - 09:00:31 EST


Quoting david safford (safford@xxxxxxxxxxxxxx):
> On Mon, 2009-02-02 at 17:02 -0600, Serge E. Hallyn wrote:
> > Quoting Mimi Zohar (zohar@xxxxxxxxxxxxxxxxxx):
> > > +
> > > +/* Add template entry to the measurement list and hash table,
> > > + * and extend the pcr.
> > > + */
> > > +int ima_add_template_entry(struct ima_template_entry *entry, int violation,
> > > + const char *op, struct inode *inode)
> > > +{
> > > + u8 digest[IMA_DIGEST_SIZE];
> > > + const char *audit_cause = "hash_added";
> > > + int audit_info = 1;
> > > + int result = 0;
> > > +
> > > + mutex_lock(&ima_extend_list_mutex);
> > > + if (!violation) {
> > > + memcpy(digest, entry->digest, sizeof digest);
> > > + if (ima_lookup_digest_entry(digest)) {
> > > + audit_cause = "hash_exists";
> > > + goto out;
> >
> > Ok so not that I'm saying this would be easy, but an attacker
> > compromising say ftpd doesn't need to come up with a compromised
> > ftpd where sha1sum(evilftpd)==sha1sum(origftpd) - he just needs to
> > come up with one wher sha1sum(evilftpd)==sha1sum(X) where X is
> > any pristine program already loaded. Right?
> >
> > Is checking that strcmp(entry->file_name, newfilename)==0 warranted
> > here, or am I being silly?
>
> The birthday paradox, which is essential for any practical attack,
> requires that the attacker can freely choose both x and y in
> his search for collisions sha1sum(x) == sha1sum(y). Here, the
> attacker cannot freely choose x,

That's why I said a forward-looking attacker. He can, in fact,
choose x.

> but can only choose x from a list
> of existing files. Even if there are a million valid files, that only
> reduces the attack complexity by 2^20, which is still infeasible.
>
> dave
--
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/