]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/linux/linux-5.9-crypto_testmgr_allocate_buffers_with____GFP_COMP.patch
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / src / patches / linux / linux-5.9-crypto_testmgr_allocate_buffers_with____GFP_COMP.patch
CommitLineData
c062c770
AF
1From: Eric Biggers <ebiggers@kernel.org>
2To: linux-crypto@vger.kernel.org, Herbert Xu <herbert@gondor.apana.org.au>
3Cc: Kees Cook <keescook@chromium.org>,
4 Dmitry Vyukov <dvyukov@google.com>,
5 Geert Uytterhoeven <geert@linux-m68k.org>,
6 linux-security-module <linux-security-module@vger.kernel.org>,
7 Linux ARM <linux-arm-kernel@lists.infradead.org>,
8 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
9 Laura Abbott <labbott@redhat.com>,
10 Rik van Riel <riel@surriel.com>
11Subject: [PATCH] crypto: testmgr - allocate buffers with __GFP_COMP
12Date: Thu, 11 Apr 2019 12:28:27 -0700
13Message-ID: <20190411192827.72551-1-ebiggers@kernel.org> (raw)
14In-Reply-To: <20190411192607.GD225654@gmail.com>
15
16From: Eric Biggers <ebiggers@google.com>
17
18This is needed so that CONFIG_HARDENED_USERCOPY_PAGESPAN=y doesn't
19incorrectly report a buffer overflow when the destination of
20copy_from_iter() spans the page boundary in the 2-page buffer.
21
22Fixes: 3f47a03df6e8 ("crypto: testmgr - add testvec_config struct and helper functions")
23Signed-off-by: Eric Biggers <ebiggers@google.com>
24---
25 crypto/testmgr.c | 3 ++-
26 1 file changed, 2 insertions(+), 1 deletion(-)
27
28diff --git a/crypto/testmgr.c b/crypto/testmgr.c
29index 0f6bfb6ce6a46..3522c0bed2492 100644
30--- a/crypto/testmgr.c
31+++ b/crypto/testmgr.c
32@@ -156,7 +156,8 @@ static int __testmgr_alloc_buf(char *buf[XBUFSIZE], int order)
33 int i;
34
35 for (i = 0; i < XBUFSIZE; i++) {
36- buf[i] = (char *)__get_free_pages(GFP_KERNEL, order);
37+ buf[i] = (char *)__get_free_pages(GFP_KERNEL | __GFP_COMP,
38+ order);
39 if (!buf[i])
40 goto err_free_buf;
41 }
42--
432.21.0.392.gf8f6787159e-goog