From patchwork Tue Dec 19 19:23:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 10123977 X-Patchwork-Delegate: johannes@sipsolutions.net 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 9115A60390 for ; Tue, 19 Dec 2017 19:23:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 841C928912 for ; Tue, 19 Dec 2017 19:23:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 775622951E; Tue, 19 Dec 2017 19:23:26 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable 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 1CB6728912 for ; Tue, 19 Dec 2017 19:23:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752330AbdLSTXN (ORCPT ); Tue, 19 Dec 2017 14:23:13 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:33807 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbdLSTXM (ORCPT ); Tue, 19 Dec 2017 14:23:12 -0500 Received: by mail-it0-f66.google.com with SMTP id m11so9238307iti.1 for ; Tue, 19 Dec 2017 11:23:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=NMOUeoPGsKxlUM6pOUeHyiCYUGHuTjRE0WHRU6daW88=; b=DBZ27/4QHhgr4eZm8xKdjQI8NVGrqdQ6FBd5qEWJK7+buE49P1n0dZPP/qK+pGocRJ YaUkI0Ey9e301O2f+XHeYC2wBOLNeqeOMco9s23Ncwpp51ArgGitgU4wD16ZyDKDSAKq z7RSbufO94y279QaCOyDwYVuXK+UMEg6SHlWo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NMOUeoPGsKxlUM6pOUeHyiCYUGHuTjRE0WHRU6daW88=; b=rRva3KRT/yJuT1tyXHhvHleunwy4ZADYA7Ca76jc2y66eYr1IrK155d23zSr8JKE1a db5viqSRq/miqe24AiBLk8K+QaesPVCer7IQw9LD6Lv52AKike6MI3F2tB/7gTw83noa In3pPS9Lu9kPpjtze97VCXYqR1RvEtP69CPLbUfh2lQT0eu4Tz2xw91NvIC/HUtQ6wz9 2tmceMnT32Qss5BNTlqu1Fl53dqKFbMcW3mcCSoK3DKX1YsFzqjBMha5lkwsJ7jWf459 PI4bqmXBcdokHQLwntU0lUoepbx6v/Fo+P9m3eusifU7MHaO2gtRh4GWJd0wBYLc2ONr pRbQ== X-Gm-Message-State: AKGB3mKNmElfiH5algD61+zU5fw4wwHOahJB1SxyI+aN/XAmkCgq3Kbe 4A+KyuMsiCKHQG0qvqdOzMGP3w== X-Google-Smtp-Source: ACJfBosmWaZ3qKZ7AXh4lPRRWRhx7o9npwSRsz3c8K/CBp5hJzoh4z1N/Rxz5A/2mULP5lLa2P7v8Q== X-Received: by 10.36.190.199 with SMTP id i190mr4391053itf.84.1513711391499; Tue, 19 Dec 2017 11:23:11 -0800 (PST) Received: from ban.mtv.corp.google.com ([172.22.113.17]) by smtp.gmail.com with ESMTPSA id p68sm1486177itc.26.2017.12.19.11.23.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Dec 2017 11:23:10 -0800 (PST) From: Brian Norris To: Johannes Berg Cc: , linux-wireless@vger.kernel.org, Paul Menzel , Damian Tometzki , Brian Norris Subject: [PATCH for-4.15] wireless: create, don't append, to shipped-certs.c Date: Tue, 19 Dec 2017 11:23:03 -0800 Message-Id: <20171219192303.31395-1-briannorris@chromium.org> X-Mailer: git-send-email 2.15.1.504.g5279b80103-goog Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current rule for generating the {shipped,extra}-certs.c source files might create an invalid C source file, containing redefinitions of the same variables: CC [M] net/wireless/shipped-certs.o net/wireless/shipped-certs.c:686:10: error: redefinition of 'shipped_regdb_certs' const u8 shipped_regdb_certs[] = { ^ net/wireless/shipped-certs.c:2:10: note: previous definition of 'shipped_regdb_certs' was here const u8 shipped_regdb_certs[] = { ^ net/wireless/shipped-certs.c:1368:14: error: redefinition of 'shipped_regdb_certs_len' unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs); ^ net/wireless/shipped-certs.c:684:14: note: previous definition of 'shipped_regdb_certs_len' was here unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs); ^ This can be easily triggered by forcing a rebuild of these files: $ touch net/wireless/certs/sforshee.x509 $ make In practice, this is seen often by having a separate source and build directory, where the build artifacts remain but the source tree changes (even if Seth's cert doesn't change, it might get created/removed when checking out different source revisions). I don't see why this rule should be an append; we're writing the file all in one go. Fixes: 90a53e4432b1 ("cfg80211: implement regdb signature checking") Signed-off-by: Brian Norris --- This is an error introduced in 4.15-rc1. I've seen other errors reported by Paul and Damian (CC'd); I think Paul's failure was fixed already, but Damian might have still been having problems with not having a "clean" environment. Perhaps he was hitting this bug? net/wireless/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/wireless/Makefile b/net/wireless/Makefile index d7d6cb00c47b..b662be3422e1 100644 --- a/net/wireless/Makefile +++ b/net/wireless/Makefile @@ -43,7 +43,7 @@ $(obj)/shipped-certs.c: $(wildcard $(srctree)/$(src)/certs/*.x509) echo "$$allf"; \ echo '};'; \ echo 'unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs);'; \ - ) >> $@) + ) > $@) $(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR:"%"=%) \ $(wildcard $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR:"%"=%)/*.x509) @@ -66,4 +66,4 @@ $(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR:"%"=%) \ echo "$$allf"; \ echo '};'; \ echo 'unsigned int extra_regdb_certs_len = sizeof(extra_regdb_certs);'; \ - ) >> $@) + ) > $@)