From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753490AbdF0TQV (ORCPT ); Tue, 27 Jun 2017 15:16:21 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:33811 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752963AbdF0TQO (ORCPT ); Tue, 27 Jun 2017 15:16:14 -0400 MIME-Version: 1.0 In-Reply-To: <201706272333.FIsTGv3H%fengguang.wu@intel.com> References: <20170626235122.GA25261@beast> <201706272333.FIsTGv3H%fengguang.wu@intel.com> From: Kees Cook Date: Tue, 27 Jun 2017 12:16:12 -0700 X-Google-Sender-Auth: MvCOpzryEXodK1ynzynU2_YaBr0 Message-ID: Subject: Re: [PATCH] fortify: Avoid panic() in favor of BUG() To: kbuild test robot , Yoshinori Sato , Rich Felker , linux-sh Cc: kbuild-all@01.org, Andrew Morton , Jonathan Corbet , Mika Westerberg , Bjorn Helgaas , Mauro Carvalho Chehab , Heikki Krogerus , Daniel Micay , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 27, 2017 at 8:52 AM, kbuild test robot wrote: > Hi Kees, > > [auto build test WARNING on next-20170619] > [cannot apply to linus/master linux/master v4.12-rc6 v4.12-rc5 v4.12-rc4 v4.12-rc7] > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > url: https://github.com/0day-ci/linux/commits/Kees-Cook/fortify-Avoid-panic-in-favor-of-BUG/20170627-230653 > config: sh-allyesconfig (attached as .config) > compiler: sh4-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705 > reproduce: > wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # save the attached .config to linux build tree > make.cross ARCH=sh > > All warnings (new ones prefixed by >>): > > lib/string.c: In function 'fortify_panic': >>> lib/string.c:986:1: warning: 'noreturn' function does return > } > ^ > > vim +/noreturn +986 lib/string.c > > 94df2904 Rasmus Villemoes 2015-06-25 970 * > 94df2904 Rasmus Villemoes 2015-06-25 971 * Returns pointer to the nul byte at the end of @s. > 94df2904 Rasmus Villemoes 2015-06-25 972 */ > 94df2904 Rasmus Villemoes 2015-06-25 973 char *strreplace(char *s, char old, char new) > 94df2904 Rasmus Villemoes 2015-06-25 974 { > 94df2904 Rasmus Villemoes 2015-06-25 975 for (; *s; ++s) > 94df2904 Rasmus Villemoes 2015-06-25 976 if (*s == old) > 94df2904 Rasmus Villemoes 2015-06-25 977 *s = new; > 94df2904 Rasmus Villemoes 2015-06-25 978 return s; > 94df2904 Rasmus Villemoes 2015-06-25 979 } > 94df2904 Rasmus Villemoes 2015-06-25 980 EXPORT_SYMBOL(strreplace); > b90d6eba Daniel Micay 2017-06-06 981 > b90d6eba Daniel Micay 2017-06-06 982 void fortify_panic(const char *name) > b90d6eba Daniel Micay 2017-06-06 983 { > 8a94b337 Kees Cook 2017-06-26 984 pr_emerg("detected buffer overflow in %s\n", name); > 8a94b337 Kees Cook 2017-06-26 985 BUG(); > b90d6eba Daniel Micay 2017-06-06 @986 } > b90d6eba Daniel Micay 2017-06-06 987 EXPORT_SYMBOL(fortify_panic); This implies that the sh arch doesn't correctly mark their BUG implementation as not returning... I'll send a patch. -Kees -- Kees Cook Pixel Security