@@ -1,3 +1,4 @@
af_alg01 af_alg01
+af_alg02 af_alg02
pcrypt_aead01 pcrypt_aead01
crypto_user01 crypto_user01
@@ -27,6 +27,7 @@ cve-2017-15299 request_key03 -b cve-2017-15299
cve-2017-15537 ptrace07
cve-2017-15649 fanout01
cve-2017-15951 request_key03 -b cve-2017-15951
+cve-2017-17805 af_alg02
cve-2017-17806 af_alg01
cve-2017-17807 request_key04
cve-2017-1000364 stack_clash
@@ -1,3 +1,4 @@
af_alg01
+af_alg02
pcrypt_aead01
crypto_user01
new file mode 100644
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright 2019 Google LLC
+ */
+
+/*
+ * Regression test for commit ecaaab564978 ("crypto: salsa20 - fix
+ * blkcipher_walk API usage"), or CVE-2017-17805. This test verifies that an
+ * empty message can be encrypted with Salsa20 without crashing the kernel.
+ */
+
+#include "tst_test.h"
+#include "tst_af_alg.h"
+
+static void run(void)
+{
+ char buf[16];
+ int reqfd = tst_alg_setup_reqfd("skcipher", "salsa20", NULL, 16);
+
+ /* With the bug the kernel crashed here */
+ if (read(reqfd, buf, 16) == 0)
+ tst_res(TPASS, "Successfully \"encrypted\" an empty message");
+ else
+ tst_res(TBROK, "read() didn't return 0");
+}
+
+static struct tst_test test = {
+ .test_all = run,
+};