diff for duplicates of <20170926201105.126166-2-ebiggers3@gmail.com> diff --git a/a/1.txt b/N1/1.txt index 3e9a406..1413b59 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -155,7 +155,7 @@ index eb914a838840..3ffb6829972f 100644 * Instantiate a key and link it into the target keyring atomically. Must be * called with the target keyring's semaphore writelocked. The target key's @@ -431,7 +445,7 @@ static int __key_instantiate_and_link(struct key *key, - if (ret = 0) { + if (ret == 0) { /* mark the key as being instantiated */ atomic_inc(&key->user->nikeys); - set_bit(KEY_FLAG_INSTANTIATED, &key->flags); @@ -178,7 +178,7 @@ index eb914a838840..3ffb6829972f 100644 key_schedule_gc(key->expiry + key_gc_delay); @@ -753,7 +765,7 @@ static inline key_ref_t __key_update(key_ref_t key_ref, ret = key->type->update(key, prep); - if (ret = 0) + if (ret == 0) /* updating a negative key instantiates it */ - clear_bit(KEY_FLAG_NEGATIVE, &key->flags); + mark_key_instantiated(key, 0); @@ -187,7 +187,7 @@ index eb914a838840..3ffb6829972f 100644 @@ -987,7 +999,7 @@ int key_update(key_ref_t key_ref, const void *payload, size_t plen) ret = key->type->update(key, &prep); - if (ret = 0) + if (ret == 0) /* updating a negative key instantiates it */ - clear_bit(KEY_FLAG_NEGATIVE, &key->flags); + mark_key_instantiated(key, 0); @@ -199,7 +199,7 @@ index 365ff85d7e27..19a09e121089 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c @@ -1223,6 +1223,9 @@ long keyctl_reject_key(key_serial_t id, unsigned timeout, unsigned error, - error = ERESTART_RESTARTBLOCK) + error == ERESTART_RESTARTBLOCK) return -EINVAL; + BUILD_BUG_ON(MAX_ERRNO > (KEY_FLAGS_REJECT_ERROR_MASK >> @@ -252,3 +252,8 @@ index 63e63a42db3c..0aab68344837 100644 EXPORT_SYMBOL(wait_for_key_construction); -- 2.14.1.992.g2c7b836f3a-goog + +-- +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/N1/content_digest index 923dd30..ffc9ce8 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,7 @@ "ref\020170926201105.126166-1-ebiggers3@gmail.com\0" - "From\0Eric Biggers <ebiggers3@gmail.com>\0" + "From\0ebiggers3@gmail.com (Eric Biggers)\0" "Subject\0[PATCH v2 1/6] KEYS: fix race between updating and finding negative key\0" - "Date\0Tue, 26 Sep 2017 20:11:00 +0000\0" + "Date\0Tue, 26 Sep 2017 13:11:00 -0700\0" "To\0linux-security-module@vger.kernel.org\0" "\00:1\0" "b\0" @@ -162,7 +162,7 @@ " * Instantiate a key and link it into the target keyring atomically. Must be\n" " * called with the target keyring's semaphore writelocked. The target key's\n" "@@ -431,7 +445,7 @@ static int __key_instantiate_and_link(struct key *key,\n" - " \t\tif (ret = 0) {\n" + " \t\tif (ret == 0) {\n" " \t\t\t/* mark the key as being instantiated */\n" " \t\t\tatomic_inc(&key->user->nikeys);\n" "-\t\t\tset_bit(KEY_FLAG_INSTANTIATED, &key->flags);\n" @@ -185,7 +185,7 @@ " \t\tkey_schedule_gc(key->expiry + key_gc_delay);\n" "@@ -753,7 +765,7 @@ static inline key_ref_t __key_update(key_ref_t key_ref,\n" " \tret = key->type->update(key, prep);\n" - " \tif (ret = 0)\n" + " \tif (ret == 0)\n" " \t\t/* updating a negative key instantiates it */\n" "-\t\tclear_bit(KEY_FLAG_NEGATIVE, &key->flags);\n" "+\t\tmark_key_instantiated(key, 0);\n" @@ -194,7 +194,7 @@ " \n" "@@ -987,7 +999,7 @@ int key_update(key_ref_t key_ref, const void *payload, size_t plen)\n" " \tret = key->type->update(key, &prep);\n" - " \tif (ret = 0)\n" + " \tif (ret == 0)\n" " \t\t/* updating a negative key instantiates it */\n" "-\t\tclear_bit(KEY_FLAG_NEGATIVE, &key->flags);\n" "+\t\tmark_key_instantiated(key, 0);\n" @@ -206,7 +206,7 @@ "--- a/security/keys/keyctl.c\n" "+++ b/security/keys/keyctl.c\n" "@@ -1223,6 +1223,9 @@ long keyctl_reject_key(key_serial_t id, unsigned timeout, unsigned error,\n" - " \t error = ERESTART_RESTARTBLOCK)\n" + " \t error == ERESTART_RESTARTBLOCK)\n" " \t\treturn -EINVAL;\n" " \n" "+\tBUILD_BUG_ON(MAX_ERRNO > (KEY_FLAGS_REJECT_ERROR_MASK >>\n" @@ -258,6 +258,11 @@ " }\n" " EXPORT_SYMBOL(wait_for_key_construction);\n" "-- \n" - 2.14.1.992.g2c7b836f3a-goog + "2.14.1.992.g2c7b836f3a-goog\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 -280b9059f061db493afc74ebf455100cf427d2689c269658d8184195a89e8469 +c0622fae6ba69acdc8ea7444aca57bd040dddcb9aba53b03449f248fcd46999a
diff --git a/a/1.txt b/N2/1.txt index 3e9a406..48407e5 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -155,7 +155,7 @@ index eb914a838840..3ffb6829972f 100644 * Instantiate a key and link it into the target keyring atomically. Must be * called with the target keyring's semaphore writelocked. The target key's @@ -431,7 +445,7 @@ static int __key_instantiate_and_link(struct key *key, - if (ret = 0) { + if (ret == 0) { /* mark the key as being instantiated */ atomic_inc(&key->user->nikeys); - set_bit(KEY_FLAG_INSTANTIATED, &key->flags); @@ -178,7 +178,7 @@ index eb914a838840..3ffb6829972f 100644 key_schedule_gc(key->expiry + key_gc_delay); @@ -753,7 +765,7 @@ static inline key_ref_t __key_update(key_ref_t key_ref, ret = key->type->update(key, prep); - if (ret = 0) + if (ret == 0) /* updating a negative key instantiates it */ - clear_bit(KEY_FLAG_NEGATIVE, &key->flags); + mark_key_instantiated(key, 0); @@ -187,7 +187,7 @@ index eb914a838840..3ffb6829972f 100644 @@ -987,7 +999,7 @@ int key_update(key_ref_t key_ref, const void *payload, size_t plen) ret = key->type->update(key, &prep); - if (ret = 0) + if (ret == 0) /* updating a negative key instantiates it */ - clear_bit(KEY_FLAG_NEGATIVE, &key->flags); + mark_key_instantiated(key, 0); @@ -199,7 +199,7 @@ index 365ff85d7e27..19a09e121089 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c @@ -1223,6 +1223,9 @@ long keyctl_reject_key(key_serial_t id, unsigned timeout, unsigned error, - error = ERESTART_RESTARTBLOCK) + error == ERESTART_RESTARTBLOCK) return -EINVAL; + BUILD_BUG_ON(MAX_ERRNO > (KEY_FLAGS_REJECT_ERROR_MASK >> diff --git a/a/content_digest b/N2/content_digest index 923dd30..f65adfc 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -1,8 +1,14 @@ "ref\020170926201105.126166-1-ebiggers3@gmail.com\0" "From\0Eric Biggers <ebiggers3@gmail.com>\0" "Subject\0[PATCH v2 1/6] KEYS: fix race between updating and finding negative key\0" - "Date\0Tue, 26 Sep 2017 20:11:00 +0000\0" - "To\0linux-security-module@vger.kernel.org\0" + "Date\0Tue, 26 Sep 2017 13:11:00 -0700\0" + "To\0keyrings@vger.kernel.org\0" + "Cc\0David Howells <dhowells@redhat.com>" + Michael Halcrow <mhalcrow@google.com> + linux-security-module@vger.kernel.org + linux-kernel@vger.kernel.org + Eric Biggers <ebiggers@google.com> + " stable@vger.kernel.org\0" "\00:1\0" "b\0" "From: Eric Biggers <ebiggers@google.com>\n" @@ -162,7 +168,7 @@ " * Instantiate a key and link it into the target keyring atomically. Must be\n" " * called with the target keyring's semaphore writelocked. The target key's\n" "@@ -431,7 +445,7 @@ static int __key_instantiate_and_link(struct key *key,\n" - " \t\tif (ret = 0) {\n" + " \t\tif (ret == 0) {\n" " \t\t\t/* mark the key as being instantiated */\n" " \t\t\tatomic_inc(&key->user->nikeys);\n" "-\t\t\tset_bit(KEY_FLAG_INSTANTIATED, &key->flags);\n" @@ -185,7 +191,7 @@ " \t\tkey_schedule_gc(key->expiry + key_gc_delay);\n" "@@ -753,7 +765,7 @@ static inline key_ref_t __key_update(key_ref_t key_ref,\n" " \tret = key->type->update(key, prep);\n" - " \tif (ret = 0)\n" + " \tif (ret == 0)\n" " \t\t/* updating a negative key instantiates it */\n" "-\t\tclear_bit(KEY_FLAG_NEGATIVE, &key->flags);\n" "+\t\tmark_key_instantiated(key, 0);\n" @@ -194,7 +200,7 @@ " \n" "@@ -987,7 +999,7 @@ int key_update(key_ref_t key_ref, const void *payload, size_t plen)\n" " \tret = key->type->update(key, &prep);\n" - " \tif (ret = 0)\n" + " \tif (ret == 0)\n" " \t\t/* updating a negative key instantiates it */\n" "-\t\tclear_bit(KEY_FLAG_NEGATIVE, &key->flags);\n" "+\t\tmark_key_instantiated(key, 0);\n" @@ -206,7 +212,7 @@ "--- a/security/keys/keyctl.c\n" "+++ b/security/keys/keyctl.c\n" "@@ -1223,6 +1223,9 @@ long keyctl_reject_key(key_serial_t id, unsigned timeout, unsigned error,\n" - " \t error = ERESTART_RESTARTBLOCK)\n" + " \t error == ERESTART_RESTARTBLOCK)\n" " \t\treturn -EINVAL;\n" " \n" "+\tBUILD_BUG_ON(MAX_ERRNO > (KEY_FLAGS_REJECT_ERROR_MASK >>\n" @@ -260,4 +266,4 @@ "-- \n" 2.14.1.992.g2c7b836f3a-goog -280b9059f061db493afc74ebf455100cf427d2689c269658d8184195a89e8469 +766d2eca1f336551bb664c8dd07ae015e8666778a3e4332b694e223af33325fc
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.