From b7d48e1265407b755f7827d0245547847cdba375 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Dec 20 2020 14:15:12 +0000 Subject: Update to 5.4.84 --- diff --git a/.kernel.metadata b/.kernel.metadata index ec1fca1..fa88bee 100644 --- a/.kernel.metadata +++ b/.kernel.metadata @@ -1,2 +1,2 @@ 98ae49ad49397d5a4dcb3ff9a082223edf7c5bbd SOURCES/linux-5.4.tar.xz -8d06345619804d1c13016d22d28606af24d052b2 SOURCES/patch-5.4.72.xz +a1314c96a2397fd8cf78ed43705774d5431676eb SOURCES/patch-5.4.84.xz diff --git a/SOURCES/kernel-ppc64le-debug-fedora.config b/SOURCES/kernel-ppc64le-debug-fedora.config index 50d72df..fbd0893 100644 --- a/SOURCES/kernel-ppc64le-debug-fedora.config +++ b/SOURCES/kernel-ppc64le-debug-fedora.config @@ -3969,6 +3969,7 @@ CONFIG_PPC_PSERIES=y # CONFIG_PPC_PTDUMP is not set CONFIG_PPC_RADIX_MMU_DEFAULT=y CONFIG_PPC_RADIX_MMU=y +CONFIG_PPC_RTAS_FILTER=y CONFIG_PPC_SMLPAR=y CONFIG_PPC_SPLPAR=y CONFIG_PPC_SUBPAGE_PROT=y diff --git a/SOURCES/kernel-ppc64le-fedora.config b/SOURCES/kernel-ppc64le-fedora.config index bbf6b2a..9f6d895 100644 --- a/SOURCES/kernel-ppc64le-fedora.config +++ b/SOURCES/kernel-ppc64le-fedora.config @@ -3948,6 +3948,7 @@ CONFIG_PPC_PSERIES=y # CONFIG_PPC_PTDUMP is not set CONFIG_PPC_RADIX_MMU_DEFAULT=y CONFIG_PPC_RADIX_MMU=y +CONFIG_PPC_RTAS_FILTER=y CONFIG_PPC_SMLPAR=y CONFIG_PPC_SPLPAR=y CONFIG_PPC_SUBPAGE_PROT=y diff --git a/SOURCES/wireguard.patch b/SOURCES/wireguard.patch index 038bc38..9d200b0 100644 --- a/SOURCES/wireguard.patch +++ b/SOURCES/wireguard.patch @@ -1,7 +1,7 @@ -From bbf4bb1aec9b0737d88cd74d133ee8b530c308fc Mon Sep 17 00:00:00 2001 +From f6ccc0027d3b18f38c5f96f8bae522fad2492c98 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:07 +0100 -Subject: [PATCH 001/111] crypto: lib - tidy up lib/crypto Kconfig and Makefile +Subject: [PATCH 001/117] crypto: lib - tidy up lib/crypto Kconfig and Makefile commit 746b2e024c67aa605ac12d135cd7085a49cf9dc4 upstream. @@ -118,13 +118,13 @@ index cbe0b6a6450d..63de4cb3fcf8 100644 +obj-$(CONFIG_CRYPTO_LIB_SHA256) += libsha256.o +libsha256-y := sha256.o -- -2.18.2 +2.18.4 -From 4ee599cdfc21e09b47c574c05d8d6fa5ff2c39d5 Mon Sep 17 00:00:00 2001 +From 6b2cb077c6b1fb093ec8174a8ddce787446c9e57 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:08 +0100 -Subject: [PATCH 002/111] crypto: chacha - move existing library code into +Subject: [PATCH 002/117] crypto: chacha - move existing library code into lib/crypto commit 5fb8ef25803ef33e2eb60b626435828b937bed75 upstream. @@ -645,13 +645,13 @@ index 000000000000..dabc3accae05 + +MODULE_LICENSE("GPL"); -- -2.18.2 +2.18.4 -From 7aeacfe16716998be9827d1b7211e3665caf0786 Mon Sep 17 00:00:00 2001 +From b6aac23330329ba2fd5953a2a9e954970b40044a Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:09 +0100 -Subject: [PATCH 003/111] crypto: x86/chacha - depend on generic chacha library +Subject: [PATCH 003/117] crypto: x86/chacha - depend on generic chacha library instead of crypto driver commit 28e8d89b1ce8d2e7badfb5f69971dd635acb8863 upstream. @@ -846,13 +846,13 @@ index f29bf10c0462..564a3f7b40b8 100644 SSSE3, AVX2, and AVX-512VL optimized implementations of the ChaCha20, XChaCha20, and XChaCha12 stream ciphers. -- -2.18.2 +2.18.4 -From 9872e8231411c094377e97c3e92f623205c6e7ff Mon Sep 17 00:00:00 2001 +From 52c0e077b10f891001bc79c8ce063ccc6d46f5b2 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:10 +0100 -Subject: [PATCH 004/111] crypto: x86/chacha - expose SIMD ChaCha routine as +Subject: [PATCH 004/117] crypto: x86/chacha - expose SIMD ChaCha routine as library function commit 84e03fa39fbe95a5567d43bff458c6d3b3a23ad1 upstream. @@ -1062,13 +1062,13 @@ index 5c662f8fecac..2676f4fbd4c1 100644 #define XCHACHA_IV_SIZE 32 -- -2.18.2 +2.18.4 -From 26b3eccf1b4cae251e956a7df640daf6393bc4d3 Mon Sep 17 00:00:00 2001 +From d03f16ef93414148a4f767850e973fdbc862565c Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:11 +0100 -Subject: [PATCH 005/111] crypto: arm64/chacha - depend on generic chacha +Subject: [PATCH 005/117] crypto: arm64/chacha - depend on generic chacha library instead of crypto driver commit c77da4867cbb7841177275dbb250f5c09679fae4 upstream. @@ -1199,13 +1199,13 @@ index d4cc61bfe79d..cae2cb92eca8 100644 .decrypt = xchacha_neon, } -- -2.18.2 +2.18.4 -From 14b5fac4ecdf01d965c1f43ab735ac06a2299faf Mon Sep 17 00:00:00 2001 +From 9323bf4eee0b433671e3aa6511d9fe4244fc653d Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:12 +0100 -Subject: [PATCH 006/111] crypto: arm64/chacha - expose arm64 ChaCha routine as +Subject: [PATCH 006/117] crypto: arm64/chacha - expose arm64 ChaCha routine as library function commit b3aad5bad26a01a4bd8c49a5c5f52aec665f3b7c upstream. @@ -1345,13 +1345,13 @@ index cae2cb92eca8..46cd4297761c 100644 module_init(chacha_simd_mod_init); -- -2.18.2 +2.18.4 -From 01d8a2d19bc5f75b5e8c00dd13139ff1dc915789 Mon Sep 17 00:00:00 2001 +From b857fdbbb1f25ec31d1c8f8cc5412f4ab489e7df Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:13 +0100 -Subject: [PATCH 007/111] crypto: arm/chacha - import Eric Biggers's scalar +Subject: [PATCH 007/117] crypto: arm/chacha - import Eric Biggers's scalar accelerated ChaCha code commit 29621d099f9c642b22a69dc8e7e20c108473a392 upstream. @@ -1832,13 +1832,13 @@ index 000000000000..2140319b64a0 + pop {r4-r11,pc} +ENDPROC(hchacha20_arm) -- -2.18.2 +2.18.4 -From 6d85165f03549d41259e3228ba1212d5a7a4c68e Mon Sep 17 00:00:00 2001 +From 4635c03f1686b8ada9ecd42700f82d66412d509d Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:14 +0100 -Subject: [PATCH 008/111] crypto: arm/chacha - remove dependency on generic +Subject: [PATCH 008/117] crypto: arm/chacha - remove dependency on generic ChaCha driver commit b36d8c09e710c71f6a9690b6586fea2d1c9e1e27 upstream. @@ -2541,13 +2541,13 @@ index 46cd4297761c..b08029d7bde6 100644 * * Copyright (C) 2016 - 2017 Linaro, Ltd. -- -2.18.2 +2.18.4 -From 9ae5b2c138a05d387abc3e4062a09f8064307a40 Mon Sep 17 00:00:00 2001 +From 08b87f4bde29a6bffb50c0aaa3b5acc9b9d1be1e Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:15 +0100 -Subject: [PATCH 009/111] crypto: arm/chacha - expose ARM ChaCha routine as +Subject: [PATCH 009/117] crypto: arm/chacha - expose ARM ChaCha routine as library function commit a44a3430d71bad4ee56788a59fff099b291ea54c upstream. @@ -2657,13 +2657,13 @@ index eb40efb3eb34..3f0c057aa050 100644 err = crypto_register_skciphers(neon_algs, ARRAY_SIZE(neon_algs)); -- -2.18.2 +2.18.4 -From d1597bbeb1abe97d6368467801d6aa3eedcba07a Mon Sep 17 00:00:00 2001 +From 1d0c6e6f6a9977ebac942667c6f8a3d0d36710a1 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 8 Nov 2019 13:22:16 +0100 -Subject: [PATCH 010/111] crypto: mips/chacha - import 32r2 ChaCha code from +Subject: [PATCH 010/117] crypto: mips/chacha - import 32r2 ChaCha code from Zinc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -3116,13 +3116,13 @@ index 000000000000..a81e02db95e7 +.end chacha20_mips +.set at -- -2.18.2 +2.18.4 -From 62a678a7aba7506f44e8ea2fec45a709dad8fb4a Mon Sep 17 00:00:00 2001 +From 222e72f837e62ce3e85751f973e52243832d3388 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:17 +0100 -Subject: [PATCH 011/111] crypto: mips/chacha - wire up accelerated 32r2 code +Subject: [PATCH 011/117] crypto: mips/chacha - wire up accelerated 32r2 code from Zinc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -3691,13 +3691,13 @@ index 649dc564f242..6b5e14cee475 100644 tristate "SEED cipher algorithm" select CRYPTO_ALGAPI -- -2.18.2 +2.18.4 -From e4638e0c1d51441930995140083b66817f4ad10c Mon Sep 17 00:00:00 2001 +From 88565e6edc8ecc3eb7eda65c14a8e91da2a27b9b Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:18 +0100 -Subject: [PATCH 012/111] crypto: chacha - unexport chacha_generic routines +Subject: [PATCH 012/117] crypto: chacha - unexport chacha_generic routines commit 22cf705360707ced15f9fe5423938f313c7df536 upstream. @@ -3814,13 +3814,13 @@ index c0e40b245431..aa5d4a16aac5 100644 - #endif /* _CRYPTO_CHACHA_H */ -- -2.18.2 +2.18.4 -From cb79241e8feac37fa381e6e7a6a92ee00d5e97f0 Mon Sep 17 00:00:00 2001 +From de61b50f3440e3ea5a46678a997fcd4ee88624ca Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:19 +0100 -Subject: [PATCH 013/111] crypto: poly1305 - move core routines into a separate +Subject: [PATCH 013/117] crypto: poly1305 - move core routines into a separate library commit 48ea8c6ebc96bc0990e12ee1c43d0832c23576bb upstream. @@ -4490,13 +4490,13 @@ index 000000000000..f019a57dbc1b +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Martin Willi "); -- -2.18.2 +2.18.4 -From a91c6520226129e73a042da46a68fdd1ed462b3f Mon Sep 17 00:00:00 2001 +From bc730a749174bf0429e0b186a75378db13c25cd7 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:20 +0100 -Subject: [PATCH 014/111] crypto: x86/poly1305 - unify Poly1305 state struct +Subject: [PATCH 014/117] crypto: x86/poly1305 - unify Poly1305 state struct with generic code commit ad8f5b88383ea685f2b8df2a12ee3e08089a1287 upstream. @@ -4753,13 +4753,13 @@ index f5a4319c2a1f..36b5886cb50c 100644 #endif -- -2.18.2 +2.18.4 -From e8933a8cc2291cdc5f351ba62583b19016ba7558 Mon Sep 17 00:00:00 2001 +From e9e675a106b550e653744cbe5e4e4f6845f66aba Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:21 +0100 -Subject: [PATCH 015/111] crypto: poly1305 - expose init/update/final library +Subject: [PATCH 015/117] crypto: poly1305 - expose init/update/final library interface commit a1d93064094cc5e24d64e35cf093e7191d0c9344 upstream. @@ -4990,13 +4990,13 @@ index f019a57dbc1b..32ec293c65ae 100644 MODULE_LICENSE("GPL"); MODULE_AUTHOR("Martin Willi "); -- -2.18.2 +2.18.4 -From fdfafd6a5df551a278ca3ec07f5cc909e7dba007 Mon Sep 17 00:00:00 2001 +From 93baad7ba81bf360b41969758112e5a487d55662 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:22 +0100 -Subject: [PATCH 016/111] crypto: x86/poly1305 - depend on generic library not +Subject: [PATCH 016/117] crypto: x86/poly1305 - depend on generic library not generic shash commit 1b2c6a5120489d41c8ea3b8dacd0b4586289b158 upstream. @@ -5219,13 +5219,13 @@ index 04fa269e5534..479b0cab2a1a 100644 * Poly1305 requires a unique key for each tag, which implies that we can't set * it on the tfm that gets accessed by multiple users simultaneously. Instead we -- -2.18.2 +2.18.4 -From b095e7c38359ffa613d0c18e3cc68e40d9288816 Mon Sep 17 00:00:00 2001 +From 459fb048bbcc9c07f559cbf6a37b4bb2cb14c519 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:23 +0100 -Subject: [PATCH 017/111] crypto: x86/poly1305 - expose existing driver as +Subject: [PATCH 017/117] crypto: x86/poly1305 - expose existing driver as poly1305 library commit f0e89bcfbb894e5844cd1bbf6b3cf7c63cb0f5ac upstream. @@ -5393,13 +5393,13 @@ index a731ea36bd5c..181754615f73 100644 config CRYPTO_ARCH_HAVE_LIB_POLY1305 -- -2.18.2 +2.18.4 -From a7b0cee7ad132cbe5ca7ca07c56cc012390bf367 Mon Sep 17 00:00:00 2001 +From e9816596e34dbdfd87ee1b3f9482bcc998ced2fc Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:24 +0100 -Subject: [PATCH 018/111] crypto: arm64/poly1305 - incorporate +Subject: [PATCH 018/117] crypto: arm64/poly1305 - incorporate OpenSSL/CRYPTOGAMS NEON implementation commit f569ca16475155013525686d0f73bc379c67e635 upstream. @@ -7495,13 +7495,13 @@ index 181754615f73..9923445e8225 100644 config CRYPTO_ARCH_HAVE_LIB_POLY1305 -- -2.18.2 +2.18.4 -From ce86f9037d86325458407eb786584e6302f98e5b Mon Sep 17 00:00:00 2001 +From b3af3aefd51d8f57070fee8f8074f0c537f23938 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:25 +0100 -Subject: [PATCH 019/111] crypto: arm/poly1305 - incorporate OpenSSL/CRYPTOGAMS +Subject: [PATCH 019/117] crypto: arm/poly1305 - incorporate OpenSSL/CRYPTOGAMS NEON implementation commit a6b803b3ddc793d6db0c16f12fc12d30d20fa9cc upstream. @@ -10290,13 +10290,13 @@ index 9923445e8225..9bd15b227e78 100644 config CRYPTO_ARCH_HAVE_LIB_POLY1305 -- -2.18.2 +2.18.4 -From 73b23c5b957adcda6ed1c8d7dba488d56d45719d Mon Sep 17 00:00:00 2001 +From 187998df04dbbdd4298014f8ad95477cc14b2dc8 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:26 +0100 -Subject: [PATCH 020/111] crypto: mips/poly1305 - incorporate +Subject: [PATCH 020/117] crypto: mips/poly1305 - incorporate OpenSSL/CRYPTOGAMS optimized implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -11869,13 +11869,13 @@ index 9bd15b227e78..d15ec5382986 100644 default 9 if ARM || ARM64 default 1 -- -2.18.2 +2.18.4 -From 0eb7f58b6196fee0fce5fdc0d2da5c2030b82c33 Mon Sep 17 00:00:00 2001 +From 0e008d9ec1da5489db00a542a88f89e29307ad39 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 8 Nov 2019 13:22:28 +0100 -Subject: [PATCH 021/111] crypto: blake2s - generic C library implementation +Subject: [PATCH 021/117] crypto: blake2s - generic C library implementation and selftest commit 66d7fb94e4ffe5acc589e0b2b4710aecc1f07a28 upstream. @@ -12989,13 +12989,13 @@ index 000000000000..41025a30c524 +MODULE_DESCRIPTION("BLAKE2s hash function"); +MODULE_AUTHOR("Jason A. Donenfeld "); -- -2.18.2 +2.18.4 -From 6af7e478d1106c23001e33297f3220d3e279ed95 Mon Sep 17 00:00:00 2001 +From 9f42471294df40d5298cb9f5c5d0dc39a39b25ae Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:29 +0100 -Subject: [PATCH 022/111] crypto: testmgr - add test cases for Blake2s +Subject: [PATCH 022/117] crypto: testmgr - add test cases for Blake2s commit 17e1df67023a5c9ccaeb5de8bf5b88f63127ecf7 upstream. @@ -13319,13 +13319,13 @@ index ef7d21f39d4a..102fcad54966 100644 + #endif /* _CRYPTO_TESTMGR_H */ -- -2.18.2 +2.18.4 -From 08bf11c5062fa6d1fade35a4df7d7ec4060de58c Mon Sep 17 00:00:00 2001 +From 424391960ba71b4c1489700275b1786b3679642d Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:30 +0100 -Subject: [PATCH 023/111] crypto: blake2s - implement generic shash driver +Subject: [PATCH 023/117] crypto: blake2s - implement generic shash driver commit 7f9b0880925f1f9d7d59504ea0892d2ae9cfc233 upstream. @@ -13577,13 +13577,13 @@ index 941693effc7d..74ff77032e52 100644 size_t nblocks, const u32 inc); -- -2.18.2 +2.18.4 -From 606aebe720cfafeb48102c050b4f200176b8fbd7 Mon Sep 17 00:00:00 2001 +From 338024d73271473dbada45b583fa4b1ae6ed4153 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 8 Nov 2019 13:22:31 +0100 -Subject: [PATCH 024/111] crypto: blake2s - x86_64 SIMD implementation +Subject: [PATCH 024/117] crypto: blake2s - x86_64 SIMD implementation commit ed0356eda153f6a95649e11feb7b07083caf9e20 upstream. @@ -14148,13 +14148,13 @@ index 81c8a4059afc..8fd3954bf64c 100644 tristate "CRCT10DIF algorithm" select CRYPTO_HASH -- -2.18.2 +2.18.4 -From bbd50c0a415eecea9f6043f63d65a966c201d1bc Mon Sep 17 00:00:00 2001 +From 2c61e345954094816c7b2f1acb21e04935efc2c3 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 8 Nov 2019 13:22:32 +0100 -Subject: [PATCH 025/111] crypto: curve25519 - generic C library +Subject: [PATCH 025/117] crypto: curve25519 - generic C library implementations commit 0ed42a6f431e930b2e8fae21955406e09fe75d70 upstream. @@ -16018,13 +16018,13 @@ index 000000000000..0106bebe6900 +MODULE_DESCRIPTION("Curve25519 scalar multiplication"); +MODULE_AUTHOR("Jason A. Donenfeld "); -- -2.18.2 +2.18.4 -From 38af1a26c91e3c45ab0d0296e471e088b5d82580 Mon Sep 17 00:00:00 2001 +From 02e6878712b24efce89e3abee79df1218f60d1c4 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:33 +0100 -Subject: [PATCH 026/111] crypto: curve25519 - add kpp selftest +Subject: [PATCH 026/117] crypto: curve25519 - add kpp selftest commit f613457a7af085728297bef71233c37faf3c01b1 upstream. @@ -17294,13 +17294,13 @@ index 102fcad54966..5d132ae996b4 100644 { #ifndef CONFIG_CRYPTO_FIPS -- -2.18.2 +2.18.4 -From aa7da815fcab6a235c14ec4191a11d0f1dd969f8 Mon Sep 17 00:00:00 2001 +From 3951d5b12d76eefa2a00056eed4a16243379deae Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:34 +0100 -Subject: [PATCH 027/111] crypto: curve25519 - implement generic KPP driver +Subject: [PATCH 027/117] crypto: curve25519 - implement generic KPP driver commit ee772cb641135739c1530647391d5a04c39db192 upstream. @@ -17441,13 +17441,13 @@ index 000000000000..bd88fd571393 +MODULE_ALIAS_CRYPTO("curve25519-generic"); +MODULE_LICENSE("GPL"); -- -2.18.2 +2.18.4 -From 5cbd392593fa11f939bae7f95b9763ad61962fe6 Mon Sep 17 00:00:00 2001 +From 8c6522f3a73d68c4ccef0f0850e9c34e144de042 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:35 +0100 -Subject: [PATCH 028/111] crypto: lib/curve25519 - work around Clang stack +Subject: [PATCH 028/117] crypto: lib/curve25519 - work around Clang stack spilling issue commit 660bb8e1f833ea63185fe80fde847e3e42f18e3b upstream. @@ -17522,13 +17522,13 @@ index 1c455207341d..2fde0ec33dbd 100644 unsigned i; b = 0 - b; -- -2.18.2 +2.18.4 -From ec54cbc43bda3479e5d82164bd2986e12bc09ff1 Mon Sep 17 00:00:00 2001 +From b61eb8cd17fecacf95a07d9d9cba19c05015a770 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 8 Nov 2019 13:22:36 +0100 -Subject: [PATCH 029/111] crypto: curve25519 - x86_64 library and KPP +Subject: [PATCH 029/117] crypto: curve25519 - x86_64 library and KPP implementations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -20070,13 +20070,13 @@ index a3fc859830c1..b8b738bcc312 100644 config CRYPTO_CCM -- -2.18.2 +2.18.4 -From 444a6f273657190124123d509567970e9bc02ec5 Mon Sep 17 00:00:00 2001 +From 3ad42670d1a9a760cc14405a60f0c68b6246accb Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 8 Nov 2019 13:22:37 +0100 -Subject: [PATCH 030/111] crypto: arm/curve25519 - import Bernstein and +Subject: [PATCH 030/117] crypto: arm/curve25519 - import Bernstein and Schwabe's Curve25519 ARM implementation commit f0fb006b604f98e2309a30f34ef455ac734f7c1c upstream. @@ -22212,13 +22212,13 @@ index 000000000000..f33b85fef382 + vpop {q4, q5, q6, q7} + bx lr -- -2.18.2 +2.18.4 -From 9c14e32439d17664117aff577311c6d529d3c0dd Mon Sep 17 00:00:00 2001 +From 02073ed5ab5ec53969d0b7ed3e41f070f4e61864 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 8 Nov 2019 13:22:38 +0100 -Subject: [PATCH 031/111] crypto: arm/curve25519 - wire up NEON implementation +Subject: [PATCH 031/117] crypto: arm/curve25519 - wire up NEON implementation commit d8f1308a025fc7e00414194ed742d5f05a21e13c upstream. @@ -23283,13 +23283,13 @@ index 000000000000..2e9e12d2f642 +MODULE_ALIAS_CRYPTO("curve25519-neon"); +MODULE_LICENSE("GPL v2"); -- -2.18.2 +2.18.4 -From b8003c55005c87f763b6c6a3a04610ba79d0ba07 Mon Sep 17 00:00:00 2001 +From ac04076064addfc5598008e780dd3a8777c3cec8 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:39 +0100 -Subject: [PATCH 032/111] crypto: chacha20poly1305 - import construction and +Subject: [PATCH 032/117] crypto: chacha20poly1305 - import construction and selftest from Zinc commit ed20078b7e3331e82828be357147af6a3282e4ce upstream. @@ -30977,13 +30977,13 @@ index 000000000000..c12ddbe9eb92 +MODULE_DESCRIPTION("ChaCha20Poly1305 AEAD construction"); +MODULE_AUTHOR("Jason A. Donenfeld "); -- -2.18.2 +2.18.4 -From ad1e02414b6baaf029d1ba95a1ff5b962f142c5f Mon Sep 17 00:00:00 2001 +From 11518a9a623618b7a02d621f75f341770185e44d Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Nov 2019 13:22:40 +0100 -Subject: [PATCH 033/111] crypto: lib/chacha20poly1305 - reimplement +Subject: [PATCH 033/117] crypto: lib/chacha20poly1305 - reimplement crypt_from_sg() routine commit d95312a3ccc0cd544d374be2fc45aeaa803e5fd9 upstream. @@ -31282,13 +31282,13 @@ index c12ddbe9eb92..821e5cc9b14e 100644 { if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) && -- -2.18.2 +2.18.4 -From 142a6533c36fa2289ed7c8e28cdd947100b2c5d6 Mon Sep 17 00:00:00 2001 +From 43eef635407f6e17a86aedf9302d60bf595af851 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 17 Nov 2019 23:21:29 -0800 -Subject: [PATCH 034/111] crypto: chacha_generic - remove unnecessary setkey() +Subject: [PATCH 034/117] crypto: chacha_generic - remove unnecessary setkey() functions commit 2043323a799a660bc84bbee404cf7a2617ec6157 upstream. @@ -31356,13 +31356,13 @@ index c1b147318393..8beea79ab117 100644 .decrypt = crypto_xchacha_crypt, } -- -2.18.2 +2.18.4 -From ef82f9452678441afb721aeb23bb53c3210c0f80 Mon Sep 17 00:00:00 2001 +From 3ef9f1930acdb457134a24dabfb719073d63a8be Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 17 Nov 2019 23:21:58 -0800 -Subject: [PATCH 035/111] crypto: x86/chacha - only unregister algorithms if +Subject: [PATCH 035/117] crypto: x86/chacha - only unregister algorithms if registered commit b62755aed3a3f5ca9edd2718339ccea3b6bbbe57 upstream. @@ -31394,13 +31394,13 @@ index b391e13a9e41..a94e30b6f941 100644 module_init(chacha_simd_mod_init); -- -2.18.2 +2.18.4 -From e63c6fd00d7c0b6250beae7372115f3cbf83ddb5 Mon Sep 17 00:00:00 2001 +From e01b39b5457012eb184ed3058222f0276401be12 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 17 Nov 2019 23:22:16 -0800 -Subject: [PATCH 036/111] crypto: lib/chacha20poly1305 - use chacha20_crypt() +Subject: [PATCH 036/117] crypto: lib/chacha20poly1305 - use chacha20_crypt() commit 413808b71e6204b0cc1eeaa77960f7c3cd381d33 upstream. @@ -31483,13 +31483,13 @@ index 821e5cc9b14e..6d83cafebc69 100644 partial = length; } -- -2.18.2 +2.18.4 -From 45d145f70e1cb895cb22815dfb2108b1b7b6f52f Mon Sep 17 00:00:00 2001 +From 7553c9edd4fc620058f9149d1db82dba088cff68 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 25 Nov 2019 11:31:12 +0100 -Subject: [PATCH 037/111] crypto: arch - conditionalize crypto api in arch glue +Subject: [PATCH 037/117] crypto: arch - conditionalize crypto api in arch glue for lib code commit 8394bfec51e0e565556101bcc4e2fe7551104cd8 upstream. @@ -31784,13 +31784,13 @@ index 370cd88068ec..0cc4537e6617 100644 module_init(poly1305_simd_mod_init); -- -2.18.2 +2.18.4 -From 3444a13a6fb12b49ab71dd3c9dbac0a21789ca63 Mon Sep 17 00:00:00 2001 +From 43a81baff514a4fdc89594156a520b9f86c8bfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valdis=20Kl=C4=93tnieks?= Date: Thu, 5 Dec 2019 20:58:36 -0500 -Subject: [PATCH 038/111] crypto: chacha - fix warning message in header file +Subject: [PATCH 038/117] crypto: chacha - fix warning message in header file commit 579d705cd64e44f3fcda1a6cfd5f37468a5ddf63 upstream. @@ -31825,13 +31825,13 @@ index aa5d4a16aac5..b085dc1ac151 100644 { return chacha_setkey(tfm, key, keysize, 12); -- -2.18.2 +2.18.4 -From 8da51cbbeda9be60b2e2b2052236880b33ecd6e3 Mon Sep 17 00:00:00 2001 +From ea1b43de85bc840383235c460b249d326a4ab8ad Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 11 Dec 2019 10:26:39 +0100 -Subject: [PATCH 039/111] crypto: arm/curve25519 - add arch-specific key +Subject: [PATCH 039/117] crypto: arm/curve25519 - add arch-specific key generation function commit 84faa307249b341f6ad8de3e1869d77a65e26669 upstream. @@ -31869,13 +31869,13 @@ index f3f42cf3b893..776ae07e0469 100644 unsigned int len) { -- -2.18.2 +2.18.4 -From 1f1a39f93a47971b5a909cc583fb7a4a11c28f91 Mon Sep 17 00:00:00 2001 +From fae58695a6e4bb3a22a234a3bd212c65daaf3183 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 16 Dec 2019 19:53:26 +0100 -Subject: [PATCH 040/111] crypto: lib/curve25519 - re-add selftests +Subject: [PATCH 040/117] crypto: lib/curve25519 - re-add selftests commit aa127963f1cab2b93c74c9b128a84610203fb674 upstream. @@ -33267,13 +33267,13 @@ index 0106bebe6900..c03ccdb99434 100644 MODULE_DESCRIPTION("Curve25519 scalar multiplication"); MODULE_AUTHOR("Jason A. Donenfeld "); -- -2.18.2 +2.18.4 -From 4c7f288fcf26efce71a1baad7f2eb097519b6797 Mon Sep 17 00:00:00 2001 +From 5f996db51979df92dc9ee78a1101bec85a9a04af Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 5 Jan 2020 22:40:46 -0500 -Subject: [PATCH 041/111] crypto: poly1305 - add new 32 and 64-bit generic +Subject: [PATCH 041/117] crypto: poly1305 - add new 32 and 64-bit generic versions commit 1c08a104360f3e18f4ee6346c21cc3923efb952e upstream. @@ -34462,13 +34462,13 @@ index 32ec293c65ae..9d2d14df0fee 100644 } EXPORT_SYMBOL_GPL(poly1305_final_generic); -- -2.18.2 +2.18.4 -From 9d7baa7058da6b1cb82ef52986bacc9b566a72b5 Mon Sep 17 00:00:00 2001 +From cf9813215cb5b32c82af3d478c2ccc538d006af4 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 5 Jan 2020 22:40:47 -0500 -Subject: [PATCH 042/111] crypto: x86/poly1305 - import unmodified cryptogams +Subject: [PATCH 042/117] crypto: x86/poly1305 - import unmodified cryptogams implementation commit 0896ca2a0cb6127e8a129f1f2a680d49b6b0f65c upstream. @@ -38652,13 +38652,13 @@ index 000000000000..342ad7f18aa7 +} +close STDOUT; -- -2.18.2 +2.18.4 -From 817bb9dc4136715aa625c4c97af8136b94cd2b9b Mon Sep 17 00:00:00 2001 +From a24ec3524a4acab25230f46ff6660f432419d9bc Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 5 Jan 2020 22:40:48 -0500 -Subject: [PATCH 043/111] crypto: x86/poly1305 - wire up faster implementations +Subject: [PATCH 043/117] crypto: x86/poly1305 - wire up faster implementations for kernel commit d7d7b853566254648df59f7ea27ea05952a6cfa8 upstream. @@ -41589,13 +41589,13 @@ index 0b2c4fce26d9..14c032de276e 100644 default 1 -- -2.18.2 +2.18.4 -From 53fb1d044bf5ed226e54504e4e3bf6c1c20c1026 Mon Sep 17 00:00:00 2001 +From 30fba118109bf9f9246d8fee7841e7c1a4f10512 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 5 Jan 2020 22:40:49 -0500 -Subject: [PATCH 044/111] crypto: {arm,arm64,mips}/poly1305 - remove redundant +Subject: [PATCH 044/117] crypto: {arm,arm64,mips}/poly1305 - remove redundant non-reduction from emit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -41770,13 +41770,13 @@ index b37d29cf5d0a..fc881b46d911 100644 } EXPORT_SYMBOL(poly1305_final_arch); -- -2.18.2 +2.18.4 -From 053e1885ce870a29cf558a21c59e319a3ffcf4b8 Mon Sep 17 00:00:00 2001 +From 6737f9545cacd65ae9799a645b620347ee7a51d2 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Wed, 8 Jan 2020 12:37:35 +0800 -Subject: [PATCH 045/111] crypto: curve25519 - Fix selftest build error +Subject: [PATCH 045/117] crypto: curve25519 - Fix selftest build error commit a8bdf2c42ee4d1ee42af1f3601f85de94e70a421 upstream. @@ -41883,13 +41883,13 @@ index c03ccdb99434..288a62cd29b2 100644 { if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) && -- -2.18.2 +2.18.4 -From eb414e7bf531a0a53c01d1b5be35013136120b9c Mon Sep 17 00:00:00 2001 +From e702869c233b03f1d1d767c036a03c09606419ea Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 16 Jan 2020 18:23:55 +0100 -Subject: [PATCH 046/111] crypto: x86/poly1305 - fix .gitignore typo +Subject: [PATCH 046/117] crypto: x86/poly1305 - fix .gitignore typo commit 1f6868995326cc82102049e349d8dbd116bdb656 upstream. @@ -41912,13 +41912,13 @@ index c406ea6571fa..30be0400a439 100644 -poly1305-x86_64.S +poly1305-x86_64-cryptogams.S -- -2.18.2 +2.18.4 -From a7d7e36d71f2963cd1e286cb5be322dd3b1f25ba Mon Sep 17 00:00:00 2001 +From 3dc8b37f6bcbf7e98b786c34370960d7470ba724 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 16 Jan 2020 21:26:34 +0100 -Subject: [PATCH 047/111] crypto: chacha20poly1305 - add back missing test +Subject: [PATCH 047/117] crypto: chacha20poly1305 - add back missing test vectors and test chunking commit 72c7943792c9e7788ddd182337bcf8f650cf56f5 upstream. @@ -43776,13 +43776,13 @@ index 465de46dbdef..c391a91364e9 100644 return success; } -- -2.18.2 +2.18.4 -From a8744d0d02b93347f58372088794085f1c8c2674 Mon Sep 17 00:00:00 2001 +From ce650dc24906469138236b00ef851cb7e32e84f7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 17 Jan 2020 11:42:22 +0100 -Subject: [PATCH 048/111] crypto: x86/poly1305 - emit does base conversion +Subject: [PATCH 048/117] crypto: x86/poly1305 - emit does base conversion itself commit f9e7fe32a792726186301423ff63a465d63386e1 upstream. @@ -43819,13 +43819,13 @@ index 657363588e0c..79bb58737d52 100644 } -- -2.18.2 +2.18.4 -From 72125bc90af545c0ea95d1180234ee985e1947b1 Mon Sep 17 00:00:00 2001 +From 761be588ab38a61c4b7288322750b02ddc4da2ee Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 17 Jan 2020 17:43:18 +0100 -Subject: [PATCH 049/111] crypto: arm/chacha - fix build failured when kernel +Subject: [PATCH 049/117] crypto: arm/chacha - fix build failured when kernel mode NEON is disabled commit 0bc81767c5bd9d005fae1099fb39eb3688370cb1 upstream. @@ -43883,13 +43883,13 @@ index 7bdf8823066d..893692ed12b7 100644 } else { kernel_neon_begin(); -- -2.18.2 +2.18.4 -From ce524bfa47574457f01439ad02e1cb16e3235c98 Mon Sep 17 00:00:00 2001 +From c3efcd3d0abfa6027751040d89c769bcd10e1667 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 17 Jan 2020 12:01:36 +0100 -Subject: [PATCH 050/111] crypto: Kconfig - allow tests to be disabled when +Subject: [PATCH 050/117] crypto: Kconfig - allow tests to be disabled when manager is disabled commit 2343d1529aff8b552589f622c23932035ed7a05d upstream. @@ -43929,13 +43929,13 @@ index b8b738bcc312..8fcf630471dc 100644 tristate -- -2.18.2 +2.18.4 -From 229f75b9db2ecce24734ea40184e40658d42cd57 Mon Sep 17 00:00:00 2001 +From 48681c2021772277b48acd1069157075d352f40d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 6 Feb 2020 12:42:01 +0100 -Subject: [PATCH 051/111] crypto: chacha20poly1305 - prevent integer overflow +Subject: [PATCH 051/117] crypto: chacha20poly1305 - prevent integer overflow on large input commit c9cc0517bba9f0213f1e55172feceb99e5512daf upstream. @@ -43975,13 +43975,13 @@ index 6d83cafebc69..ad0699ce702f 100644 b.iv[0] = 0; -- -2.18.2 +2.18.4 -From d16d04b184b9cd7bc8a91dec6403a433a0ac5018 Mon Sep 17 00:00:00 2001 +From c0726d01004c0f482aed8ef2bc71726ce4d327e4 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 1 Mar 2020 22:52:35 +0800 -Subject: [PATCH 052/111] crypto: x86/curve25519 - support assemblers with no +Subject: [PATCH 052/117] crypto: x86/curve25519 - support assemblers with no adx support commit 1579f1bc3b753d17a44de3457d5c6f4a5b14c752 upstream. @@ -44069,13 +44069,13 @@ index 4e6dc840b159..9ecb3c1f0f15 100644 else curve25519_generic(pub, secret, curve25519_base_point); -- -2.18.2 +2.18.4 -From 1a572ff1421939ba931b2bd05041b62b53e9e216 Mon Sep 17 00:00:00 2001 +From 589bee17e20a2ad4b8b20955ee9c970e4a377a2a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 18 Mar 2020 20:27:32 -0600 -Subject: [PATCH 053/111] crypto: arm64/chacha - correctly walk through blocks +Subject: [PATCH 053/117] crypto: arm64/chacha - correctly walk through blocks commit c8cfcb78c65877313cda7bcbace624d3dbd1f3b3 upstream. @@ -44145,13 +44145,13 @@ index c391a91364e9..fa43deda2660 100644 memset(input, 0, total_len); -- -2.18.2 +2.18.4 -From 33efbbcd684c9461aa13c3ede481ebd997295019 Mon Sep 17 00:00:00 2001 +From d9083adec8a8c5f981dcb02daf8eac99d682946b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 20 Jan 2020 18:18:15 +0100 -Subject: [PATCH 054/111] crypto: x86/curve25519 - replace with formally +Subject: [PATCH 054/117] crypto: x86/curve25519 - replace with formally verified implementation commit 07b586fe06625b0b610dc3d3a969c51913d143d4 upstream. @@ -47902,13 +47902,13 @@ index eec7d2d24239..e4e58b8e9afe 100644 MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Jason A. Donenfeld "); -- -2.18.2 +2.18.4 -From b8344fcd3bee836dc627c8d36f92579a80bca65d Mon Sep 17 00:00:00 2001 +From 6eef3f525ec5236732d20e8a1177fd8cf8cb25bb Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 1 Mar 2020 16:06:56 +0800 -Subject: [PATCH 055/111] crypto: x86/curve25519 - leave r12 as spare register +Subject: [PATCH 055/117] crypto: x86/curve25519 - leave r12 as spare register commit dc7fc3a53ae158263196b1892b672aedf67796c5 upstream. @@ -48284,13 +48284,13 @@ index e4e58b8e9afe..8a17621f7d3a 100644 } -- -2.18.2 +2.18.4 -From 86c46383822fdd1a29422968a4cc14f177ff52f6 Mon Sep 17 00:00:00 2001 +From e43146bf39f9bf1210d49fe6aefc4937f88b8a62 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 19 Mar 2020 11:56:17 -0600 -Subject: [PATCH 056/111] crypto: arm[64]/poly1305 - add artifact to .gitignore +Subject: [PATCH 056/117] crypto: arm[64]/poly1305 - add artifact to .gitignore files commit 6e4e00d8b68ca7eb30d08afb740033e0d36abe55 upstream. @@ -48328,13 +48328,13 @@ index 879df8781ed5..e403b1343328 100644 sha512-core.S +poly1305-core.S -- -2.18.2 +2.18.4 -From 7b34cc188560dd1e11f3b94381f16859216e8206 Mon Sep 17 00:00:00 2001 +From 0d3456f5b8bf4246e5f9ec45f688a6f6586a38dd Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 23 Apr 2020 15:54:04 -0600 -Subject: [PATCH 057/111] crypto: arch/lib - limit simd usage to 4k chunks +Subject: [PATCH 057/117] crypto: arch/lib - limit simd usage to 4k chunks commit 706024a52c614b478b63f7728d202532ce6591a9 upstream. @@ -48589,13 +48589,13 @@ index 79bb58737d52..61b2bc8b6986 100644 static void poly1305_simd_emit(void *ctx, u8 mac[POLY1305_DIGEST_SIZE], -- -2.18.2 +2.18.4 -From c96659dc4d1e056882851b8ef301946fdde59a1f Mon Sep 17 00:00:00 2001 +From 7b7550e61d7662fe40c6a31e0c9a131e21c2b518 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Wed, 8 Jul 2020 12:41:13 +1000 -Subject: [PATCH 058/111] crypto: lib/chacha20poly1305 - Add missing function +Subject: [PATCH 058/117] crypto: lib/chacha20poly1305 - Add missing function declaration commit 06cc2afbbdf9a9e8df3e2f8db724997dd6e1b4ac upstream. @@ -48635,13 +48635,13 @@ index ad0699ce702f..431e04280332 100644 { k[0] = get_unaligned_le32(in); -- -2.18.2 +2.18.4 -From d41126beaf21859ab04b29afd19e9d14202cb29e Mon Sep 17 00:00:00 2001 +From 46032c60e3eaf64fe98fac85e658c15137140ab1 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Wed, 8 Jul 2020 12:11:18 +0300 -Subject: [PATCH 059/111] crypto: x86/chacha-sse3 - use unaligned loads for +Subject: [PATCH 059/117] crypto: x86/chacha-sse3 - use unaligned loads for state array commit e79a31715193686e92dadb4caedfbb1f5de3659c upstream. @@ -48793,13 +48793,13 @@ index 2676f4fbd4c1..3a1c72fdb7cf 100644 /* 192-bit nonce, then 64-bit stream position */ #define XCHACHA_IV_SIZE 32 -- -2.18.2 +2.18.4 -From 303ee70fd1b5e802dff37e0a81e4c28ca998207f Mon Sep 17 00:00:00 2001 +From d187d34e30b2e271c8f1df2d4b3f64c931d970d2 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 23 Jul 2020 17:50:48 +1000 -Subject: [PATCH 060/111] crypto: x86/curve25519 - Remove unused carry +Subject: [PATCH 060/117] crypto: x86/curve25519 - Remove unused carry variables commit 054a5540fb8f7268e2c79e9deab4242db15c8cba upstream. @@ -48846,13 +48846,13 @@ index 8a17621f7d3a..8acbb6584a37 100644 f1 = f[1U]; f2 = f[2U]; -- -2.18.2 +2.18.4 -From 010a71d67061f58bc36ae7349c6f87aac46326bf Mon Sep 17 00:00:00 2001 +From 4b4f358b85ee2326462429c7769133396f3aac3b Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 24 Aug 2020 11:09:53 -0300 -Subject: [PATCH 061/111] crypto: arm/curve25519 - include +Subject: [PATCH 061/117] crypto: arm/curve25519 - include commit 6779d0e6b0fe193ab3010ea201782ca6f75a3862 upstream. @@ -48889,13 +48889,13 @@ index 776ae07e0469..31eb75b6002f 100644 asmlinkage void curve25519_neon(u8 mypublic[CURVE25519_KEY_SIZE], -- -2.18.2 +2.18.4 -From 13335bdbea0d55b2b2d2393f551997ce7ad6bf15 Mon Sep 17 00:00:00 2001 +From e1ef395778860e98d3a5bb72cb9752e4708edf4a Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 25 Aug 2020 11:23:00 +1000 -Subject: [PATCH 062/111] crypto: arm/poly1305 - Add prototype for +Subject: [PATCH 062/117] crypto: arm/poly1305 - Add prototype for poly1305_blocks_neon commit 51982ea02aef972132eb35c583d3e4c5b83166e5 upstream. @@ -48929,13 +48929,13 @@ index 13cfef4ae22e..3023c1acfa19 100644 void __weak poly1305_blocks_neon(void *state, const u8 *src, u32 len, u32 hibit) -- -2.18.2 +2.18.4 -From ed226e02d6d925659250beac5e1b94689df046bd Mon Sep 17 00:00:00 2001 +From 9cae67a1eae75350c36e399f47b9a73d9d3633fe Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 27 Aug 2020 19:30:58 +0200 -Subject: [PATCH 063/111] crypto: curve25519-x86_64 - Use XORL r32,32 +Subject: [PATCH 063/117] crypto: curve25519-x86_64 - Use XORL r32,32 commit db719539fd3889836900bf912755aa30a5985e9a upstream. @@ -49196,13 +49196,13 @@ index 8acbb6584a37..a9edb6f8a0ba 100644 " mulxq 104(%1), %%r9, %%rbx;" " adcx %%r13, %%r9;" -- -2.18.2 +2.18.4 -From 5e15835b8473c841abfe7a8540e2994d4d0f1a66 Mon Sep 17 00:00:00 2001 +From 6f0e39358e26838078348467159fe1c87ba52761 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 27 Aug 2020 19:38:31 +0200 -Subject: [PATCH 064/111] crypto: poly1305-x86_64 - Use XORL r32,32 +Subject: [PATCH 064/117] crypto: poly1305-x86_64 - Use XORL r32,32 commit 7dfd1e01b3dfc13431b1b25720cf2692a7e111ef upstream. @@ -49261,13 +49261,737 @@ index 80061bea6b16..5b593990501d 100644 mov 0(%rsi),%r8 # arg3, disp->ControlPc mov 16(%rsi),%r9 # arg4, disp->FunctionEntry -- -2.18.2 +2.18.4 -From 1ed9bf88b9cfa8eb51a5450f04a38aebee733963 Mon Sep 17 00:00:00 2001 +From 2482cf2431216e859c36dcd145d2c6bbcef81062 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 24 Sep 2020 13:29:04 +1000 +Subject: [PATCH 065/117] crypto: x86/poly1305 - Remove assignments with no + effect + +commit 4a0c1de64bf9d9027a6f19adfba89fc27893db23 upstream. + +This patch removes a few ineffectual assignments from the function +crypto_poly1305_setdctxkey. + +Reported-by: kernel test robot +Signed-off-by: Herbert Xu +Signed-off-by: Jason A. Donenfeld +--- + arch/x86/crypto/poly1305_glue.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/arch/x86/crypto/poly1305_glue.c b/arch/x86/crypto/poly1305_glue.c +index 61b2bc8b6986..7de5046fe583 100644 +--- a/arch/x86/crypto/poly1305_glue.c ++++ b/arch/x86/crypto/poly1305_glue.c +@@ -157,9 +157,6 @@ static unsigned int crypto_poly1305_setdctxkey(struct poly1305_desc_ctx *dctx, + dctx->s[1] = get_unaligned_le32(&inp[4]); + dctx->s[2] = get_unaligned_le32(&inp[8]); + dctx->s[3] = get_unaligned_le32(&inp[12]); +- inp += POLY1305_BLOCK_SIZE; +- len -= POLY1305_BLOCK_SIZE; +- acc += POLY1305_BLOCK_SIZE; + dctx->sset = true; + } + } +-- +2.18.4 + + +From 4e551d7df6818bbe788c01da7d2c6a3af0c2f5c5 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Fri, 23 Oct 2020 15:27:48 -0700 +Subject: [PATCH 066/117] crypto: x86/poly1305 - add back a needed assignment + +commit c3a98c3ad5c0dc60a1ac66bf91147a3f39cac96b upstream. + +One of the assignments that was removed by commit 4a0c1de64bf9 ("crypto: +x86/poly1305 - Remove assignments with no effect") is actually needed, +since it affects the return value. + +This fixes the following crypto self-test failure: + + alg: shash: poly1305-simd test failed (wrong result) on test vector 2, cfg="init+update+final aligned buffer" + +Fixes: 4a0c1de64bf9 ("crypto: x86/poly1305 - Remove assignments with no effect") +Signed-off-by: Eric Biggers +Signed-off-by: Herbert Xu +Signed-off-by: Jason A. Donenfeld +--- + arch/x86/crypto/poly1305_glue.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/crypto/poly1305_glue.c b/arch/x86/crypto/poly1305_glue.c +index 7de5046fe583..b69e362730d0 100644 +--- a/arch/x86/crypto/poly1305_glue.c ++++ b/arch/x86/crypto/poly1305_glue.c +@@ -157,6 +157,7 @@ static unsigned int crypto_poly1305_setdctxkey(struct poly1305_desc_ctx *dctx, + dctx->s[1] = get_unaligned_le32(&inp[4]); + dctx->s[2] = get_unaligned_le32(&inp[8]); + dctx->s[3] = get_unaligned_le32(&inp[12]); ++ acc += POLY1305_BLOCK_SIZE; + dctx->sset = true; + } + } +-- +2.18.4 + + +From 6a36f18ecb9d1454314a5d8860f82906ca3e5188 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Mon, 2 Nov 2020 14:48:15 +0100 +Subject: [PATCH 067/117] crypto: Kconfig - CRYPTO_MANAGER_EXTRA_TESTS requires + the manager + +commit 6569e3097f1c4a490bdf2b23d326855e04942dfd upstream. + +The extra tests in the manager actually require the manager to be +selected too. Otherwise the linker gives errors like: + +ld: arch/x86/crypto/chacha_glue.o: in function `chacha_simd_stream_xor': +chacha_glue.c:(.text+0x422): undefined reference to `crypto_simd_disabled_for_test' + +Fixes: 2343d1529aff ("crypto: Kconfig - allow tests to be disabled when manager is disabled") +Signed-off-by: Jason A. Donenfeld +Signed-off-by: Herbert Xu +Signed-off-by: Jason A. Donenfeld +--- + crypto/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/crypto/Kconfig b/crypto/Kconfig +index 8fcf630471dc..fd5a8724ed38 100644 +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -145,7 +145,7 @@ config CRYPTO_MANAGER_DISABLE_TESTS + + config CRYPTO_MANAGER_EXTRA_TESTS + bool "Enable extra run-time crypto self tests" +- depends on DEBUG_KERNEL && !CRYPTO_MANAGER_DISABLE_TESTS ++ depends on DEBUG_KERNEL && !CRYPTO_MANAGER_DISABLE_TESTS && CRYPTO_MANAGER + help + Enable extra run-time self tests of registered crypto algorithms, + including randomized fuzz tests. +-- +2.18.4 + + +From d847e1ea725d22908f4e1e8b723205939d3a947a Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Tue, 3 Nov 2020 17:28:09 +0100 +Subject: [PATCH 068/117] crypto: arm/chacha-neon - optimize for non-block size + multiples + +commit 86cd97ec4b943af35562a74688bc4e909b32c3d1 upstream. + +The current NEON based ChaCha implementation for ARM is optimized for +multiples of 4x the ChaCha block size (64 bytes). This makes sense for +block encryption, but given that ChaCha is also often used in the +context of networking, it makes sense to consider arbitrary length +inputs as well. + +For example, WireGuard typically uses 1420 byte packets, and performing +ChaCha encryption involves 5 invocations of chacha_4block_xor_neon() +and 3 invocations of chacha_block_xor_neon(), where the last one also +involves a memcpy() using a buffer on the stack to process the final +chunk of 1420 % 64 == 12 bytes. + +Let's optimize for this case as well, by letting chacha_4block_xor_neon() +deal with any input size between 64 and 256 bytes, using NEON permutation +instructions and overlapping loads and stores. This way, the 140 byte +tail of a 1420 byte input buffer can simply be processed in one go. + +This results in the following performance improvements for 1420 byte +blocks, without significant impact on power-of-2 input sizes. (Note +that Raspberry Pi is widely used in combination with a 32-bit kernel, +even though the core is 64-bit capable) + + Cortex-A8 (BeagleBone) : 7% + Cortex-A15 (Calxeda Midway) : 21% + Cortex-A53 (Raspberry Pi 3) : 3% + Cortex-A72 (Raspberry Pi 4) : 19% + +Cc: Eric Biggers +Cc: "Jason A . Donenfeld" +Signed-off-by: Ard Biesheuvel +Signed-off-by: Herbert Xu +Signed-off-by: Jason A. Donenfeld +--- + arch/arm/crypto/chacha-glue.c | 34 +++++------ + arch/arm/crypto/chacha-neon-core.S | 97 +++++++++++++++++++++++++++--- + 2 files changed, 107 insertions(+), 24 deletions(-) + +diff --git a/arch/arm/crypto/chacha-glue.c b/arch/arm/crypto/chacha-glue.c +index cd131b454c2e..f603184dc0f5 100644 +--- a/arch/arm/crypto/chacha-glue.c ++++ b/arch/arm/crypto/chacha-glue.c +@@ -23,7 +23,7 @@ + asmlinkage void chacha_block_xor_neon(const u32 *state, u8 *dst, const u8 *src, + int nrounds); + asmlinkage void chacha_4block_xor_neon(const u32 *state, u8 *dst, const u8 *src, +- int nrounds); ++ int nrounds, unsigned int nbytes); + asmlinkage void hchacha_block_arm(const u32 *state, u32 *out, int nrounds); + asmlinkage void hchacha_block_neon(const u32 *state, u32 *out, int nrounds); + +@@ -42,24 +42,24 @@ static void chacha_doneon(u32 *state, u8 *dst, const u8 *src, + { + u8 buf[CHACHA_BLOCK_SIZE]; + +- while (bytes >= CHACHA_BLOCK_SIZE * 4) { +- chacha_4block_xor_neon(state, dst, src, nrounds); +- bytes -= CHACHA_BLOCK_SIZE * 4; +- src += CHACHA_BLOCK_SIZE * 4; +- dst += CHACHA_BLOCK_SIZE * 4; +- state[12] += 4; +- } +- while (bytes >= CHACHA_BLOCK_SIZE) { +- chacha_block_xor_neon(state, dst, src, nrounds); +- bytes -= CHACHA_BLOCK_SIZE; +- src += CHACHA_BLOCK_SIZE; +- dst += CHACHA_BLOCK_SIZE; +- state[12]++; ++ while (bytes > CHACHA_BLOCK_SIZE) { ++ unsigned int l = min(bytes, CHACHA_BLOCK_SIZE * 4U); ++ ++ chacha_4block_xor_neon(state, dst, src, nrounds, l); ++ bytes -= l; ++ src += l; ++ dst += l; ++ state[12] += DIV_ROUND_UP(l, CHACHA_BLOCK_SIZE); + } + if (bytes) { +- memcpy(buf, src, bytes); +- chacha_block_xor_neon(state, buf, buf, nrounds); +- memcpy(dst, buf, bytes); ++ const u8 *s = src; ++ u8 *d = dst; ++ ++ if (bytes != CHACHA_BLOCK_SIZE) ++ s = d = memcpy(buf, src, bytes); ++ chacha_block_xor_neon(state, d, s, nrounds); ++ if (d != dst) ++ memcpy(dst, buf, bytes); + } + } + +diff --git a/arch/arm/crypto/chacha-neon-core.S b/arch/arm/crypto/chacha-neon-core.S +index eb22926d4912..13d12f672656 100644 +--- a/arch/arm/crypto/chacha-neon-core.S ++++ b/arch/arm/crypto/chacha-neon-core.S +@@ -47,6 +47,7 @@ + */ + + #include ++#include + + .text + .fpu neon +@@ -205,7 +206,7 @@ ENDPROC(hchacha_block_neon) + + .align 5 + ENTRY(chacha_4block_xor_neon) +- push {r4-r5} ++ push {r4, lr} + mov r4, sp // preserve the stack pointer + sub ip, sp, #0x20 // allocate a 32 byte buffer + bic ip, ip, #0x1f // aligned to 32 bytes +@@ -229,10 +230,10 @@ ENTRY(chacha_4block_xor_neon) + vld1.32 {q0-q1}, [r0] + vld1.32 {q2-q3}, [ip] + +- adr r5, .Lctrinc ++ adr lr, .Lctrinc + vdup.32 q15, d7[1] + vdup.32 q14, d7[0] +- vld1.32 {q4}, [r5, :128] ++ vld1.32 {q4}, [lr, :128] + vdup.32 q13, d6[1] + vdup.32 q12, d6[0] + vdup.32 q11, d5[1] +@@ -455,7 +456,7 @@ ENTRY(chacha_4block_xor_neon) + + // Re-interleave the words in the first two rows of each block (x0..7). + // Also add the counter values 0-3 to x12[0-3]. +- vld1.32 {q8}, [r5, :128] // load counter values 0-3 ++ vld1.32 {q8}, [lr, :128] // load counter values 0-3 + vzip.32 q0, q1 // => (0 1 0 1) (0 1 0 1) + vzip.32 q2, q3 // => (2 3 2 3) (2 3 2 3) + vzip.32 q4, q5 // => (4 5 4 5) (4 5 4 5) +@@ -493,6 +494,8 @@ ENTRY(chacha_4block_xor_neon) + + // Re-interleave the words in the last two rows of each block (x8..15). + vld1.32 {q8-q9}, [sp, :256] ++ mov sp, r4 // restore original stack pointer ++ ldr r4, [r4, #8] // load number of bytes + vzip.32 q12, q13 // => (12 13 12 13) (12 13 12 13) + vzip.32 q14, q15 // => (14 15 14 15) (14 15 14 15) + vzip.32 q8, q9 // => (8 9 8 9) (8 9 8 9) +@@ -520,41 +523,121 @@ ENTRY(chacha_4block_xor_neon) + // XOR the rest of the data with the keystream + + vld1.8 {q0-q1}, [r2]! ++ subs r4, r4, #96 + veor q0, q0, q8 + veor q1, q1, q12 ++ ble .Lle96 + vst1.8 {q0-q1}, [r1]! + + vld1.8 {q0-q1}, [r2]! ++ subs r4, r4, #32 + veor q0, q0, q2 + veor q1, q1, q6 ++ ble .Lle128 + vst1.8 {q0-q1}, [r1]! + + vld1.8 {q0-q1}, [r2]! ++ subs r4, r4, #32 + veor q0, q0, q10 + veor q1, q1, q14 ++ ble .Lle160 + vst1.8 {q0-q1}, [r1]! + + vld1.8 {q0-q1}, [r2]! ++ subs r4, r4, #32 + veor q0, q0, q4 + veor q1, q1, q5 ++ ble .Lle192 + vst1.8 {q0-q1}, [r1]! + + vld1.8 {q0-q1}, [r2]! ++ subs r4, r4, #32 + veor q0, q0, q9 + veor q1, q1, q13 ++ ble .Lle224 + vst1.8 {q0-q1}, [r1]! + + vld1.8 {q0-q1}, [r2]! ++ subs r4, r4, #32 + veor q0, q0, q3 + veor q1, q1, q7 ++ blt .Llt256 ++.Lout: + vst1.8 {q0-q1}, [r1]! + + vld1.8 {q0-q1}, [r2] +- mov sp, r4 // restore original stack pointer + veor q0, q0, q11 + veor q1, q1, q15 + vst1.8 {q0-q1}, [r1] + +- pop {r4-r5} +- bx lr ++ pop {r4, pc} ++ ++.Lle192: ++ vmov q4, q9 ++ vmov q5, q13 ++ ++.Lle160: ++ // nothing to do ++ ++.Lfinalblock: ++ // Process the final block if processing less than 4 full blocks. ++ // Entered with 32 bytes of ChaCha cipher stream in q4-q5, and the ++ // previous 32 byte output block that still needs to be written at ++ // [r1] in q0-q1. ++ beq .Lfullblock ++ ++.Lpartialblock: ++ adr lr, .Lpermute + 32 ++ add r2, r2, r4 ++ add lr, lr, r4 ++ add r4, r4, r1 ++ ++ vld1.8 {q2-q3}, [lr] ++ vld1.8 {q6-q7}, [r2] ++ ++ add r4, r4, #32 ++ ++ vtbl.8 d4, {q4-q5}, d4 ++ vtbl.8 d5, {q4-q5}, d5 ++ vtbl.8 d6, {q4-q5}, d6 ++ vtbl.8 d7, {q4-q5}, d7 ++ ++ veor q6, q6, q2 ++ veor q7, q7, q3 ++ ++ vst1.8 {q6-q7}, [r4] // overlapping stores ++ vst1.8 {q0-q1}, [r1] ++ pop {r4, pc} ++ ++.Lfullblock: ++ vmov q11, q4 ++ vmov q15, q5 ++ b .Lout ++.Lle96: ++ vmov q4, q2 ++ vmov q5, q6 ++ b .Lfinalblock ++.Lle128: ++ vmov q4, q10 ++ vmov q5, q14 ++ b .Lfinalblock ++.Lle224: ++ vmov q4, q3 ++ vmov q5, q7 ++ b .Lfinalblock ++.Llt256: ++ vmov q4, q11 ++ vmov q5, q15 ++ b .Lpartialblock + ENDPROC(chacha_4block_xor_neon) ++ ++ .align L1_CACHE_SHIFT ++.Lpermute: ++ .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 ++ .byte 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f ++ .byte 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 ++ .byte 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f ++ .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 ++ .byte 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f ++ .byte 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 ++ .byte 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f +-- +2.18.4 + + +From c5520fdf42a2d4f06ae977e2f6da1216b73a180a Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Fri, 6 Nov 2020 17:39:38 +0100 +Subject: [PATCH 069/117] crypto: arm64/chacha - simplify tail block handling + +commit c4fc6328d6c67690a7e6e03f43a5a976a13120ef upstream. + +Based on lessons learnt from optimizing the 32-bit version of this driver, +we can simplify the arm64 version considerably, by reordering the final +two stores when the last block is not a multiple of 64 bytes. This removes +the need to use permutation instructions to calculate the elements that are +clobbered by the final overlapping store, given that the store of the +penultimate block now follows it, and that one carries the correct values +for those elements already. + +While at it, simplify the overlapping loads as well, by calculating the +address of the final overlapping load upfront, and switching to this +address for every load that would otherwise extend past the end of the +source buffer. + +There is no impact on performance, but the resulting code is substantially +smaller and easier to follow. + +Cc: Eric Biggers +Cc: "Jason A . Donenfeld" +Signed-off-by: Ard Biesheuvel +Signed-off-by: Herbert Xu +Signed-off-by: Jason A. Donenfeld +--- + arch/arm64/crypto/chacha-neon-core.S | 193 ++++++++++----------------- + 1 file changed, 69 insertions(+), 124 deletions(-) + +diff --git a/arch/arm64/crypto/chacha-neon-core.S b/arch/arm64/crypto/chacha-neon-core.S +index 706c4e10e9e2..50d9dd173be7 100644 +--- a/arch/arm64/crypto/chacha-neon-core.S ++++ b/arch/arm64/crypto/chacha-neon-core.S +@@ -195,7 +195,6 @@ ENTRY(chacha_4block_xor_neon) + adr_l x10, .Lpermute + and x5, x4, #63 + add x10, x10, x5 +- add x11, x10, #64 + + // + // This function encrypts four consecutive ChaCha blocks by loading +@@ -645,11 +644,11 @@ CPU_BE( rev a15, a15 ) + zip2 v31.4s, v14.4s, v15.4s + eor a15, a15, w9 + +- mov x3, #64 ++ add x3, x2, x4 ++ sub x3, x3, #128 // start of last block ++ + subs x5, x4, #128 +- add x6, x5, x2 +- csel x3, x3, xzr, ge +- csel x2, x2, x6, ge ++ csel x2, x2, x3, ge + + // interleave 64-bit words in state n, n+2 + zip1 v0.2d, v16.2d, v18.2d +@@ -658,13 +657,10 @@ CPU_BE( rev a15, a15 ) + zip1 v8.2d, v17.2d, v19.2d + zip2 v12.2d, v17.2d, v19.2d + stp a2, a3, [x1, #-56] +- ld1 {v16.16b-v19.16b}, [x2], x3 + + subs x6, x4, #192 +- ccmp x3, xzr, #4, lt +- add x7, x6, x2 +- csel x3, x3, xzr, eq +- csel x2, x2, x7, eq ++ ld1 {v16.16b-v19.16b}, [x2], #64 ++ csel x2, x2, x3, ge + + zip1 v1.2d, v20.2d, v22.2d + zip2 v5.2d, v20.2d, v22.2d +@@ -672,13 +668,10 @@ CPU_BE( rev a15, a15 ) + zip1 v9.2d, v21.2d, v23.2d + zip2 v13.2d, v21.2d, v23.2d + stp a6, a7, [x1, #-40] +- ld1 {v20.16b-v23.16b}, [x2], x3 + + subs x7, x4, #256 +- ccmp x3, xzr, #4, lt +- add x8, x7, x2 +- csel x3, x3, xzr, eq +- csel x2, x2, x8, eq ++ ld1 {v20.16b-v23.16b}, [x2], #64 ++ csel x2, x2, x3, ge + + zip1 v2.2d, v24.2d, v26.2d + zip2 v6.2d, v24.2d, v26.2d +@@ -686,12 +679,10 @@ CPU_BE( rev a15, a15 ) + zip1 v10.2d, v25.2d, v27.2d + zip2 v14.2d, v25.2d, v27.2d + stp a10, a11, [x1, #-24] +- ld1 {v24.16b-v27.16b}, [x2], x3 + + subs x8, x4, #320 +- ccmp x3, xzr, #4, lt +- add x9, x8, x2 +- csel x2, x2, x9, eq ++ ld1 {v24.16b-v27.16b}, [x2], #64 ++ csel x2, x2, x3, ge + + zip1 v3.2d, v28.2d, v30.2d + zip2 v7.2d, v28.2d, v30.2d +@@ -699,151 +690,105 @@ CPU_BE( rev a15, a15 ) + zip1 v11.2d, v29.2d, v31.2d + zip2 v15.2d, v29.2d, v31.2d + stp a14, a15, [x1, #-8] ++ ++ tbnz x5, #63, .Lt128 + ld1 {v28.16b-v31.16b}, [x2] + + // xor with corresponding input, write to output +- tbnz x5, #63, 0f + eor v16.16b, v16.16b, v0.16b + eor v17.16b, v17.16b, v1.16b + eor v18.16b, v18.16b, v2.16b + eor v19.16b, v19.16b, v3.16b +- st1 {v16.16b-v19.16b}, [x1], #64 +- cbz x5, .Lout + +- tbnz x6, #63, 1f ++ tbnz x6, #63, .Lt192 ++ + eor v20.16b, v20.16b, v4.16b + eor v21.16b, v21.16b, v5.16b + eor v22.16b, v22.16b, v6.16b + eor v23.16b, v23.16b, v7.16b +- st1 {v20.16b-v23.16b}, [x1], #64 +- cbz x6, .Lout + +- tbnz x7, #63, 2f ++ st1 {v16.16b-v19.16b}, [x1], #64 ++ tbnz x7, #63, .Lt256 ++ + eor v24.16b, v24.16b, v8.16b + eor v25.16b, v25.16b, v9.16b + eor v26.16b, v26.16b, v10.16b + eor v27.16b, v27.16b, v11.16b +- st1 {v24.16b-v27.16b}, [x1], #64 +- cbz x7, .Lout + +- tbnz x8, #63, 3f ++ st1 {v20.16b-v23.16b}, [x1], #64 ++ tbnz x8, #63, .Lt320 ++ + eor v28.16b, v28.16b, v12.16b + eor v29.16b, v29.16b, v13.16b + eor v30.16b, v30.16b, v14.16b + eor v31.16b, v31.16b, v15.16b ++ ++ st1 {v24.16b-v27.16b}, [x1], #64 + st1 {v28.16b-v31.16b}, [x1] + + .Lout: frame_pop + ret + +- // fewer than 128 bytes of in/output +-0: ld1 {v8.16b}, [x10] +- ld1 {v9.16b}, [x11] +- movi v10.16b, #16 +- sub x2, x1, #64 +- add x1, x1, x5 +- ld1 {v16.16b-v19.16b}, [x2] +- tbl v4.16b, {v0.16b-v3.16b}, v8.16b +- tbx v20.16b, {v16.16b-v19.16b}, v9.16b +- add v8.16b, v8.16b, v10.16b +- add v9.16b, v9.16b, v10.16b +- tbl v5.16b, {v0.16b-v3.16b}, v8.16b +- tbx v21.16b, {v16.16b-v19.16b}, v9.16b +- add v8.16b, v8.16b, v10.16b +- add v9.16b, v9.16b, v10.16b +- tbl v6.16b, {v0.16b-v3.16b}, v8.16b +- tbx v22.16b, {v16.16b-v19.16b}, v9.16b +- add v8.16b, v8.16b, v10.16b +- add v9.16b, v9.16b, v10.16b +- tbl v7.16b, {v0.16b-v3.16b}, v8.16b +- tbx v23.16b, {v16.16b-v19.16b}, v9.16b +- +- eor v20.16b, v20.16b, v4.16b +- eor v21.16b, v21.16b, v5.16b +- eor v22.16b, v22.16b, v6.16b +- eor v23.16b, v23.16b, v7.16b +- st1 {v20.16b-v23.16b}, [x1] +- b .Lout +- + // fewer than 192 bytes of in/output +-1: ld1 {v8.16b}, [x10] +- ld1 {v9.16b}, [x11] +- movi v10.16b, #16 +- add x1, x1, x6 +- tbl v0.16b, {v4.16b-v7.16b}, v8.16b +- tbx v20.16b, {v16.16b-v19.16b}, v9.16b +- add v8.16b, v8.16b, v10.16b +- add v9.16b, v9.16b, v10.16b +- tbl v1.16b, {v4.16b-v7.16b}, v8.16b +- tbx v21.16b, {v16.16b-v19.16b}, v9.16b +- add v8.16b, v8.16b, v10.16b +- add v9.16b, v9.16b, v10.16b +- tbl v2.16b, {v4.16b-v7.16b}, v8.16b +- tbx v22.16b, {v16.16b-v19.16b}, v9.16b +- add v8.16b, v8.16b, v10.16b +- add v9.16b, v9.16b, v10.16b +- tbl v3.16b, {v4.16b-v7.16b}, v8.16b +- tbx v23.16b, {v16.16b-v19.16b}, v9.16b +- +- eor v20.16b, v20.16b, v0.16b +- eor v21.16b, v21.16b, v1.16b +- eor v22.16b, v22.16b, v2.16b +- eor v23.16b, v23.16b, v3.16b +- st1 {v20.16b-v23.16b}, [x1] ++.Lt192: cbz x5, 1f // exactly 128 bytes? ++ ld1 {v28.16b-v31.16b}, [x10] ++ add x5, x5, x1 ++ tbl v28.16b, {v4.16b-v7.16b}, v28.16b ++ tbl v29.16b, {v4.16b-v7.16b}, v29.16b ++ tbl v30.16b, {v4.16b-v7.16b}, v30.16b ++ tbl v31.16b, {v4.16b-v7.16b}, v31.16b ++ ++0: eor v20.16b, v20.16b, v28.16b ++ eor v21.16b, v21.16b, v29.16b ++ eor v22.16b, v22.16b, v30.16b ++ eor v23.16b, v23.16b, v31.16b ++ st1 {v20.16b-v23.16b}, [x5] // overlapping stores ++1: st1 {v16.16b-v19.16b}, [x1] + b .Lout + ++ // fewer than 128 bytes of in/output ++.Lt128: ld1 {v28.16b-v31.16b}, [x10] ++ add x5, x5, x1 ++ sub x1, x1, #64 ++ tbl v28.16b, {v0.16b-v3.16b}, v28.16b ++ tbl v29.16b, {v0.16b-v3.16b}, v29.16b ++ tbl v30.16b, {v0.16b-v3.16b}, v30.16b ++ tbl v31.16b, {v0.16b-v3.16b}, v31.16b ++ ld1 {v16.16b-v19.16b}, [x1] // reload first output block ++ b 0b ++ + // fewer than 256 bytes of in/output +-2: ld1 {v4.16b}, [x10] +- ld1 {v5.16b}, [x11] +- movi v6.16b, #16 +- add x1, x1, x7 ++.Lt256: cbz x6, 2f // exactly 192 bytes? ++ ld1 {v4.16b-v7.16b}, [x10] ++ add x6, x6, x1 + tbl v0.16b, {v8.16b-v11.16b}, v4.16b +- tbx v24.16b, {v20.16b-v23.16b}, v5.16b +- add v4.16b, v4.16b, v6.16b +- add v5.16b, v5.16b, v6.16b +- tbl v1.16b, {v8.16b-v11.16b}, v4.16b +- tbx v25.16b, {v20.16b-v23.16b}, v5.16b +- add v4.16b, v4.16b, v6.16b +- add v5.16b, v5.16b, v6.16b +- tbl v2.16b, {v8.16b-v11.16b}, v4.16b +- tbx v26.16b, {v20.16b-v23.16b}, v5.16b +- add v4.16b, v4.16b, v6.16b +- add v5.16b, v5.16b, v6.16b +- tbl v3.16b, {v8.16b-v11.16b}, v4.16b +- tbx v27.16b, {v20.16b-v23.16b}, v5.16b +- +- eor v24.16b, v24.16b, v0.16b +- eor v25.16b, v25.16b, v1.16b +- eor v26.16b, v26.16b, v2.16b +- eor v27.16b, v27.16b, v3.16b +- st1 {v24.16b-v27.16b}, [x1] ++ tbl v1.16b, {v8.16b-v11.16b}, v5.16b ++ tbl v2.16b, {v8.16b-v11.16b}, v6.16b ++ tbl v3.16b, {v8.16b-v11.16b}, v7.16b ++ ++ eor v28.16b, v28.16b, v0.16b ++ eor v29.16b, v29.16b, v1.16b ++ eor v30.16b, v30.16b, v2.16b ++ eor v31.16b, v31.16b, v3.16b ++ st1 {v28.16b-v31.16b}, [x6] // overlapping stores ++2: st1 {v20.16b-v23.16b}, [x1] + b .Lout + + // fewer than 320 bytes of in/output +-3: ld1 {v4.16b}, [x10] +- ld1 {v5.16b}, [x11] +- movi v6.16b, #16 +- add x1, x1, x8 ++.Lt320: cbz x7, 3f // exactly 256 bytes? ++ ld1 {v4.16b-v7.16b}, [x10] ++ add x7, x7, x1 + tbl v0.16b, {v12.16b-v15.16b}, v4.16b +- tbx v28.16b, {v24.16b-v27.16b}, v5.16b +- add v4.16b, v4.16b, v6.16b +- add v5.16b, v5.16b, v6.16b +- tbl v1.16b, {v12.16b-v15.16b}, v4.16b +- tbx v29.16b, {v24.16b-v27.16b}, v5.16b +- add v4.16b, v4.16b, v6.16b +- add v5.16b, v5.16b, v6.16b +- tbl v2.16b, {v12.16b-v15.16b}, v4.16b +- tbx v30.16b, {v24.16b-v27.16b}, v5.16b +- add v4.16b, v4.16b, v6.16b +- add v5.16b, v5.16b, v6.16b +- tbl v3.16b, {v12.16b-v15.16b}, v4.16b +- tbx v31.16b, {v24.16b-v27.16b}, v5.16b ++ tbl v1.16b, {v12.16b-v15.16b}, v5.16b ++ tbl v2.16b, {v12.16b-v15.16b}, v6.16b ++ tbl v3.16b, {v12.16b-v15.16b}, v7.16b + + eor v28.16b, v28.16b, v0.16b + eor v29.16b, v29.16b, v1.16b + eor v30.16b, v30.16b, v2.16b + eor v31.16b, v31.16b, v3.16b +- st1 {v28.16b-v31.16b}, [x1] ++ st1 {v28.16b-v31.16b}, [x7] // overlapping stores ++3: st1 {v24.16b-v27.16b}, [x1] + b .Lout + ENDPROC(chacha_4block_xor_neon) + +@@ -851,7 +796,7 @@ ENDPROC(chacha_4block_xor_neon) + .align L1_CACHE_SHIFT + .Lpermute: + .set .Li, 0 +- .rept 192 ++ .rept 128 + .byte (.Li - 64) + .set .Li, .Li + 1 + .endr +-- +2.18.4 + + +From c896750facb1b60386a2db00930d4f493bf3f9f3 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 11 Feb 2020 20:47:05 +0100 -Subject: [PATCH 065/111] icmp: introduce helper for nat'd source address in +Subject: [PATCH 070/117] icmp: introduce helper for nat'd source address in network device context commit 0b41713b606694257b90d61ba7e2712d8457648b upstream. @@ -49334,10 +50058,10 @@ index 5d4bfdba9adf..9ac2d2672a93 100644 int icmp_err(struct sk_buff *skb, u32 info); int icmp_init(void); diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c -index 73f46cb5e51d..2721e1774e2f 100644 +index d00533aea1f0..5b7717da168d 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c -@@ -747,6 +747,39 @@ out:; +@@ -750,6 +750,39 @@ out:; } EXPORT_SYMBOL(__icmp_send); @@ -49421,13 +50145,13 @@ index 02045494c24c..e0086758b6ee 100644 +#endif #endif -- -2.18.2 +2.18.4 -From 55f44ac0d7ef3d9fe23b66ee91568edcfd0a687c Mon Sep 17 00:00:00 2001 +From d3f3014bf616f4cfadddad719c5fed79c3995612 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 9 Dec 2019 00:27:34 +0100 -Subject: [PATCH 066/111] net: WireGuard secure network tunnel +Subject: [PATCH 071/117] net: WireGuard secure network tunnel commit e7096c131e5161fa3b8e52a650d7719d2857adfd upstream. @@ -57608,13 +58332,13 @@ index 000000000000..e7310d9390f7 +[[ $alldeleted -eq 1 ]] +pretty "" "Objects that were created were also destroyed." -- -2.18.2 +2.18.4 -From 77c9e153f9f0df7f589a9c41b228137eac8a8752 Mon Sep 17 00:00:00 2001 +From ff03dd85c86a85e0a5e0b66cf35d50aa8bdf9e10 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 15 Dec 2019 22:08:00 +0100 -Subject: [PATCH 067/111] wireguard: selftests: import harness makefile for +Subject: [PATCH 072/117] wireguard: selftests: import harness makefile for test suite commit 65d88d04114bca7d85faebd5fed61069cb2b632c upstream. @@ -58745,13 +59469,13 @@ index 000000000000..9cca30206014 +CONFIG_WIREGUARD=y +CONFIG_WIREGUARD_DEBUG=y -- -2.18.2 +2.18.4 -From 15207cd73dd3d5a380c55cd14910d3f5754068c9 Mon Sep 17 00:00:00 2001 +From 66ccca5752057dec27807224049365b2ffe9acc7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 15 Dec 2019 22:08:01 +0100 -Subject: [PATCH 068/111] wireguard: Kconfig: select parent dependency for +Subject: [PATCH 073/117] wireguard: Kconfig: select parent dependency for crypto commit d7c68a38bb4f9b7c1a2e4a772872c752ee5c44a6 upstream. @@ -58782,13 +59506,13 @@ index 16ad145e22c9..57f1ba924f4e 100644 select CRYPTO_POLY1305_NEON if ARM64 && KERNEL_MODE_NEON select CRYPTO_POLY1305_ARM if ARM -- -2.18.2 +2.18.4 -From 32c53a43704c0dc6a4b3595aaa466e24ef95f2c6 Mon Sep 17 00:00:00 2001 +From c11e11e6b0e6a2397e799c3992181031ed3eae04 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 15 Dec 2019 22:08:02 +0100 -Subject: [PATCH 069/111] wireguard: global: fix spelling mistakes in comments +Subject: [PATCH 074/117] wireguard: global: fix spelling mistakes in comments commit a2ec8b5706944d228181c8b91d815f41d6dd8e7b upstream. @@ -58856,13 +59580,13 @@ index dd8a47c4ad11..ae88be14c947 100644 * of a peer, it likely should not be specified in subsequent fragments. * -- -2.18.2 +2.18.4 -From 21758113061c32da38358a7623db25bea7a1b818 Mon Sep 17 00:00:00 2001 +From 868dfe47cfe68645314493b71fde4eb081bf6fef Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Sun, 15 Dec 2019 22:08:03 +0100 -Subject: [PATCH 070/111] wireguard: main: remove unused include +Subject: [PATCH 075/117] wireguard: main: remove unused include commit 43967b6ff91e53bcce5ae08c16a0588a475b53a1 upstream. @@ -58891,13 +59615,13 @@ index 10c0a40f6a9e..7a7d5f1a80fc 100644 #include #include -- -2.18.2 +2.18.4 -From 484a916ee8c80ab19e0f322a6dc5da72dffc1926 Mon Sep 17 00:00:00 2001 +From 96d9926cb49105e894d6395995fb591542ed36f6 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Sun, 15 Dec 2019 22:08:04 +0100 -Subject: [PATCH 071/111] wireguard: allowedips: use kfree_rcu() instead of +Subject: [PATCH 076/117] wireguard: allowedips: use kfree_rcu() instead of call_rcu() commit d89ee7d5c73af15c1c6f12b016cdf469742b5726 upstream. @@ -58939,13 +59663,13 @@ index 72667d5399c3..121d9ea0f135 100644 } } -- -2.18.2 +2.18.4 -From 81c5e624093c936565980ead355a4e58278dbfb1 Mon Sep 17 00:00:00 2001 +From c53da73ef139d2cf7f6be32859a3006dc383a52d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 2 Jan 2020 17:47:49 +0100 -Subject: [PATCH 072/111] wireguard: selftests: remove ancient kernel +Subject: [PATCH 077/117] wireguard: selftests: remove ancient kernel compatibility code commit 9a69a4c8802adf642bc4a13d471b5a86b44ed434 upstream. @@ -59326,13 +60050,13 @@ index 9cca30206014..af9323a0b6e0 100644 CONFIG_FILE_LOCKING=y CONFIG_POSIX_TIMERS=y -- -2.18.2 +2.18.4 -From 0692300b5a34d4de3e6d2f122f9012ebabf1ba70 Mon Sep 17 00:00:00 2001 +From cef197f8fda5274ed18dfac7a9f8b56dacd40375 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 2 Jan 2020 17:47:50 +0100 -Subject: [PATCH 073/111] wireguard: queueing: do not account for pfmemalloc +Subject: [PATCH 078/117] wireguard: queueing: do not account for pfmemalloc when clearing skb header commit 04d2ea92a18417619182cbb79063f154892b0150 upstream. @@ -59371,13 +60095,13 @@ index 58fdd630b246..e62c714a548e 100644 skb->nohdr = 0; skb->peeked = 0; -- -2.18.2 +2.18.4 -From 0a724185216808689541cc36aca39b93eaf8d791 Mon Sep 17 00:00:00 2001 +From 35250a750b764c1cfe9f551ad26e27384de913cc Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 2 Jan 2020 17:47:51 +0100 -Subject: [PATCH 074/111] wireguard: socket: mark skbs as not on list when +Subject: [PATCH 079/117] wireguard: socket: mark skbs as not on list when receiving via gro commit 736775d06bac60d7a353e405398b48b2bd8b1e54 upstream. @@ -59411,13 +60135,13 @@ index c46256d0d81c..262f3b5c819d 100644 return 0; -- -2.18.2 +2.18.4 -From 63d5635fb45747466c1ec35862b88fd720208009 Mon Sep 17 00:00:00 2001 +From 5ec10b531579f77bfc70a15e7418819511a42d73 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 8 Jan 2020 16:59:02 -0500 -Subject: [PATCH 075/111] net: introduce skb_list_walk_safe for skb segment +Subject: [PATCH 080/117] net: introduce skb_list_walk_safe for skb segment walking commit dcfea72e79b0aa7a057c8f6024169d86a1bbc84b upstream. @@ -59473,7 +60197,7 @@ index c91f3051c5c7..b15a8be9d816 100644 - #endif /* _WG_DEVICE_H */ diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index 955e1370f033..5e9fe508977f 100644 +index 68139cc2f3ca..03cf61e8a43f 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1480,6 +1480,11 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb) @@ -59489,13 +60213,13 @@ index 955e1370f033..5e9fe508977f 100644 { __list_del_entry(&skb->list); -- -2.18.2 +2.18.4 -From 73ccb3009a5fbc9cb752633ab1f58ddf5fb3baa2 Mon Sep 17 00:00:00 2001 +From a423ad10a308831d50f86c81f0291b51d801e53c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 13 Jan 2020 18:42:26 -0500 -Subject: [PATCH 076/111] net: skbuff: disambiguate argument and member for +Subject: [PATCH 081/117] net: skbuff: disambiguate argument and member for skb_list_walk_safe helper commit 5eee7bd7e245914e4e050c413dfe864e31805207 upstream. @@ -59513,7 +60237,7 @@ Signed-off-by: Jason A. Donenfeld 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index 5e9fe508977f..3c7755d29636 100644 +index 03cf61e8a43f..6493c98c8631 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1481,9 +1481,9 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb) @@ -59530,13 +60254,13 @@ index 5e9fe508977f..3c7755d29636 100644 static inline void skb_list_del_init(struct sk_buff *skb) { -- -2.18.2 +2.18.4 -From efa92661e440d0226cefd69c0abf4ca806d477f5 Mon Sep 17 00:00:00 2001 +From e257c5a9de187ade2531a9075aa84a78e182166d Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 4 Feb 2020 22:17:25 +0100 -Subject: [PATCH 077/111] wireguard: allowedips: fix use-after-free in +Subject: [PATCH 082/117] wireguard: allowedips: fix use-after-free in root_remove_peer_lists commit 9981159fc3b677b357f84e069a11de5a5ec8a2a8 upstream. @@ -59700,13 +60424,13 @@ index 121d9ea0f135..3725e9cd85f4 100644 return -ENOMEM; } -- -2.18.2 +2.18.4 -From b34ba0bc7bcc1ed8f9a98c02ccbe46bb6e9d25ea Mon Sep 17 00:00:00 2001 +From b3d2803255c144d08798504d6885de4ca725b132 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 4 Feb 2020 22:17:26 +0100 -Subject: [PATCH 078/111] wireguard: noise: reject peers with low order public +Subject: [PATCH 083/117] wireguard: noise: reject peers with low order public keys commit ec31c2676a10e064878927b243fada8c2fb0c03c upstream. @@ -59942,13 +60666,13 @@ index d71c8db68a8c..919d9d866446 100644 return ret; } -- -2.18.2 +2.18.4 -From 582b49f3e28a850c5064955c7c6556f29ffa5b73 Mon Sep 17 00:00:00 2001 +From 40409019d17b22d196464112350e574ad17edcf7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 4 Feb 2020 22:17:27 +0100 -Subject: [PATCH 079/111] wireguard: selftests: ensure non-addition of peers +Subject: [PATCH 084/117] wireguard: selftests: ensure non-addition of peers with failed precomputation commit f9398acba6a4ae9cb98bfe4d56414d376eff8d57 upstream. @@ -59982,13 +60706,13 @@ index d5c85c7494f2..b03647d1bbf6 100755 declare -A objects -- -2.18.2 +2.18.4 -From 07464ba3502e269e5d1b6db1c4f1e60528c07f9f Mon Sep 17 00:00:00 2001 +From b7ddef4ada39278975785409561342e6ab55162e Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 4 Feb 2020 22:17:29 +0100 -Subject: [PATCH 080/111] wireguard: selftests: tie socket waiting to target +Subject: [PATCH 085/117] wireguard: selftests: tie socket waiting to target pid commit 88f404a9b1d75388225b1c67b6dd327cb2182777 upstream. @@ -60066,13 +60790,13 @@ index b03647d1bbf6..f5ab1cda8bb5 100755 ! read -r -N 1 -t 1 out <&4 || false kill $ncat_pid -- -2.18.2 +2.18.4 -From a5f7d81b8eb60585d519ae8b5406ee5299eba56d Mon Sep 17 00:00:00 2001 +From 515d03a657177e95843fe3540e56d162b820c396 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 11 Feb 2020 20:47:08 +0100 -Subject: [PATCH 081/111] wireguard: device: use icmp_ndo_send helper +Subject: [PATCH 086/117] wireguard: device: use icmp_ndo_send helper commit a12d7f3cbdc72c7625881c8dc2660fc2c979fdf2 upstream. @@ -60138,13 +60862,13 @@ index f5ab1cda8bb5..138d46b3f330 100755 ip0 link del vethrs ip1 link del wg0 -- -2.18.2 +2.18.4 -From ef2aa4e86d5cfc85d0c43a9c9258f0358a3416e1 Mon Sep 17 00:00:00 2001 +From 9fb389b4fef1f060e62cb931a07e6c1da5633624 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 14 Feb 2020 23:57:20 +0100 -Subject: [PATCH 082/111] wireguard: selftests: reduce complexity and fix make +Subject: [PATCH 087/117] wireguard: selftests: reduce complexity and fix make races commit 04ddf1208f03e1dbc39a4619c40eba640051b950 upstream. @@ -60248,13 +60972,13 @@ index f10aa3590adc..28d477683e8a 100644 $(STRIP) -s $@ -- -2.18.2 +2.18.4 -From 4290e92a82f97152d012f95bf12749d553657e83 Mon Sep 17 00:00:00 2001 +From 831a463b30cad290fc7d008bdac2845288375602 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 14 Feb 2020 23:57:21 +0100 -Subject: [PATCH 083/111] wireguard: receive: reset last_under_load to zero +Subject: [PATCH 088/117] wireguard: receive: reset last_under_load to zero commit 2a8a4df36462aa85b0db87b7c5ea145ba67e34a8 upstream. @@ -60292,13 +61016,13 @@ index 9c6bab9c981f..4a153894cee2 100644 under_load); if ((under_load && mac_state == VALID_MAC_WITH_COOKIE) || -- -2.18.2 +2.18.4 -From adccd7f3760f71ea360cca23ea61fe98e2570ce7 Mon Sep 17 00:00:00 2001 +From ea70fcce15dab5f0054b4ca65217e5a305e3c145 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 14 Feb 2020 23:57:22 +0100 -Subject: [PATCH 084/111] wireguard: send: account for mtu=0 devices +Subject: [PATCH 089/117] wireguard: send: account for mtu=0 devices commit 175f1ca9a9ed8689d2028da1a7c624bb4fb4ff7e upstream. @@ -60395,13 +61119,13 @@ index c13260563446..7348c10cbae3 100644 } -- -2.18.2 +2.18.4 -From 51e2c40ef1b13f286072ee2830f477cef8de4e51 Mon Sep 17 00:00:00 2001 +From 1d6e9ae34f4a1c67c53b7b715ae514cde6ace0eb Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 14 Feb 2020 23:57:23 +0100 -Subject: [PATCH 085/111] wireguard: socket: remove extra call to +Subject: [PATCH 090/117] wireguard: socket: remove extra call to synchronize_net commit 1fbc33b0a7feb6ca72bf7dc8a05d81485ee8ee2e upstream. @@ -60434,13 +61158,13 @@ index 262f3b5c819d..b0d6541582d3 100644 sock_free(old6); } -- -2.18.2 +2.18.4 -From 644412771742addf9ed055685b9d8625927efbee Mon Sep 17 00:00:00 2001 +From ce08a51556bf3f07c0c8312338a3035d8a2421d1 Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Wed, 18 Mar 2020 18:30:43 -0600 -Subject: [PATCH 086/111] wireguard: selftests: remove duplicated include +Subject: [PATCH 091/117] wireguard: selftests: remove duplicated include commit 166391159c5deb84795d2ff46e95f276177fa5fb upstream. @@ -60468,13 +61192,13 @@ index 90bc9813cadc..c9698120ac9d 100644 #include #include -- -2.18.2 +2.18.4 -From 56136f7d6c86894d708c90f9d900c10eef211f5c Mon Sep 17 00:00:00 2001 +From aac50fb5b0eb9316f18cca18bed61919b88d41a0 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 18 Mar 2020 18:30:45 -0600 -Subject: [PATCH 087/111] wireguard: queueing: account for skb->protocol==0 +Subject: [PATCH 092/117] wireguard: queueing: account for skb->protocol==0 commit a5588604af448664e796daf3c1d5a4523c60667b upstream. @@ -60578,13 +61302,13 @@ index 4a153894cee2..243ed7172dd2 100644 len = ntohs(ip_hdr(skb)->tot_len); if (unlikely(len < sizeof(struct iphdr))) -- -2.18.2 +2.18.4 -From f20dfa360fade00beab3c1fde2484c0af31089e8 Mon Sep 17 00:00:00 2001 +From 964ce837b332aa9bdc060eb00c2211017838cd82 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 18 Mar 2020 18:30:46 -0600 -Subject: [PATCH 088/111] wireguard: receive: remove dead code from default +Subject: [PATCH 093/117] wireguard: receive: remove dead code from default packet type case commit 2b8765c52db24c0fbcc81bac9b5e8390f2c7d3c8 upstream. @@ -60619,13 +61343,13 @@ index 243ed7172dd2..da3b782ab7d3 100644 } return; -- -2.18.2 +2.18.4 -From 454eb2c1f4e51f3075bbe991fa3caec2e9d75dfc Mon Sep 17 00:00:00 2001 +From 27990b9e02e291207a49ea24bd9cd64ab4c53619 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 18 Mar 2020 18:30:47 -0600 -Subject: [PATCH 089/111] wireguard: noise: error out precomputed DH during +Subject: [PATCH 094/117] wireguard: noise: error out precomputed DH during handshake rather than config commit 11a7686aa99c7fe4b3f80f6dcccd54129817984d upstream. @@ -60857,13 +61581,13 @@ index 138d46b3f330..936e1ca9410e 100755 declare -A objects -- -2.18.2 +2.18.4 -From 5927c138a003f8e35ab286bd8521d314b8dba7c7 Mon Sep 17 00:00:00 2001 +From e3d013e38879c1a7e93dad7c4cceec6017d0e71e Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Wed, 29 Apr 2020 14:59:20 -0600 -Subject: [PATCH 090/111] wireguard: send: remove errant newline from +Subject: [PATCH 095/117] wireguard: send: remove errant newline from packet_encrypt_worker commit d6833e42786e050e7522d6a91a9361e54085897d upstream. @@ -60892,13 +61616,13 @@ index 7348c10cbae3..3e030d614df5 100644 } -- -2.18.2 +2.18.4 -From 84d9e8aed2ff8c27d313c104898197f96db5940c Mon Sep 17 00:00:00 2001 +From 23400553fb68a0eb36708c8a767d68385a795ebf Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 29 Apr 2020 14:59:21 -0600 -Subject: [PATCH 091/111] wireguard: queueing: cleanup ptr_ring in error path +Subject: [PATCH 096/117] wireguard: queueing: cleanup ptr_ring in error path of packet_queue_init commit 130c58606171326c81841a49cc913cd354113dd9 upstream. @@ -60933,13 +61657,13 @@ index 5c964fcb994e..71b8e80b58e1 100644 INIT_WORK(&queue->work, function); } -- -2.18.2 +2.18.4 -From 4679b58795110210caaf0a8dfb0edcb7ee290a95 Mon Sep 17 00:00:00 2001 +From faab18ac509618e078a2b4e125fc2b9b9d01cdc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Wed, 29 Apr 2020 14:59:22 -0600 -Subject: [PATCH 092/111] wireguard: receive: use tunnel helpers for +Subject: [PATCH 097/117] wireguard: receive: use tunnel helpers for decapsulating ECN markings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -60989,13 +61713,13 @@ index da3b782ab7d3..267f202f1931 100644 goto dishonest_packet_type; } -- -2.18.2 +2.18.4 -From b49ee9516949e76a028cd02a2169bd5eb626f8b2 Mon Sep 17 00:00:00 2001 +From 4df414e69f6e40c5cf8242f301a6cb01226cc8a9 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 6 May 2020 15:33:02 -0600 -Subject: [PATCH 093/111] wireguard: selftests: use normal kernel stack size on +Subject: [PATCH 098/117] wireguard: selftests: use normal kernel stack size on ppc64 commit a0fd7cc87a018df1a17f9d3f0bd994c1f22c6b34 upstream. @@ -61024,13 +61748,13 @@ index 990c510a9cfa..f52f1e2bc7f6 100644 CONFIG_FRAME_WARN=1280 +CONFIG_THREAD_SHIFT=14 -- -2.18.2 +2.18.4 -From ea12677cac264b7ca0b590528811a7adea9dab85 Mon Sep 17 00:00:00 2001 +From a0746efe2e6f0487c565b6c739de99180f829ec8 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 6 May 2020 15:33:03 -0600 -Subject: [PATCH 094/111] wireguard: socket: remove errant restriction on +Subject: [PATCH 099/117] wireguard: socket: remove errant restriction on looping to self commit b673e24aad36981f327a6570412ffa7754de8911 upstream. @@ -61194,13 +61918,13 @@ index 936e1ca9410e..17a1f53ceba0 100755 ip1 -6 addr add fc00::9/96 dev vethc ip1 -6 route add default via fc00::1 -- -2.18.2 +2.18.4 -From 02e4d9d72c88c70cef26e348ef39b6172b9540d2 Mon Sep 17 00:00:00 2001 +From 16cbafae73e8af8c3b283aaaa785c497e9ee89b4 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 6 May 2020 15:33:04 -0600 -Subject: [PATCH 095/111] wireguard: send/receive: cond_resched() when +Subject: [PATCH 100/117] wireguard: send/receive: cond_resched() when processing worker ringbuffers commit 4005f5c3c9d006157ba716594e0d70c88a235c5e upstream. @@ -61260,13 +61984,13 @@ index 3e030d614df5..dc3079e17c7f 100644 } -- -2.18.2 +2.18.4 -From 86bd3f4255cb765f777d0c07e3088690d8f770b5 Mon Sep 17 00:00:00 2001 +From e2fc9350897b60a116ef4e5ab1a37e2122d734ae Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 6 May 2020 15:33:05 -0600 -Subject: [PATCH 096/111] wireguard: selftests: initalize ipv6 members to NULL +Subject: [PATCH 101/117] wireguard: selftests: initalize ipv6 members to NULL to squelch clang warning commit 4fed818ef54b08d4b29200e416cce65546ad5312 upstream. @@ -61317,13 +62041,13 @@ index bcd6462e4540..007cd4457c5f 100644 if (IS_ENABLED(CONFIG_KASAN) || IS_ENABLED(CONFIG_UBSAN)) return true; -- -2.18.2 +2.18.4 -From 9e483eb0a0929a2d41e6bd85050f4cd6df2296f7 Mon Sep 17 00:00:00 2001 +From 7181768ebd2a5227be5150ce3ec0b31cc0526951 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 6 May 2020 15:33:06 -0600 -Subject: [PATCH 097/111] wireguard: send/receive: use explicit unlikely branch +Subject: [PATCH 102/117] wireguard: send/receive: use explicit unlikely branch instead of implicit coalescing commit 243f2148937adc72bcaaa590d482d599c936efde upstream. @@ -61413,13 +62137,13 @@ index dc3079e17c7f..6687db699803 100644 } -- -2.18.2 +2.18.4 -From 63ff63eab82c03f8a704904f2d0053c9483a9963 Mon Sep 17 00:00:00 2001 +From 99d8e0929c8bb68772a3da8669c7a9d7a609deca Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 19 May 2020 22:49:27 -0600 -Subject: [PATCH 098/111] wireguard: selftests: use newer iproute2 for gcc-10 +Subject: [PATCH 103/117] wireguard: selftests: use newer iproute2 for gcc-10 commit ee3c1aa3f34b7842c1557cfe5d8c3f7b8c692de8 upstream. @@ -61450,13 +62174,13 @@ index 28d477683e8a..2dab4f57516d 100644 $(eval $(call tar_download,NMAP,nmap,7.80,.tar.bz2,https://nmap.org/dist/,fcfa5a0e42099e12e4bf7a68ebe6fde05553383a682e816a7ec9256ab4773faa)) $(eval $(call tar_download,IPUTILS,iputils,s20190709,.tar.gz,https://github.com/iputils/iputils/archive/s20190709.tar.gz/#,a15720dd741d7538dd2645f9f516d193636ae4300ff7dbc8bfca757bf166490a)) -- -2.18.2 +2.18.4 -From 16a7e167d711c54e7a7a5cbbeb2248a8d3112be8 Mon Sep 17 00:00:00 2001 +From 0df08bac3b1a5b8b47093b93803943e644b6cf65 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 19 May 2020 22:49:28 -0600 -Subject: [PATCH 099/111] wireguard: noise: read preshared key while taking +Subject: [PATCH 104/117] wireguard: noise: read preshared key while taking lock commit bc67d371256f5c47d824e2eec51e46c8d62d022e upstream. @@ -61518,13 +62242,13 @@ index 708dc61c974f..07eb438a6dee 100644 return ret_peer; } -- -2.18.2 +2.18.4 -From 3dcc39a231f8e089d1f5dfdca1df6a11bafbe6da Mon Sep 17 00:00:00 2001 +From ec6425628d4fa655a92ae6984ebda0be980016ed Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 19 May 2020 22:49:29 -0600 -Subject: [PATCH 100/111] wireguard: queueing: preserve flow hash across packet +Subject: [PATCH 105/117] wireguard: queueing: preserve flow hash across packet scrubbing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -61646,13 +62370,13 @@ index 6687db699803..2f5119ff93d8 100644 state = PACKET_STATE_DEAD; break; -- -2.18.2 +2.18.4 -From dc52db0cf977334487997686486a672a73e6f30a Mon Sep 17 00:00:00 2001 +From 84c0736cea5596e02ecce0bea45a69718704432d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 19 May 2020 22:49:30 -0600 -Subject: [PATCH 101/111] wireguard: noise: separate receive counter from send +Subject: [PATCH 106/117] wireguard: noise: separate receive counter from send counter commit a9e90d9931f3a474f04bab782ccd9d77904941e9 upstream. @@ -61991,13 +62715,13 @@ index 2f5119ff93d8..f74b9341ab0f 100644 wg_noise_keypair_put(keypair, false); -- -2.18.2 +2.18.4 -From 171ddbce134ea616e96dcdaa759200b2239ffcc0 Mon Sep 17 00:00:00 2001 +From b8b2620c99253cac9a5008249391fee8fb3d0377 Mon Sep 17 00:00:00 2001 From: Frank Werner-Krippendorf Date: Tue, 23 Jun 2020 03:59:44 -0600 -Subject: [PATCH 102/111] wireguard: noise: do not assign initiation time in if +Subject: [PATCH 107/117] wireguard: noise: do not assign initiation time in if condition commit 558b353c9c2a717509f291c066c6bd8f5f5e21be upstream. @@ -62030,13 +62754,13 @@ index 626433690abb..201a22681945 100644 handshake->state = HANDSHAKE_CONSUMED_INITIATION; up_write(&handshake->lock); -- -2.18.2 +2.18.4 -From 69f3584dfb917d2d6ea7cefea968b36df678b5fa Mon Sep 17 00:00:00 2001 +From b1f3bfdc335281a83df2ee57d277345df076043c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 23 Jun 2020 03:59:45 -0600 -Subject: [PATCH 103/111] wireguard: device: avoid circular netns references +Subject: [PATCH 108/117] wireguard: device: avoid circular netns references commit 900575aa33a3eaaef802b31de187a85c4a4b4bd0 upstream. @@ -62340,13 +63064,13 @@ index 17a1f53ceba0..d77f4829f1e0 100755 done < /dev/kmsg alldeleted=1 -- -2.18.2 +2.18.4 -From 722d6876f6951ed2886d255dc52dfcc2c0a05cb5 Mon Sep 17 00:00:00 2001 +From 6638d3114d662c256cea902f042dc1cf214eb0b5 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 24 Jun 2020 16:06:03 -0600 -Subject: [PATCH 104/111] wireguard: receive: account for napi_gro_receive +Subject: [PATCH 109/117] wireguard: receive: account for napi_gro_receive never returning GRO_DROP commit df08126e3833e9dca19e2407db5f5860a7c194fb upstream. @@ -62388,13 +63112,13 @@ index 91438144e4f7..9b2ab6fc91cd 100644 dishonest_packet_peer: -- -2.18.2 +2.18.4 -From b7f1bfd60e87a24534d5815033b7d35040850bb5 Mon Sep 17 00:00:00 2001 +From cf6318bad2a0c74fa1537902c214db46b2863da6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 29 Jun 2020 19:06:18 -0600 -Subject: [PATCH 105/111] net: ip_tunnel: add header_ops for layer 3 devices +Subject: [PATCH 110/117] net: ip_tunnel: add header_ops for layer 3 devices commit 2606aff916854b61234bf85001be9777bab2d5f8 upstream. @@ -62414,7 +63138,7 @@ Signed-off-by: Jason A. Donenfeld 2 files changed, 21 insertions(+) diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h -index af645604f328..b0b03a9f7af9 100644 +index 56deb2501e96..8545fa25c7bf 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h @@ -289,6 +289,9 @@ int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[], @@ -62454,13 +63178,13 @@ index 1452a97914a0..cfe21c3ddfc2 100644 +const struct header_ops ip_tunnel_header_ops = { .parse_protocol = ip_tunnel_parse_protocol }; +EXPORT_SYMBOL(ip_tunnel_header_ops); -- -2.18.2 +2.18.4 -From 843947533aba46175fdfea9aa6674a5bba321a10 Mon Sep 17 00:00:00 2001 +From e5bb1068b8eeb03f0b5659de02a16c968ce46e0c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 29 Jun 2020 19:06:20 -0600 -Subject: [PATCH 106/111] wireguard: implement header_ops->parse_protocol for +Subject: [PATCH 111/117] wireguard: implement header_ops->parse_protocol for AF_PACKET commit 01a4967c71c004f8ecad4ab57021348636502fa9 upstream. @@ -62497,13 +63221,13 @@ index a8f151b1b5fa..c9f65e96ccb0 100644 dev->addr_len = 0; dev->needed_headroom = DATA_PACKET_HEAD_ROOM; -- -2.18.2 +2.18.4 -From a5ac0e0c6a686ec42004321a0ab9539364143050 Mon Sep 17 00:00:00 2001 +From 6b54af46ff60f401fdb246c9edc0af9f5ee065f1 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 29 Jun 2020 19:06:21 -0600 -Subject: [PATCH 107/111] wireguard: queueing: make use of +Subject: [PATCH 112/117] wireguard: queueing: make use of ip_tunnel_parse_protocol commit 1a574074ae7d1d745c16f7710655f38a53174c27 upstream. @@ -62574,13 +63298,13 @@ index 9b2ab6fc91cd..2c9551ea6dc7 100644 len = ntohs(ip_hdr(skb)->tot_len); if (unlikely(len < sizeof(struct iphdr))) -- -2.18.2 +2.18.4 -From 851d4971ac7da6fdc9b10adf4010fec13ea61c0d Mon Sep 17 00:00:00 2001 +From ae9aa1fe3f8a82b199ea467ce59bf60ce11728b7 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 18 Aug 2020 10:17:31 +0200 -Subject: [PATCH 108/111] netlink: consistently use NLA_POLICY_EXACT_LEN() +Subject: [PATCH 113/117] netlink: consistently use NLA_POLICY_EXACT_LEN() commit 8140860c817f3e9f78bcd1e420b9777ddcbaa629 upstream. @@ -62629,13 +63353,13 @@ index 9756239416fd..2a14f564033a 100644 [WGPEER_A_TX_BYTES] = { .type = NLA_U64 }, [WGPEER_A_ALLOWEDIPS] = { .type = NLA_NESTED }, -- -2.18.2 +2.18.4 -From d1b90bd05552e4ae77a5b409ea1215472db522a8 Mon Sep 17 00:00:00 2001 +From 26ffe7c1fb4e919f0fb1182f61fb3ea0b80eaa44 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 18 Aug 2020 10:17:32 +0200 -Subject: [PATCH 109/111] netlink: consistently use NLA_POLICY_MIN_LEN() +Subject: [PATCH 114/117] netlink: consistently use NLA_POLICY_MIN_LEN() commit bc0435855041d7fff0b83dd992fc4be34aa11afb upstream. @@ -62674,13 +63398,13 @@ index 2a14f564033a..1c69eb8735d5 100644 }; -- -2.18.2 +2.18.4 -From 27ec71c22b1dec44cf144c08d05c880d31d5eae2 Mon Sep 17 00:00:00 2001 +From bd6ee2b1c576a65d4ac641274c36a8e2f9eaa547 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 9 Sep 2020 13:58:14 +0200 -Subject: [PATCH 110/111] wireguard: noise: take lock when removing handshake +Subject: [PATCH 115/117] wireguard: noise: take lock when removing handshake entry from table commit 9179ba31367bcf481c3c79b5f028c94faad9f30a upstream. @@ -62807,13 +63531,13 @@ index 201a22681945..27cb5045bed2 100644 static struct noise_keypair *keypair_create(struct wg_peer *peer) -- -2.18.2 +2.18.4 -From e2b69aa576a3011fc722450f3f296189b1dac3c8 Mon Sep 17 00:00:00 2001 +From 5003c5d6a8698bce404a9e68528ec994ba1a0f12 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 9 Sep 2020 13:58:15 +0200 -Subject: [PATCH 111/111] wireguard: peerlookup: take lock before checking hash +Subject: [PATCH 116/117] wireguard: peerlookup: take lock before checking hash in replace operation commit 6147f7b1e90ff09bd52afc8b9206a7fcd133daf7 upstream. @@ -62875,5 +63599,69 @@ index e4deb331476b..f2783aa7a88f 100644 void wg_index_hashtable_remove(struct index_hashtable *table, -- -2.18.2 +2.18.4 + + +From 2d4c3892646cdd41486dc4b1aab1fc2942b49f10 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Thu, 29 Oct 2020 03:56:05 +0100 +Subject: [PATCH 117/117] wireguard: selftests: check that route_me_harder + packets use the right sk + +commit af8afcf1fdd5f365f70e2386c2d8c7a1abd853d7 upstream. + +If netfilter changes the packet mark, the packet is rerouted. The +ip_route_me_harder family of functions fails to use the right sk, opting +to instead use skb->sk, resulting in a routing loop when used with +tunnels. With the next change fixing this issue in netfilter, test for +the relevant condition inside our test suite, since wireguard was where +the bug was discovered. + +Reported-by: Chen Minqiang +Signed-off-by: Jason A. Donenfeld +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Jason A. Donenfeld +--- + tools/testing/selftests/wireguard/netns.sh | 8 ++++++++ + tools/testing/selftests/wireguard/qemu/kernel.config | 2 ++ + 2 files changed, 10 insertions(+) + +diff --git a/tools/testing/selftests/wireguard/netns.sh b/tools/testing/selftests/wireguard/netns.sh +index d77f4829f1e0..74c69b75f6f5 100755 +--- a/tools/testing/selftests/wireguard/netns.sh ++++ b/tools/testing/selftests/wireguard/netns.sh +@@ -316,6 +316,14 @@ pp sleep 3 + n2 ping -W 1 -c 1 192.168.241.1 + n1 wg set wg0 peer "$pub2" persistent-keepalive 0 + ++# Test that sk_bound_dev_if works ++n1 ping -I wg0 -c 1 -W 1 192.168.241.2 ++# What about when the mark changes and the packet must be rerouted? ++n1 iptables -t mangle -I OUTPUT -j MARK --set-xmark 1 ++n1 ping -c 1 -W 1 192.168.241.2 # First the boring case ++n1 ping -I wg0 -c 1 -W 1 192.168.241.2 # Then the sk_bound_dev_if case ++n1 iptables -t mangle -D OUTPUT -j MARK --set-xmark 1 ++ + # Test that onion routing works, even when it loops + n1 wg set wg0 peer "$pub3" allowed-ips 192.168.242.2/32 endpoint 192.168.241.2:5 + ip1 addr add 192.168.242.1/24 dev wg0 +diff --git a/tools/testing/selftests/wireguard/qemu/kernel.config b/tools/testing/selftests/wireguard/qemu/kernel.config +index af9323a0b6e0..9864d106e818 100644 +--- a/tools/testing/selftests/wireguard/qemu/kernel.config ++++ b/tools/testing/selftests/wireguard/qemu/kernel.config +@@ -18,10 +18,12 @@ CONFIG_NF_NAT=y + CONFIG_NETFILTER_XTABLES=y + CONFIG_NETFILTER_XT_NAT=y + CONFIG_NETFILTER_XT_MATCH_LENGTH=y ++CONFIG_NETFILTER_XT_MARK=y + CONFIG_NF_CONNTRACK_IPV4=y + CONFIG_NF_NAT_IPV4=y + CONFIG_IP_NF_IPTABLES=y + CONFIG_IP_NF_FILTER=y ++CONFIG_IP_NF_MANGLE=y + CONFIG_IP_NF_NAT=y + CONFIG_IP_ADVANCED_ROUTER=y + CONFIG_IP_MULTIPLE_TABLES=y +-- +2.18.4 diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec index dd84767..3981fab 100644 --- a/SPECS/kernel.spec +++ b/SPECS/kernel.spec @@ -89,7 +89,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 72 +%define stable_update 84 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -3009,6 +3009,9 @@ fi # # %changelog +* Sun Dec 20 2020 Pablo Greco - 5.4.84-200 +- Update to version v5.4.84 + * Sun Oct 18 2020 Pablo Greco - 5.4.72-200 - Update to version v5.4.72 - Add initial bits for secure boot