From patchwork Tue Jun 27 19:20:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9812983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 09AD26020A for ; Tue, 27 Jun 2017 19:20:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F10602842A for ; Tue, 27 Jun 2017 19:20:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E574128701; Tue, 27 Jun 2017 19:20:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BA1B2842A for ; Tue, 27 Jun 2017 19:20:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbdF0TUx (ORCPT ); Tue, 27 Jun 2017 15:20:53 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:36417 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752963AbdF0TUw (ORCPT ); Tue, 27 Jun 2017 15:20:52 -0400 Received: by mail-pf0-f169.google.com with SMTP id q86so21132075pfl.3 for ; Tue, 27 Jun 2017 12:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=YiRs7OZdFZOsC50o8fnZf3fA+/afzE4RquH04yIMKqw=; b=hzSF3EkziQNSulkKBfPrMxWosro3YeQ9ZxFoWbqZoBu4+xTC0/ZkqrwcdE9+/Mj/yN pfitEysfz5lVGU+SQnK3DC1T8oKKUzfFHvV3CQVRxY8U3E6gOSDgBKVAybCVcO5QiweK g044EPp8ko4HM1CA9YqZkp5IOkCzf7qqypmvA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=YiRs7OZdFZOsC50o8fnZf3fA+/afzE4RquH04yIMKqw=; b=eEsKsKcK2CHY6Nndvy04LVxnR/Ckfw96r9EdC3C43ZSFRAynMOQLRSwmwA956YvxYr G1Dm/iM4hyNWrIuwGP1qUBcbOzdNPXic0z0ESY23QoGjCfhEmIlyE/y1juSXu3uIkrOw VULajC6ccFahxHzVcZ7tRCcXb67t91sAYa5039Y5P+im+lmw2UC8NVnr0pF3vFkuVVat 1Xqqw6ga2VZaJoizH+puGNe9ycVOwtgEIYo+MEFkzoqOjp4xNFO6O0QgWVcUsVyQCb5j V+Y3f1AI4xnfO61CgfF3BOq9/ZOX0QUXKvzMdPZ5e1z7ky8yRFQLGKvyD0HWpeSRmhCa LIYg== X-Gm-Message-State: AKS2vOxUIsaOMOtwGbPNvms+HLKA9wN1taXUeYdvRa+AtpuXHgKPDkFh RR1+QlR2f3HLRaW5 X-Received: by 10.84.205.70 with SMTP id o6mr7522171plh.32.1498591251821; Tue, 27 Jun 2017 12:20:51 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id w85sm50939pfj.115.2017.06.27.12.20.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jun 2017 12:20:51 -0700 (PDT) Date: Tue, 27 Jun 2017 12:20:50 -0700 From: Kees Cook To: Andrew Morton Cc: Yoshinori Sato , Rich Felker , Peter Zijlstra , Ingo Molnar , linux-sh@vger.kernel.org, Daniel Micay , linux-kernel@vger.kernel.org Subject: [PATCH] sh: mark end of BUG() implementation as unreachable Message-ID: <20170627192050.GA66784@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building the sh architecture, the compiler doesn't realize that BUG() doesn't return, so it will complain about functions using BUG() that are marked with the noreturn attribute: lib/string.c: In function 'fortify_panic': >> lib/string.c:986:1: warning: 'noreturn' function does return } ^ Cc: Yoshinori Sato Cc: Rich Felker Cc: Daniel Micay Signed-off-by: Kees Cook --- arch/sh/include/asm/bug.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h index 1b77f068be2b..c9828f785ca0 100644 --- a/arch/sh/include/asm/bug.h +++ b/arch/sh/include/asm/bug.h @@ -48,6 +48,7 @@ do { \ "i" (__FILE__), \ "i" (__LINE__), "i" (0), \ "i" (sizeof(struct bug_entry))); \ + unreachable(); \ } while (0) #define __WARN_FLAGS(flags) \