Messages in this thread | | | Subject | Re: [PATCH 2/6] integrity: IMA as an integrity service provider | From | david safford <> | Date | Tue, 03 Feb 2009 08:36:10 -0500 |
| |
On Mon, 2009-02-02 at 17:02 -0600, Serge E. Hallyn wrote: > Quoting Mimi Zohar (zohar@linux.vnet.ibm.com): > > + > > +/* 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, 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
| |