projects/linux·commit 62f444e0

Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

62f444e0 · Linus Torvalds <[email protected]> · 2016-03-30 13:28:34 -05:00

Pull crypto fix from Herbert Xu:
 "This fixes a bug in pkcs7_validate_trust and its users where the
  output value may in fact be taken from uninitialised memory"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  PKCS#7: pkcs7_validate_trust(): initialize the _trusted output argument
Commit
62f444e0548eb503b42c8447675b468f5cf40c69
Parents
07c0db77 · e5435891

Merge commit. Changes below are compared with the first parent: 07c0db77.

Changes

1 files changed · +2 −0

FileStatusAddDelContent
crypto/asymmetric_keys/pkcs7_trust.cmodified+2−0View file

crypto/asymmetric_keys/pkcs7_trust.c

View file
diff --git a/crypto/asymmetric_keys/pkcs7_trust.c b/crypto/asymmetric_keys/pkcs7_trust.c
index 3bbdcc7..7d7a39b 100644
--- a/crypto/asymmetric_keys/pkcs7_trust.c
+++ b/crypto/asymmetric_keys/pkcs7_trust.c
@@ -178,6 +178,8 @@ int pkcs7_validate_trust(struct pkcs7_message *pkcs7,
int cached_ret = -ENOKEY;
int ret;
+ *_trusted = false;
+
for (p = pkcs7->certs; p; p = p->next)
p->seen = false;