]>
Commit | Line | Data |
---|---|---|
c062c770 AF |
1 | From: Eric Biggers <ebiggers@kernel.org> |
2 | To: linux-crypto@vger.kernel.org, Herbert Xu <herbert@gondor.apana.org.au> | |
3 | Cc: 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> | |
11 | Subject: [PATCH] crypto: testmgr - allocate buffers with __GFP_COMP | |
12 | Date: Thu, 11 Apr 2019 12:28:27 -0700 | |
13 | Message-ID: <20190411192827.72551-1-ebiggers@kernel.org> (raw) | |
14 | In-Reply-To: <20190411192607.GD225654@gmail.com> | |
15 | ||
16 | From: Eric Biggers <ebiggers@google.com> | |
17 | ||
18 | This is needed so that CONFIG_HARDENED_USERCOPY_PAGESPAN=y doesn't | |
19 | incorrectly report a buffer overflow when the destination of | |
20 | copy_from_iter() spans the page boundary in the 2-page buffer. | |
21 | ||
22 | Fixes: 3f47a03df6e8 ("crypto: testmgr - add testvec_config struct and helper functions") | |
23 | Signed-off-by: Eric Biggers <ebiggers@google.com> | |
24 | --- | |
25 | crypto/testmgr.c | 3 ++- | |
26 | 1 file changed, 2 insertions(+), 1 deletion(-) | |
27 | ||
28 | diff --git a/crypto/testmgr.c b/crypto/testmgr.c | |
29 | index 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 | -- | |
43 | 2.21.0.392.gf8f6787159e-goog |