Page MenuHomeFreeBSD

D30962.id91571.diff
No OneTemporary

D30962.id91571.diff

Index: sys/security/mac_veriexec_parser/mac_veriexec_parser.c
===================================================================
--- sys/security/mac_veriexec_parser/mac_veriexec_parser.c
+++ sys/security/mac_veriexec_parser/mac_veriexec_parser.c
@@ -65,6 +65,7 @@
#if MAXFINGERPRINTLEN >= SHA512_DIGEST_LENGTH
{"sha512=", SHA512_DIGEST_LENGTH},
#endif
+ {"no_hash", 0},
{NULL, 0}
};
@@ -197,7 +198,8 @@
* Split entry into three parts:
* path, fp_type and digest.
*/
- local_digest[-1] = '\0';
+ if (local_digest[-1] == '=')
+ local_digest[-1] = '\0';
*delimiter = '\0';
fp_type[-1] = '\0';
break;
@@ -331,6 +333,9 @@
if (rc != 0)
return (rc);
+ if (strcmp(fp_type, "no_hash") == 0)
+ return (0);
+
rc = hexstring_to_bin(digest);
if (rc != 0)
return (rc);
@@ -350,8 +355,23 @@
rc = open_file(path, &nid);
NDFREE(&nid, NDF_ONLY_PNBUF);
- if (rc != 0)
+ if (rc != 0) {
+ if (rc == ENOENT) {
+ strlcat(path, ".gz", sizeof(path));
+ rc = open_file(path, &nid);
+ NDFREE(&nid, NDF_ONLY_PNBUF);
+ if (rc == 0) {
+ /*
+ * A compressed version of this entry exists.
+ * These can't be loaded by kldload anyway,
+ * so just ignore this entry.
+ */
+ goto out;
+ }
+ rc = ENOENT;
+ }
return (rc);
+ }
rc = VOP_GETATTR(nid.ni_vp, &va, curthread->td_ucred);
if (rc != 0)

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 25, 10:33 AM (5 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27246039
Default Alt Text
D30962.id91571.diff (1 KB)

Event Timeline