Message ID | 20180711203619.1020-14-keescook@chromium.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Mike Snitzer |
Headers | show |
On Wed, Jul 11, 2018 at 10:36 PM, Kees Cook <keescook@chromium.org> wrote: > Two uses of SKCIPHER_REQUEST_ON_STACK() will trigger FRAME_WARN warnings > (when less than 2048) once the VLA is no longer hidden from the check: > > net/rxrpc/rxkad.c:398:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] > net/rxrpc/rxkad.c:242:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] > > This bumps the affected objects by 20% to silence the warnings while > still providing coverage is anything grows even more. > > Signed-off-by: Kees Cook <keescook@chromium.org> (adding David Howells to cc) I don't think these are in a fast path, it should be possible to just use skcipher_alloc_req() instead of SKCIPHER_REQUEST_ON_STACK() here. >From what I can tell, neither of the two are called in atomic context, so you should be able to use a GFP_KERNEL allocation. Arnd -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
On Thu, Jul 12, 2018 at 8:11 AM, Arnd Bergmann <arnd@arndb.de> wrote: > On Wed, Jul 11, 2018 at 10:36 PM, Kees Cook <keescook@chromium.org> wrote: >> Two uses of SKCIPHER_REQUEST_ON_STACK() will trigger FRAME_WARN warnings >> (when less than 2048) once the VLA is no longer hidden from the check: >> >> net/rxrpc/rxkad.c:398:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] >> net/rxrpc/rxkad.c:242:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] >> >> This bumps the affected objects by 20% to silence the warnings while >> still providing coverage is anything grows even more. >> >> Signed-off-by: Kees Cook <keescook@chromium.org> > > (adding David Howells to cc) > > I don't think these are in a fast path, it should be possible to just use > skcipher_alloc_req() instead of SKCIPHER_REQUEST_ON_STACK() here. > From what I can tell, neither of the two are called in atomic context, so > you should be able to use a GFP_KERNEL allocation. Sure, I can do that instead. -Kees
Can I get a cc on the original patch? David -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
Hi David,
On Thu, Jul 12, 2018 at 2:28 PM, David Howells <dhowells@redhat.com> wrote:
> Can I get a cc on the original patch?
I'll add you to CC for future revisions. Here was the start of this thread:
https://lkml.kernel.org/r/20180711203619.1020-14-keescook@chromium.org
-Kees
Arnd Bergmann <arnd@arndb.de> wrote: > From what I can tell, neither of the two are called in atomic context, so > you should be able to use a GFP_KERNEL allocation. You need to be careful doing that since the allocation might happen in the AFS writeback path. I use GFP_NOIO or GFP_NOFS in rxkad.c and skb_cow_data() uses GFP_ATOMIC - though we should have single ownership of the packet at this point. David -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
diff --git a/net/rxrpc/Makefile b/net/rxrpc/Makefile index 6ffb7e9887ce..53e1177129e6 100644 --- a/net/rxrpc/Makefile +++ b/net/rxrpc/Makefile @@ -32,4 +32,5 @@ rxrpc-y := \ rxrpc-$(CONFIG_PROC_FS) += proc.o rxrpc-$(CONFIG_RXKAD) += rxkad.o +CFLAGS_rxkad.o += $(FRAME_WARN_BUMP_FLAG) rxrpc-$(CONFIG_SYSCTL) += sysctl.o
Two uses of SKCIPHER_REQUEST_ON_STACK() will trigger FRAME_WARN warnings (when less than 2048) once the VLA is no longer hidden from the check: net/rxrpc/rxkad.c:398:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] net/rxrpc/rxkad.c:242:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] This bumps the affected objects by 20% to silence the warnings while still providing coverage is anything grows even more. Signed-off-by: Kees Cook <keescook@chromium.org> --- net/rxrpc/Makefile | 1 + 1 file changed, 1 insertion(+)