PERFORCE change 76434 for review

Christian S.J. Peron csjp at FreeBSD.org
Tue May 3 15:49:09 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=76434

Change 76434 by csjp at csjp_xor on 2005/05/03 15:48:40

	zero out checksum structure before writing it out to the extended attr.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.c#2 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.c#2 (text+ko) ====

@@ -609,6 +609,7 @@
 		error = ha->crypto_hash(vp, cred, digest);
 		if (error)
 			return (error);
+		bzero(&vcsum, sizeof(vcsum));
 		memcpy(vcsum.vs_sum, digest, ha->hashsize);
 		vcsum.vs_flags = ha->hashmask;
 		error = mac_chkexec_set_vcsum(vp, &vcsum);
@@ -630,6 +631,7 @@
 	match = (memcmp(digest, vcsum.vs_sum,
 	    ha->hashsize) == 0);
 	if (!match && !mac_chkexec_enforce) {
+		bzero(&vcsum, sizeof(vcsum));
 		memcpy(vcsum.vs_sum, digest, ha->hashsize);
 		vcsum.vs_flags = ha->hashmask;
 		error = mac_chkexec_set_vcsum(vp, &vcsum);
@@ -843,6 +845,7 @@
 		vput(nd.ni_vp);
 		return (error);
 	}
+	bzero(&vcsum, sizeof(vcsum));
 	memcpy(vcsum.vs_sum, digest, ha->hashsize);
 	vcsum.vs_flags = ha->hashmask;
 	error = mac_chkexec_set_vcsum(nd.ni_vp, &vcsum);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list