diff for duplicates of <1501714334.27872.38.camel@linux.vnet.ibm.com> diff --git a/a/1.txt b/N1/1.txt index c4d4167..d02fd81 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -67,7 +67,7 @@ Makes sense. > >> + > >> + status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value_evm, > >> + xattr_len_evm, iint); -> >> + if (appraising_modsig && status = INTEGRITY_FAIL) { +> >> + if (appraising_modsig && status == INTEGRITY_FAIL) { > >> + cause = "invalid-HMAC"; > >> + goto out; > > @@ -103,18 +103,18 @@ The original code, without any extra tests, should be fine. > + > + status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value_evm, > + xattr_len_evm, iint); -> + if (appraising_modsig && (status = INTEGRITY_NOLABEL -> + || status = INTEGRITY_NOXATTRS)) +> + if (appraising_modsig && (status == INTEGRITY_NOLABEL +> + || status == INTEGRITY_NOXATTRS)) > + /* It's ok if there's no xattr in the case of modsig. */ > + ; > + else if (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) { -> if ((status = INTEGRITY_NOLABEL) -> || (status = INTEGRITY_NOXATTRS)) +> if ((status == INTEGRITY_NOLABEL) +> || (status == INTEGRITY_NOXATTRS)) > cause = "missing-HMAC"; > > >> + } else if (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) { -> >> if ((status = INTEGRITY_NOLABEL) -> >> || (status = INTEGRITY_NOXATTRS)) +> >> if ((status == INTEGRITY_NOLABEL) +> >> || (status == INTEGRITY_NOXATTRS)) > >> cause = "missing-HMAC"; > >> @@ -281,6 +319,43 @@ int ima_appraise_measurement(enum ima_hooks func, > >> status = INTEGRITY_PASS; diff --git a/a/content_digest b/N1/content_digest index 53baa7b..f51bb08 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -4,7 +4,7 @@ "ref\087fud9yig8.fsf@linux.vnet.ibm.com\0" "From\0Mimi Zohar <zohar@linux.vnet.ibm.com>\0" "Subject\0Re: [PATCH v3 7/7] ima: Support module-style appended signatures for appraisal\0" - "Date\0Wed, 02 Aug 2017 22:52:14 +0000\0" + "Date\0Wed, 02 Aug 2017 18:52:14 -0400\0" "To\0Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>\0" "Cc\0linux-security-module@vger.kernel.org" linux-ima-devel@lists.sourceforge.net @@ -94,7 +94,7 @@ "> >> +\n" "> >> +\tstatus = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value_evm,\n" "> >> +\t\t\t\t xattr_len_evm, iint);\n" - "> >> +\tif (appraising_modsig && status = INTEGRITY_FAIL) {\n" + "> >> +\tif (appraising_modsig && status == INTEGRITY_FAIL) {\n" "> >> +\t\tcause = \"invalid-HMAC\";\n" "> >> +\t\tgoto out;\n" "> >\n" @@ -130,18 +130,18 @@ "> +\n" "> +\tstatus = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value_evm,\n" "> +\t\t\t\t xattr_len_evm, iint);\n" - "> +\tif (appraising_modsig && (status = INTEGRITY_NOLABEL\n" - "> +\t\t\t\t || status = INTEGRITY_NOXATTRS))\n" + "> +\tif (appraising_modsig && (status == INTEGRITY_NOLABEL\n" + "> +\t\t\t\t || status == INTEGRITY_NOXATTRS))\n" "> +\t\t/* It's ok if there's no xattr in the case of modsig. */\n" "> +\t\t;\n" "> +\telse if (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) {\n" - "> \t\tif ((status = INTEGRITY_NOLABEL)\n" - "> \t\t || (status = INTEGRITY_NOXATTRS))\n" + "> \t\tif ((status == INTEGRITY_NOLABEL)\n" + "> \t\t || (status == INTEGRITY_NOXATTRS))\n" "> \t\t\tcause = \"missing-HMAC\";\n" "> \n" "> >> +\t} else if (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) {\n" - "> >> \t\tif ((status = INTEGRITY_NOLABEL)\n" - "> >> \t\t || (status = INTEGRITY_NOXATTRS))\n" + "> >> \t\tif ((status == INTEGRITY_NOLABEL)\n" + "> >> \t\t || (status == INTEGRITY_NOXATTRS))\n" "> >> \t\t\tcause = \"missing-HMAC\";\n" "> >> @@ -281,6 +319,43 @@ int ima_appraise_measurement(enum ima_hooks func,\n" "> >> \t\t\tstatus = INTEGRITY_PASS;\n" @@ -219,4 +219,4 @@ "\n" Mimi -9e76b0a283b284a05b83458c41aecf1794f05c65f14a7e98465cefde7e7a38eb +1decd7ddc530d3e3fea2c77571b81c76d3a61ea98b35ca989bed87a98f5b018d
diff --git a/a/1.txt b/N2/1.txt index c4d4167..8f32abd 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -67,7 +67,7 @@ Makes sense. > >> + > >> + status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value_evm, > >> + xattr_len_evm, iint); -> >> + if (appraising_modsig && status = INTEGRITY_FAIL) { +> >> + if (appraising_modsig && status == INTEGRITY_FAIL) { > >> + cause = "invalid-HMAC"; > >> + goto out; > > @@ -103,18 +103,18 @@ The original code, without any extra tests, should be fine. > + > + status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value_evm, > + xattr_len_evm, iint); -> + if (appraising_modsig && (status = INTEGRITY_NOLABEL -> + || status = INTEGRITY_NOXATTRS)) +> + if (appraising_modsig && (status == INTEGRITY_NOLABEL +> + || status == INTEGRITY_NOXATTRS)) > + /* It's ok if there's no xattr in the case of modsig. */ > + ; > + else if (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) { -> if ((status = INTEGRITY_NOLABEL) -> || (status = INTEGRITY_NOXATTRS)) +> if ((status == INTEGRITY_NOLABEL) +> || (status == INTEGRITY_NOXATTRS)) > cause = "missing-HMAC"; > > >> + } else if (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) { -> >> if ((status = INTEGRITY_NOLABEL) -> >> || (status = INTEGRITY_NOXATTRS)) +> >> if ((status == INTEGRITY_NOLABEL) +> >> || (status == INTEGRITY_NOXATTRS)) > >> cause = "missing-HMAC"; > >> @@ -281,6 +319,43 @@ int ima_appraise_measurement(enum ima_hooks func, > >> status = INTEGRITY_PASS; @@ -181,13 +181,18 @@ just once. > prefer? The file hash (without the appended signature) is already being -calculated by verify_pkcs7_message_sig(). There's no reason to +calculated by verify_pkcs7_message_sig(). ?There's no reason to calculate it twice. If the appended signature verification succeeds, that means the file -hash stored in the appended signature was valid. Somehow we need +hash stored in the appended signature was valid. ?Somehow we need access to sig->digest, sig->digest_size and sig->hash_algo, which was -compared against the calculated hash. Refer to +compared against the calculated hash. ?Refer to public_key_verify_signature(). Mimi + +-- +To unsubscribe from this list: send the line "unsubscribe linux-security-module" in +the body of a message to majordomo at vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/a/content_digest b/N2/content_digest index 53baa7b..f57bacd 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -2,27 +2,10 @@ "ref\020170706221753.17380-8-bauerman@linux.vnet.ibm.com\0" "ref\01501424988.9230.67.camel@linux.vnet.ibm.com\0" "ref\087fud9yig8.fsf@linux.vnet.ibm.com\0" - "From\0Mimi Zohar <zohar@linux.vnet.ibm.com>\0" - "Subject\0Re: [PATCH v3 7/7] ima: Support module-style appended signatures for appraisal\0" - "Date\0Wed, 02 Aug 2017 22:52:14 +0000\0" - "To\0Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>\0" - "Cc\0linux-security-module@vger.kernel.org" - linux-ima-devel@lists.sourceforge.net - keyrings@vger.kernel.org - linux-crypto@vger.kernel.org - linuxppc-dev@lists.ozlabs.org - linux-kernel@vger.kernel.org - Dmitry Kasatkin <dmitry.kasatkin@gmail.com> - James Morris <james.l.morris@oracle.com> - Serge E. Hallyn <serge@hallyn.com> - David Howells <dhowells@redhat.com> - David Woodhouse <dwmw2@infradead.org> - Jessica Yu <jeyu@redhat.com> - Rusty Russell <rusty@rustcorp.com.au> - Herbert Xu <herbert@gondor.apana.org.au> - David S. Miller <davem@davemloft.net> - AKASHI - " Takahiro <takahiro.akashi@linaro.org>\0" + "From\0zohar@linux.vnet.ibm.com (Mimi Zohar)\0" + "Subject\0[PATCH v3 7/7] ima: Support module-style appended signatures for appraisal\0" + "Date\0Wed, 02 Aug 2017 18:52:14 -0400\0" + "To\0linux-security-module@vger.kernel.org\0" "\00:1\0" "b\0" "On Wed, 2017-08-02 at 14:42 -0300, Thiago Jung Bauermann wrote:\n" @@ -94,7 +77,7 @@ "> >> +\n" "> >> +\tstatus = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value_evm,\n" "> >> +\t\t\t\t xattr_len_evm, iint);\n" - "> >> +\tif (appraising_modsig && status = INTEGRITY_FAIL) {\n" + "> >> +\tif (appraising_modsig && status == INTEGRITY_FAIL) {\n" "> >> +\t\tcause = \"invalid-HMAC\";\n" "> >> +\t\tgoto out;\n" "> >\n" @@ -130,18 +113,18 @@ "> +\n" "> +\tstatus = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value_evm,\n" "> +\t\t\t\t xattr_len_evm, iint);\n" - "> +\tif (appraising_modsig && (status = INTEGRITY_NOLABEL\n" - "> +\t\t\t\t || status = INTEGRITY_NOXATTRS))\n" + "> +\tif (appraising_modsig && (status == INTEGRITY_NOLABEL\n" + "> +\t\t\t\t || status == INTEGRITY_NOXATTRS))\n" "> +\t\t/* It's ok if there's no xattr in the case of modsig. */\n" "> +\t\t;\n" "> +\telse if (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) {\n" - "> \t\tif ((status = INTEGRITY_NOLABEL)\n" - "> \t\t || (status = INTEGRITY_NOXATTRS))\n" + "> \t\tif ((status == INTEGRITY_NOLABEL)\n" + "> \t\t || (status == INTEGRITY_NOXATTRS))\n" "> \t\t\tcause = \"missing-HMAC\";\n" "> \n" "> >> +\t} else if (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) {\n" - "> >> \t\tif ((status = INTEGRITY_NOLABEL)\n" - "> >> \t\t || (status = INTEGRITY_NOXATTRS))\n" + "> >> \t\tif ((status == INTEGRITY_NOLABEL)\n" + "> >> \t\t || (status == INTEGRITY_NOXATTRS))\n" "> >> \t\t\tcause = \"missing-HMAC\";\n" "> >> @@ -281,6 +319,43 @@ int ima_appraise_measurement(enum ima_hooks func,\n" "> >> \t\t\tstatus = INTEGRITY_PASS;\n" @@ -208,15 +191,20 @@ "> prefer?\n" "\n" "The file hash (without the appended signature) is already being\n" - "calculated by verify_pkcs7_message_sig(). \302\240There's no reason to\n" + "calculated by verify_pkcs7_message_sig(). ?There's no reason to\n" "calculate it twice.\n" "\n" "If the appended signature verification succeeds, that means the file\n" - "hash stored in the appended signature was valid. \302\240Somehow we need\n" + "hash stored in the appended signature was valid. ?Somehow we need\n" "access to sig->digest, sig->digest_size and sig->hash_algo, which was\n" - "compared against the calculated hash. \302\240Refer to\n" + "compared against the calculated hash. ?Refer to\n" "public_key_verify_signature().\n" "\n" - Mimi + "Mimi\n" + "\n" + "--\n" + "To unsubscribe from this list: send the line \"unsubscribe linux-security-module\" in\n" + "the body of a message to majordomo at vger.kernel.org\n" + More majordomo info at http://vger.kernel.org/majordomo-info.html -9e76b0a283b284a05b83458c41aecf1794f05c65f14a7e98465cefde7e7a38eb +a66ef80b490df7363baf98025e46c1905d8384fa39b381674da7b9d600836bc4
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.