From patchwork Mon Jun 18 17:45:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Joachim X-Patchwork-Id: 10472451 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 D37136029B for ; Mon, 18 Jun 2018 17:45:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3DC428B56 for ; Mon, 18 Jun 2018 17:45:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B45C028B59; Mon, 18 Jun 2018 17:45:33 +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=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 3F66828B56 for ; Mon, 18 Jun 2018 17:45:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935319AbeFRRpc (ORCPT ); Mon, 18 Jun 2018 13:45:32 -0400 Received: from mout.gmx.net ([212.227.17.22]:37407 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935127AbeFRRpc (ORCPT ); Mon, 18 Jun 2018 13:45:32 -0400 Received: from localhost.localdomain ([79.223.58.86]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lv8hi-1gCArt2mHK-010N3z; Mon, 18 Jun 2018 19:45:27 +0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 581DF80086; Mon, 18 Jun 2018 19:45:25 +0200 (CEST) From: Sven Joachim To: Masahiro Yamada , linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] stack-protector: Fix test with 32-bit userland and CONFIG_64BIT=y Date: Mon, 18 Jun 2018 19:45:25 +0200 Message-ID: <874li0vvii.fsf@turtle.gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 X-Provags-ID: V03:K1:IN6nUA+QVZukyq9YCHyDGeJDh4lM5NQgTAfrNCow300piJ6HFdn z794e82z7fS/KuZnLBMlPR2Cv20bTUdMIdwwspuxs+BX9v8ldMbhGRQva5uHXYfUJ/fX6Ua 1SgknFaq8xRGSj3mlhXZSiKJqhP/JXOB0DoAqcIpi/crwQ0Tn9AN7fqFVRiL7QCqJQFPkjM gEoDAeweJnQybiFqHnozQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:M2HWkV7eP2k=:peVJ+dj+YAEuaXhAPc3Yek 1IDRK7IaGjQHxF0eQKvcV4yNkZT/MyFYVIMggxTfCAeF0E3u7n80jlT9EqueJYXNzdrjxOpXC 8X4DLaYmUym0m4bGG0sAuHREVNCHwJoa2j8Ar3qHu8h348H0OFF1bE9gFuldDTgImhVrMI3UU EF5FGZnF2PiRbY0iF7e1O4Wm7kJm4W42jMXem+V6+enhl7ywuRkyy9H5rQ1y/zH70fAXcqJ1z +qhHgjwH5epbJk1qv4yCA1CrtrTOiwtKwg2oSQmmy8UQpgnzml/zviQcaIS5qgAwmx+DsyeQ/ NMB50u9YC3LT5hwnnWaotwOAFe5XjUY+tJ9gtPmH5D3eLQ7wyRjFvuXrbaxXYCEVrDzf3YdTX UkobTsz7PiftuqBl4UQqUW710QVoD6LIObJCel6N4ieSL+VDYHtRS7Kq1E6vp+rjQV0YZZHkn 2cHcgdgFFN9a+5vO+tZtiTtJWjef/8/njQ4C2QFd2ULyNn7TjKzT141zNJE0iJ23fpQf7HSrq TdYSG0Xf6UaZ+z7PeoofBHzuzs+dnipCru5nS/iaA/rZBpMIBx+A8OXffsiNGBNJjRfL2hy2n +KZF5S8k466r0A+dqq8oH3iy4QF/GOoSB8Z4NHq/+XBLKNwwSZVOgwJujh7j/ZKiV0LptbK68 WFuNb+KfoRa7deumPZPfGJ0+aAXifv1vfg9kT5AKgXKibVyiKBqAlKrxbM3tFAI+PpQ7nTagj zGOWb/lfoQXnrzdPdwg84qCsK9/jedc9zCpa0CEGOnIkMZnGqN4KaJ3dStPeaJT72dXAofsQZ 1E6Np7y Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building a 64-bit 4.18-rc1 kernel with a 32-bit userland, I noticed that stack protection was silently disabled. Adding -m64 in gcc-x86_64-has-stack-protector.sh fixed that, similar to what has been noticed in commit 2a61f4747eea ("stack-protector: test compiler capability in Kconfig and drop AUTO mode") for gcc-x86_32-has-stack-protector.sh. Signed-off-by: Sven Joachim --- scripts/gcc-x86_64-has-stack-protector.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gcc-x86_64-has-stack-protector.sh b/scripts/gcc-x86_64-has-stack-protector.sh index 3755af0cd9f7..75e4e22b986a 100755 --- a/scripts/gcc-x86_64-has-stack-protector.sh +++ b/scripts/gcc-x86_64-has-stack-protector.sh @@ -1,4 +1,4 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 -echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs" +echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -m64 -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs"