From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d8EDi-0003sZ-U5 for kexec@lists.infradead.org; Tue, 09 May 2017 23:07:08 +0000 Received: by mail-pf0-x229.google.com with SMTP id m17so6853447pfg.3 for ; Tue, 09 May 2017 16:06:41 -0700 (PDT) Date: Tue, 9 May 2017 16:06:39 -0700 From: Kees Cook Subject: [PATCH] kexec_file: Adjust type of kexec_purgatory Message-ID: <20170509230639.GA132135@beast> MIME-Version: 1.0 Content-Disposition: inline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: linux-kernel@vger.kernel.org Cc: Daniel Micay , kexec@lists.infradead.org, Eric Biederman Defining kexec_purgatory as a zero-length char array upsets compile time size checking. Since this is entirely runtime sized, switch this to void *. This silences the warning generated by the future CONFIG_FORTIFY_SOURCE, which did not like the memcmp() of a "0 byte" array. Cc: Daniel Micay Signed-off-by: Kees Cook --- kernel/kexec_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index b118735fea9d..bc86f85f1329 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -30,7 +30,7 @@ * Declare these symbols weak so that if architecture provides a purgatory, * these will be overridden. */ -char __weak kexec_purgatory[0]; +void * __weak kexec_purgatory; size_t __weak kexec_purgatory_size = 0; static int kexec_calculate_store_digests(struct kimage *image); -- 2.7.4 -- Kees Cook Pixel Security _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751172AbdEIXGn (ORCPT ); Tue, 9 May 2017 19:06:43 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:35146 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750733AbdEIXGl (ORCPT ); Tue, 9 May 2017 19:06:41 -0400 Date: Tue, 9 May 2017 16:06:39 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Eric Biederman , kexec@lists.infradead.org, Daniel Micay Subject: [PATCH] kexec_file: Adjust type of kexec_purgatory Message-ID: <20170509230639.GA132135@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Defining kexec_purgatory as a zero-length char array upsets compile time size checking. Since this is entirely runtime sized, switch this to void *. This silences the warning generated by the future CONFIG_FORTIFY_SOURCE, which did not like the memcmp() of a "0 byte" array. Cc: Daniel Micay Signed-off-by: Kees Cook --- kernel/kexec_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index b118735fea9d..bc86f85f1329 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -30,7 +30,7 @@ * Declare these symbols weak so that if architecture provides a purgatory, * these will be overridden. */ -char __weak kexec_purgatory[0]; +void * __weak kexec_purgatory; size_t __weak kexec_purgatory_size = 0; static int kexec_calculate_store_digests(struct kimage *image); -- 2.7.4 -- Kees Cook Pixel Security