[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <167409066308.2374724.17477861672467900544.b4-ty@google.com>
Date: Thu, 19 Jan 2023 20:48:52 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>,
Kees Cook <keescook@...omium.org>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2] KVM: x86: Replace 0-length arrays with flexible arrays
On Wed, 18 Jan 2023 11:59:09 -0800, Kees Cook wrote:
> Zero-length arrays are deprecated[1]. Replace struct kvm_nested_state's
> "data" union 0-length arrays with flexible arrays. (How are the
> sizes of these arrays verified?) Detected with GCC 13, using
> -fstrict-flex-arrays=3:
>
> arch/x86/kvm/svm/nested.c: In function 'svm_get_nested_state':
> arch/x86/kvm/svm/nested.c:1536:17: error: array subscript 0 is outside array bounds of 'struct kvm_svm_nested_state_data[0]' [-Werror=array-bounds=]
> 1536 | &user_kvm_nested_state->data.svm[0];
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from include/uapi/linux/kvm.h:15,
> from include/linux/kvm_host.h:40,
> from arch/x86/kvm/svm/nested.c:18:
> arch/x86/include/uapi/asm/kvm.h:511:50: note: while referencing 'svm'
> 511 | struct kvm_svm_nested_state_data svm[0];
> | ^~~
>
> [...]
Applied to kvm-x86 misc, thanks! Based on the linux-next complaint, I assume
you (temporarily?) applied this to your tree as well. Holler if I've confused
you :-)
[1/1] KVM: x86: Replace 0-length arrays with flexible arrays
https://github.com/kvm-x86/linux/commit/2a8c2de0544e
--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes
Powered by blists - more mailing lists