From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756293AbdEGWAe (ORCPT ); Sun, 7 May 2017 18:00:34 -0400 Received: from terminus.zytor.com ([65.50.211.136]:58001 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753792AbdEGWAa (ORCPT ); Sun, 7 May 2017 18:00:30 -0400 Date: Sun, 7 May 2017 02:04:48 -0700 From: tip-bot for Kees Cook Message-ID: Cc: linux-kernel@vger.kernel.org, danielmicay@gmail.com, hpa@zytor.com, keescook@chromium.org, tglx@linutronix.de, torvalds@linux-foundation.org, peterz@infradead.org, mingo@kernel.org Reply-To: torvalds@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, danielmicay@gmail.com, hpa@zytor.com, keescook@chromium.org In-Reply-To: <20170506045116.GA2879@beast> References: <20170506045116.GA2879@beast> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/boot: Declare error() as noreturn Git-Commit-ID: 60854a12d281e2fa25662fa32ac8022bbff17432 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 60854a12d281e2fa25662fa32ac8022bbff17432 Gitweb: http://git.kernel.org/tip/60854a12d281e2fa25662fa32ac8022bbff17432 Author: Kees Cook AuthorDate: Fri, 5 May 2017 21:51:16 -0700 Committer: Ingo Molnar CommitDate: Sun, 7 May 2017 10:59:05 +0200 x86/boot: Declare error() as noreturn The compressed boot function error() is used to halt execution, but it wasn't marked with "noreturn". This fixes that in preparation for supporting kernel FORTIFY_SOURCE, which uses the noreturn annotation on panic, and calls error(). GCC would warn about a noreturn function calling a non-noreturn function: arch/x86/boot/compressed/misc.c: In function ‘fortify_panic’: arch/x86/boot/compressed/misc.c:416:1: warning: ‘noreturn’ function does return } ^ Signed-off-by: Kees Cook Cc: Daniel Micay Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: H. Peter Anvin Link: http://lkml.kernel.org/r/20170506045116.GA2879@beast Signed-off-by: Ingo Molnar --- arch/x86/boot/compressed/error.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/error.h b/arch/x86/boot/compressed/error.h index 2e59dac..d732e60 100644 --- a/arch/x86/boot/compressed/error.h +++ b/arch/x86/boot/compressed/error.h @@ -1,7 +1,9 @@ #ifndef BOOT_COMPRESSED_ERROR_H #define BOOT_COMPRESSED_ERROR_H +#include + void warn(char *m); -void error(char *m); +void error(char *m) __noreturn; #endif /* BOOT_COMPRESSED_ERROR_H */