diff for duplicates of <20171018005331.2688-7-bauerman@linux.vnet.ibm.com> diff --git a/a/1.txt b/N1/1.txt index 57a71de..b6908dd 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -20,7 +20,7 @@ index d52b487ad259..4e61d3189b72 100644 +static inline bool is_ima_sig(const struct evm_ima_xattr_data *xattr_value) +{ -+ return xattr_value && xattr_value->type = EVM_IMA_XATTR_DIGSIG; ++ return xattr_value && xattr_value->type == EVM_IMA_XATTR_DIGSIG; +} + /* @@ -44,9 +44,9 @@ index 58c6a60c7e83..2c069f47eeec 100644 status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value, rc, iint); - 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_FAIL) +- else if (status == INTEGRITY_FAIL) - cause = "invalid-HMAC"; + switch (status) { + case INTEGRITY_PASS: @@ -72,14 +72,14 @@ index 58c6a60c7e83..2c069f47eeec 100644 + !is_ima_sig(xattr_value)) { if (!ima_fix_xattr(dentry, iint)) status = INTEGRITY_PASS; -- } else if (inode->i_size = 0 && +- } else if (inode->i_size == 0 && - (iint->flags & IMA_NEW_FILE) && - xattr_value && -- xattr_value->type = EVM_IMA_XATTR_DIGSIG) { +- xattr_value->type == EVM_IMA_XATTR_DIGSIG) { + } + + /* Permit new files with file signatures, but without data. */ -+ if (inode->i_size = 0 && (iint->flags & IMA_NEW_FILE) && ++ if (inode->i_size == 0 && (iint->flags & IMA_NEW_FILE) && + is_ima_sig(xattr_value)) { status = INTEGRITY_PASS; } @@ -91,7 +91,7 @@ index 58c6a60c7e83..2c069f47eeec 100644 if (!xattr_value_len || xvalue->type >= IMA_XATTR_LAST) return -EINVAL; ima_reset_appraise_flags(d_backing_inode(dentry), -- xvalue->type = EVM_IMA_XATTR_DIGSIG); +- xvalue->type == EVM_IMA_XATTR_DIGSIG); + is_ima_sig(xvalue)); result = 0; } diff --git a/a/content_digest b/N1/content_digest index 766402e..9c0f36e 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,7 @@ "ref\020171018005331.2688-1-bauerman@linux.vnet.ibm.com\0" "From\0Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>\0" "Subject\0[PATCH v5 06/18] ima: Improvements in ima_appraise_measurement\0" - "Date\0Wed, 18 Oct 2017 00:53:19 +0000\0" + "Date\0Tue, 17 Oct 2017 22:53:19 -0200\0" "To\0linux-integrity@vger.kernel.org\0" "Cc\0linux-security-module@vger.kernel.org" keyrings@vger.kernel.org @@ -45,7 +45,7 @@ " \n" "+static inline bool is_ima_sig(const struct evm_ima_xattr_data *xattr_value)\n" "+{\n" - "+\treturn xattr_value && xattr_value->type = EVM_IMA_XATTR_DIGSIG;\n" + "+\treturn xattr_value && xattr_value->type == EVM_IMA_XATTR_DIGSIG;\n" "+}\n" "+\n" " /*\n" @@ -69,9 +69,9 @@ " \n" " \tstatus = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value, rc, iint);\n" "-\tif (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) {\n" - "-\t\tif (status = INTEGRITY_NOLABEL || status = INTEGRITY_NOXATTRS)\n" + "-\t\tif (status == INTEGRITY_NOLABEL || status == INTEGRITY_NOXATTRS)\n" "-\t\t\tcause = \"missing-HMAC\";\n" - "-\t\telse if (status = INTEGRITY_FAIL)\n" + "-\t\telse if (status == INTEGRITY_FAIL)\n" "-\t\t\tcause = \"invalid-HMAC\";\n" "+\tswitch (status) {\n" "+\tcase INTEGRITY_PASS:\n" @@ -97,14 +97,14 @@ "+\t\t !is_ima_sig(xattr_value)) {\n" " \t\t\tif (!ima_fix_xattr(dentry, iint))\n" " \t\t\t\tstatus = INTEGRITY_PASS;\n" - "-\t\t} else if (inode->i_size = 0 &&\n" + "-\t\t} else if (inode->i_size == 0 &&\n" "-\t\t\t (iint->flags & IMA_NEW_FILE) &&\n" "-\t\t\t xattr_value &&\n" - "-\t\t\t xattr_value->type = EVM_IMA_XATTR_DIGSIG) {\n" + "-\t\t\t xattr_value->type == EVM_IMA_XATTR_DIGSIG) {\n" "+\t\t}\n" "+\n" "+\t\t/* Permit new files with file signatures, but without data. */\n" - "+\t\tif (inode->i_size = 0 && (iint->flags & IMA_NEW_FILE) &&\n" + "+\t\tif (inode->i_size == 0 && (iint->flags & IMA_NEW_FILE) &&\n" "+\t\t is_ima_sig(xattr_value)) {\n" " \t\t\tstatus = INTEGRITY_PASS;\n" " \t\t}\n" @@ -116,10 +116,10 @@ " \t\tif (!xattr_value_len || xvalue->type >= IMA_XATTR_LAST)\n" " \t\t\treturn -EINVAL;\n" " \t\tima_reset_appraise_flags(d_backing_inode(dentry),\n" - "-\t\t\txvalue->type = EVM_IMA_XATTR_DIGSIG);\n" + "-\t\t\txvalue->type == EVM_IMA_XATTR_DIGSIG);\n" "+\t\t\t\t\t is_ima_sig(xvalue));\n" " \t\tresult = 0;\n" " \t}\n" " \treturn result;" -e864daf9afd6058f3bb85743006e833bda2f8bca5f5f57664cebed160e22d248 +1ab370292c149aafa38f3fe28a7f94ce20130bf644118ff473e5fe32f7695fb2
diff --git a/a/1.txt b/N2/1.txt index 57a71de..2283dd2 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -20,7 +20,7 @@ index d52b487ad259..4e61d3189b72 100644 +static inline bool is_ima_sig(const struct evm_ima_xattr_data *xattr_value) +{ -+ return xattr_value && xattr_value->type = EVM_IMA_XATTR_DIGSIG; ++ return xattr_value && xattr_value->type == EVM_IMA_XATTR_DIGSIG; +} + /* @@ -44,9 +44,9 @@ index 58c6a60c7e83..2c069f47eeec 100644 status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value, rc, iint); - 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_FAIL) +- else if (status == INTEGRITY_FAIL) - cause = "invalid-HMAC"; + switch (status) { + case INTEGRITY_PASS: @@ -72,14 +72,14 @@ index 58c6a60c7e83..2c069f47eeec 100644 + !is_ima_sig(xattr_value)) { if (!ima_fix_xattr(dentry, iint)) status = INTEGRITY_PASS; -- } else if (inode->i_size = 0 && +- } else if (inode->i_size == 0 && - (iint->flags & IMA_NEW_FILE) && - xattr_value && -- xattr_value->type = EVM_IMA_XATTR_DIGSIG) { +- xattr_value->type == EVM_IMA_XATTR_DIGSIG) { + } + + /* Permit new files with file signatures, but without data. */ -+ if (inode->i_size = 0 && (iint->flags & IMA_NEW_FILE) && ++ if (inode->i_size == 0 && (iint->flags & IMA_NEW_FILE) && + is_ima_sig(xattr_value)) { status = INTEGRITY_PASS; } @@ -91,8 +91,13 @@ index 58c6a60c7e83..2c069f47eeec 100644 if (!xattr_value_len || xvalue->type >= IMA_XATTR_LAST) return -EINVAL; ima_reset_appraise_flags(d_backing_inode(dentry), -- xvalue->type = EVM_IMA_XATTR_DIGSIG); +- xvalue->type == EVM_IMA_XATTR_DIGSIG); + is_ima_sig(xvalue)); result = 0; } return result; + +-- +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 766402e..33719e8 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -1,26 +1,8 @@ "ref\020171018005331.2688-1-bauerman@linux.vnet.ibm.com\0" - "From\0Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>\0" + "From\0bauerman@linux.vnet.ibm.com (Thiago Jung Bauermann)\0" "Subject\0[PATCH v5 06/18] ima: Improvements in ima_appraise_measurement\0" - "Date\0Wed, 18 Oct 2017 00:53:19 +0000\0" - "To\0linux-integrity@vger.kernel.org\0" - "Cc\0linux-security-module@vger.kernel.org" - keyrings@vger.kernel.org - linux-crypto@vger.kernel.org - linuxppc-dev@lists.ozlabs.org - linux-kernel@vger.kernel.org - Mimi Zohar <zohar@linux.vnet.ibm.com> - 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> - " Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>\0" + "Date\0Tue, 17 Oct 2017 22:53:19 -0200\0" + "To\0linux-security-module@vger.kernel.org\0" "\00:1\0" "b\0" "Replace nested ifs in the EVM xattr verification logic with a switch\n" @@ -45,7 +27,7 @@ " \n" "+static inline bool is_ima_sig(const struct evm_ima_xattr_data *xattr_value)\n" "+{\n" - "+\treturn xattr_value && xattr_value->type = EVM_IMA_XATTR_DIGSIG;\n" + "+\treturn xattr_value && xattr_value->type == EVM_IMA_XATTR_DIGSIG;\n" "+}\n" "+\n" " /*\n" @@ -69,9 +51,9 @@ " \n" " \tstatus = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value, rc, iint);\n" "-\tif (status != INTEGRITY_PASS && status != INTEGRITY_UNKNOWN) {\n" - "-\t\tif (status = INTEGRITY_NOLABEL || status = INTEGRITY_NOXATTRS)\n" + "-\t\tif (status == INTEGRITY_NOLABEL || status == INTEGRITY_NOXATTRS)\n" "-\t\t\tcause = \"missing-HMAC\";\n" - "-\t\telse if (status = INTEGRITY_FAIL)\n" + "-\t\telse if (status == INTEGRITY_FAIL)\n" "-\t\t\tcause = \"invalid-HMAC\";\n" "+\tswitch (status) {\n" "+\tcase INTEGRITY_PASS:\n" @@ -97,14 +79,14 @@ "+\t\t !is_ima_sig(xattr_value)) {\n" " \t\t\tif (!ima_fix_xattr(dentry, iint))\n" " \t\t\t\tstatus = INTEGRITY_PASS;\n" - "-\t\t} else if (inode->i_size = 0 &&\n" + "-\t\t} else if (inode->i_size == 0 &&\n" "-\t\t\t (iint->flags & IMA_NEW_FILE) &&\n" "-\t\t\t xattr_value &&\n" - "-\t\t\t xattr_value->type = EVM_IMA_XATTR_DIGSIG) {\n" + "-\t\t\t xattr_value->type == EVM_IMA_XATTR_DIGSIG) {\n" "+\t\t}\n" "+\n" "+\t\t/* Permit new files with file signatures, but without data. */\n" - "+\t\tif (inode->i_size = 0 && (iint->flags & IMA_NEW_FILE) &&\n" + "+\t\tif (inode->i_size == 0 && (iint->flags & IMA_NEW_FILE) &&\n" "+\t\t is_ima_sig(xattr_value)) {\n" " \t\t\tstatus = INTEGRITY_PASS;\n" " \t\t}\n" @@ -116,10 +98,15 @@ " \t\tif (!xattr_value_len || xvalue->type >= IMA_XATTR_LAST)\n" " \t\t\treturn -EINVAL;\n" " \t\tima_reset_appraise_flags(d_backing_inode(dentry),\n" - "-\t\t\txvalue->type = EVM_IMA_XATTR_DIGSIG);\n" + "-\t\t\txvalue->type == EVM_IMA_XATTR_DIGSIG);\n" "+\t\t\t\t\t is_ima_sig(xvalue));\n" " \t\tresult = 0;\n" " \t}\n" - " \treturn result;" + " \treturn result;\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 -e864daf9afd6058f3bb85743006e833bda2f8bca5f5f57664cebed160e22d248 +8d54c7e622a2cfcfdf25eb2015d504c17cf4e3efa1788df806e81cd000355fec
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.