From patchwork Tue Oct 17 15:52:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10012347 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 E298D600CC for ; Tue, 17 Oct 2017 15:52:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CED1D28911 for ; Tue, 17 Oct 2017 15:52:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2E452894D; Tue, 17 Oct 2017 15:52:59 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 645F128911 for ; Tue, 17 Oct 2017 15:52:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965239AbdJQPw6 (ORCPT ); Tue, 17 Oct 2017 11:52:58 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:49740 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965237AbdJQPw4 (ORCPT ); Tue, 17 Oct 2017 11:52:56 -0400 Received: by mail-oi0-f66.google.com with SMTP id w197so3744491oif.6; Tue, 17 Oct 2017 08:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=IOznijaTFA4KIPOZIwTteiAX8HrLuSh2cd4NM4MQDAU=; b=sF0CaHQ2pLqTzJi28vy3HFnKkii0giXT74lgbC3jFJQH6m3Ui+d90EQBqscI6PhDXn x3xXH0ahPWiqZxIv/0b3xVv1zlDYCZtQYoYU65aNzxWU5zQJYCJH0iNWB4Gp9GlbbUXn TliewH7T5JFndpvQtOQ5Ujp976SbpuxBrQj2RGD6dYeJ7KSV1aL46GXYpvcUIbH92ay3 SOv1HTvkTLpmz4gyjsu5QqXPt0fc2LQH09TAKJVyvb7fts/RlEkw//4CVqrUQjI2lPHc 46GdOZIkNBw/u2tMd4sew6a4tDqsjghst1gxQQAEGjZtbJAxOFC3wkvfdDl6HEB6aaNg miRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=IOznijaTFA4KIPOZIwTteiAX8HrLuSh2cd4NM4MQDAU=; b=iHDj+yXCYDMRjIwZL5o9ralfBrXzv80TzJEzEQYX2n1/3Qf+CKtO0wSbkJz4L0Dh0n DePhZ7Zw3Ogb5SuiFeGd32xgWQHS4msJuL+akjdKD++F2wtOrHTMoRhr4otcpzeB37Ea POrLk0hk3Rq/zReIGuu4nVkJGTErUlQYinUUqdu42r7hIDpP7N0Ix3IbSejo0jO9Ezm+ YgpIG5mJYKM2WAjzfW7Z07v2Jv9zPJyX7Ddv/kqM2c6Vs3Vl1rlw5Pnj1FctPA8Xcfgm zYbn39JtzkggjO+wOE0F8v8pBNG+Kwe0WiJi/S+bKHEWhF4wvfXTgyaZ49FWbj9fFSTZ nPdQ== X-Gm-Message-State: AMCzsaUDZUQxU9S3n5fV+rJwJiu1P6UiYWoJAc6KJrRbMqayB0VzWDuU 74HInUvTKVoO9mWvzldifAopcrn5sCQ8bTQSf2s= X-Google-Smtp-Source: ABhQp+RoSmj959BIoaNLfqkAr2OeSdwHtjREoAKmchF1vMqTdj5HBD7OUnCFHqC+bPe97Sa28H/CAlshQTPVTxFdUV4= X-Received: by 10.202.230.18 with SMTP id d18mr7474348oih.61.1508255575866; Tue, 17 Oct 2017 08:52:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.28.152 with HTTP; Tue, 17 Oct 2017 08:52:55 -0700 (PDT) In-Reply-To: References: From: Arnd Bergmann Date: Tue, 17 Oct 2017 17:52:55 +0200 X-Google-Sender-Auth: 1APj2T4rGEXduvhskHaWLZMR--s Message-ID: Subject: Re: more build problems with "Makefile: move stackprotector availability out of Kconfig" To: Kees Cook Cc: Mark Brown , Andrew Morton , Linux Kernel Mailing List , Linux Kbuild mailing list 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 On Tue, Oct 17, 2017 at 5:34 PM, Kees Cook wrote: > On Tue, Oct 17, 2017 at 8:26 AM, Kees Cook wrote: >> On Tue, Oct 17, 2017 at 8:23 AM, Arnd Bergmann wrote: >>> On Tue, Oct 17, 2017 at 1:00 PM, Arnd Bergmann wrote: >>>> Hi Kees, >>>> >>>> On my test box, current linux-next kernels fail to build due to the >>>> patch that introduces CONFIG_CC_STACKPROTECTOR_AUTO, with my mainline >>>> gcc >>>> builds up to gcc-5.5.0. gcc-6 and higher work fine, as >>>> scripts/gcc-x86_64-has-stack-protector.sh returns 'y' for those. >>>> >>>> Using the compilers provided by Ubuntu (4.6/4.7/4.8/4.9), everything >>>> also works as expected, so my interpretation is that mainline gcc did >>>> not enable the stack protector until gcc-6, while distributions did. >>>> >>>> Do you agree with that interpretation? >>> >>> It's probably a little different. I tried bisecting the gcc commit that fixed >>> the issue for me, and ended up with this commit >>> >>> https://gitlab.indel.ch/thirdparty/gcc/commit/c14bac81551d6769741c2b1cc55e04d94fe8d3a7 >>> >>> that caused the target to change from x86_64-unknown-linux to >>> x86_64-pc-linux, and apparently caused the compiler bootstrap >>> to incorrectly identify the capabilities of the assembler. As a result, >>> the assembler output inside of scripts/gcc-x86_64-has-stack-protector.sh >>> that should be >>> [snip] >> >> Yeah, %gs: vs __stack_chk_guard global. >> >> Do you know which gccs (of the past) had this? >> >> akpm's build error is different still, there are no warnings at all >> and then the build fails with missing __stack_chks. I'm still trying >> to figure that one out. > > Oh, I think I know what's happening. I'm going to try to simulate this > and send another patch for testing... > > (I'm still curious about the compiler versions, since my gcc 4.4.4 > works fine for stack-protector.) I've managed to reduce the change that fixed it to this bit in the compiler sources: index dbfb978..d5bc694 100755 I still don't know why that makes a difference, but all versions prior to gcc-6.1 have the problem for me. Arnd --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/config.guess +++ b/config.guess @@ -1021,7 +1021,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC}