* [GIT PULL] s390 patches for the 4.19 merge window #2 @ 2018-08-24 7:42 Martin Schwidefsky 2018-09-05 0:16 ` Kees Cook 0 siblings, 1 reply; 4+ messages in thread From: Martin Schwidefsky @ 2018-08-24 7:42 UTC (permalink / raw) To: Linus Torvalds; +Cc: linux-kernel, linux-s390, Heiko Carstens Hi Linus, please pull from the 'for-linus' branch of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git for-linus to receive the following updates: - A couple of patches for the zcrypt driver + Add two masks to determine which AP cards and queues are host devices, this will be useful for KVM AP device passthrough + Add-on patch to improve the parsing of the new apmask and aqmask + Some code beautification - Second try to reenable the GCC plugins, the first patch set had a patch to do this but the merge somehow missed this - Remove the s390 specific GCC version check and use the generic one - Three patches for kdump, two bug fixes and one cleanup - Three patches for the PCI layer, one bug fix and two cleanups Harald Freudenberger (5): s390/zcrypt: fix ap_instructions_available() returncodes s390/zcrypt: switch return type to bool for ap_instructions_available() s390/zcrypt: code beautify s390/zcrypt: AP bus support for alternate driver(s) s390/zcrypt: hex string mask improvements for apmask and aqmask. Heiko Carstens (2): s390: reenable gcc plugins for real s390: remove gcc version check (4.3 or newer) Philipp Rudo (3): s390/kdump: Make elfcorehdr size calculation ABI compliant s390/kdump: Fix memleak in nt_vmcoreinfo s390/kdump: Remove kzalloc_panic Sebastian Ott (3): s390/pci: fix out of bounds access during irq setup s390/pci: remove stale rc s390/pci: remove fmb address from debug output arch/s390/Kconfig | 2 +- arch/s390/include/asm/ap.h | 14 +- arch/s390/include/uapi/asm/zcrypt.h | 72 +++--- arch/s390/kernel/asm-offsets.c | 8 - arch/s390/kernel/crash_dump.c | 70 +++--- arch/s390/pci/pci.c | 3 +- arch/s390/pci/pci_debug.c | 1 - drivers/s390/crypto/ap_bus.c | 432 ++++++++++++++++++++++++++++++--- drivers/s390/crypto/ap_bus.h | 36 ++- drivers/s390/crypto/ap_card.c | 50 ++-- drivers/s390/crypto/ap_queue.c | 38 +-- drivers/s390/crypto/pkey_api.c | 91 +++---- drivers/s390/crypto/zcrypt_api.c | 30 ++- drivers/s390/crypto/zcrypt_api.h | 2 +- drivers/s390/crypto/zcrypt_card.c | 29 ++- drivers/s390/crypto/zcrypt_cca_key.h | 12 +- drivers/s390/crypto/zcrypt_cex2a.c | 2 + drivers/s390/crypto/zcrypt_cex2a.h | 18 +- drivers/s390/crypto/zcrypt_cex4.c | 2 + drivers/s390/crypto/zcrypt_error.h | 2 +- drivers/s390/crypto/zcrypt_msgtype50.c | 17 +- drivers/s390/crypto/zcrypt_msgtype50.h | 8 +- drivers/s390/crypto/zcrypt_msgtype6.c | 34 ++- drivers/s390/crypto/zcrypt_msgtype6.h | 2 +- drivers/s390/crypto/zcrypt_pcixcc.c | 6 +- drivers/s390/crypto/zcrypt_pcixcc.h | 2 +- drivers/s390/crypto/zcrypt_queue.c | 23 +- 27 files changed, 706 insertions(+), 300 deletions(-) ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [GIT PULL] s390 patches for the 4.19 merge window #2 2018-08-24 7:42 [GIT PULL] s390 patches for the 4.19 merge window #2 Martin Schwidefsky @ 2018-09-05 0:16 ` Kees Cook 2018-09-05 5:56 ` Martin Schwidefsky 2018-09-06 9:52 ` Harald Freudenberger 0 siblings, 2 replies; 4+ messages in thread From: Kees Cook @ 2018-09-05 0:16 UTC (permalink / raw) To: Harald Freudenberger Cc: Martin Schwidefsky, linux-kernel, linux-s390, Heiko Carstens On Fri, Aug 24, 2018 at 12:42 AM, Martin Schwidefsky <schwidefsky@de.ibm.com> wrote: > Harald Freudenberger (5): > s390/zcrypt: hex string mask improvements for apmask and aqmask. This (and an earlier 2017 commit) adds VLAs, which are being removed[1] from the kernel: drivers/s390/crypto/ap_bus.c:980:3: warning: ISO C90 forbids variable length array ‘clrm’ [-Wvla] drivers/s390/crypto/ap_bus.c:981:3: warning: ISO C90 forbids variable length array ‘setm’ [-Wvla] drivers/s390/crypto/ap_bus.c:995:3: warning: ISO C90 forbids variable length array ‘setm’ [-Wvla] static int process_mask_arg(const char *str, unsigned long *bitmap, int bits, struct mutex *lock) ... DECLARE_BITMAP(clrm, bits); DECLARE_BITMAP(setm, bits); Can someone please adjust this to make these fixed size again? Thanks! -Kees [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com -- Kees Cook Pixel Security ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [GIT PULL] s390 patches for the 4.19 merge window #2 2018-09-05 0:16 ` Kees Cook @ 2018-09-05 5:56 ` Martin Schwidefsky 2018-09-06 9:52 ` Harald Freudenberger 1 sibling, 0 replies; 4+ messages in thread From: Martin Schwidefsky @ 2018-09-05 5:56 UTC (permalink / raw) To: Kees Cook; +Cc: Harald Freudenberger, linux-kernel, linux-s390, Heiko Carstens On Tue, 4 Sep 2018 17:16:31 -0700 Kees Cook <keescook@chromium.org> wrote: > On Fri, Aug 24, 2018 at 12:42 AM, Martin Schwidefsky > <schwidefsky@de.ibm.com> wrote: > > Harald Freudenberger (5): > > s390/zcrypt: hex string mask improvements for apmask and aqmask. > > This (and an earlier 2017 commit) adds VLAs, which are being > removed[1] from the kernel: > > drivers/s390/crypto/ap_bus.c:980:3: warning: ISO C90 forbids variable > length array ‘clrm’ [-Wvla] > drivers/s390/crypto/ap_bus.c:981:3: warning: ISO C90 forbids variable > length array ‘setm’ [-Wvla] > drivers/s390/crypto/ap_bus.c:995:3: warning: ISO C90 forbids variable > length array ‘setm’ [-Wvla] > > static int process_mask_arg(const char *str, > unsigned long *bitmap, int bits, > struct mutex *lock) > ... > DECLARE_BITMAP(clrm, bits); > DECLARE_BITMAP(setm, bits); > > Can someone please adjust this to make these fixed size again? Oops, sorry about that. We will provide a solution for this. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [GIT PULL] s390 patches for the 4.19 merge window #2 2018-09-05 0:16 ` Kees Cook 2018-09-05 5:56 ` Martin Schwidefsky @ 2018-09-06 9:52 ` Harald Freudenberger 1 sibling, 0 replies; 4+ messages in thread From: Harald Freudenberger @ 2018-09-06 9:52 UTC (permalink / raw) To: Martin Schwidefsky; +Cc: linux-kernel, Heiko Carstens On 05.09.2018 02:16, Kees Cook wrote: > On Fri, Aug 24, 2018 at 12:42 AM, Martin Schwidefsky > <schwidefsky@de.ibm.com> wrote: >> Harald Freudenberger (5): >> s390/zcrypt: hex string mask improvements for apmask and aqmask. > This (and an earlier 2017 commit) adds VLAs, which are being > removed[1] from the kernel: > > drivers/s390/crypto/ap_bus.c:980:3: warning: ISO C90 forbids variable > length array ‘clrm’ [-Wvla] > drivers/s390/crypto/ap_bus.c:981:3: warning: ISO C90 forbids variable > length array ‘setm’ [-Wvla] > drivers/s390/crypto/ap_bus.c:995:3: warning: ISO C90 forbids variable > length array ‘setm’ [-Wvla] > > static int process_mask_arg(const char *str, > unsigned long *bitmap, int bits, > struct mutex *lock) > ... > DECLARE_BITMAP(clrm, bits); > DECLARE_BITMAP(setm, bits); > > Can someone please adjust this to make these fixed size again? > > Thanks! > > -Kees > > [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com > Here is a simple solution which just hard codes the upper limit to 256 bits. As all callers are only internal to the ap bus code and do obey to this limit this shouldn't be a real limitation. However, a version which really allocates will follow and then I'll discuss with Martin, which version to post upstream. ======================================== From: Harald Freudenberger <freude@linux.ibm.com> Date: Thu, 6 Sep 2018 11:29:36 +0200 Subject: [PATCH] s390/zcrypt: remove VLA use in ap bus code The internal function to parse sysfs arguments uses VLAs - dynamic bitmap arrays on the stack where the size is determined by a invocation argument. Reworked the code to have fixed sizes and check, if the caller comply to this limit. However, one code path uses two of these bitmap arrays and thus has a stack footprint of 64 bytes. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> --- drivers/s390/crypto/ap_bus.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index ec891bc7d10a..20f2fa2276c8 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -972,13 +972,13 @@ static int process_mask_arg(const char *str, { int i; - /* bits needs to be a multiple of 8 */ - if (bits & 0x07) + /* bits needs to be a multiple of 8 and <= 256 */ + if (bits & 0x07 || bits > 256) return -EINVAL; if (*str == '+' || *str == '-') { - DECLARE_BITMAP(clrm, bits); - DECLARE_BITMAP(setm, bits); + DECLARE_BITMAP(clrm, 256); + DECLARE_BITMAP(setm, 256); i = str2clrsetmasks(str, clrm, setm, bits); if (i) @@ -992,7 +992,7 @@ static int process_mask_arg(const char *str, set_bit_inv(i, bitmap); } } else { - DECLARE_BITMAP(setm, bits); + DECLARE_BITMAP(setm, 256); i = hex2bitmap(str, setm, bits); if (i) -- 2.17.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-06 9:52 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-08-24 7:42 [GIT PULL] s390 patches for the 4.19 merge window #2 Martin Schwidefsky 2018-09-05 0:16 ` Kees Cook 2018-09-05 5:56 ` Martin Schwidefsky 2018-09-06 9:52 ` Harald Freudenberger
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).