From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AD01C433DF for ; Thu, 8 Oct 2020 20:05:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E5EE22226 for ; Thu, 8 Oct 2020 20:05:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bBDNCeAg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729937AbgJHUFV (ORCPT ); Thu, 8 Oct 2020 16:05:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729860AbgJHUFU (ORCPT ); Thu, 8 Oct 2020 16:05:20 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 150BAC0613D2 for ; Thu, 8 Oct 2020 13:05:19 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id i2so5245382pgh.7 for ; Thu, 08 Oct 2020 13:05:19 -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:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=kRozOJcU/8V0BnQ/n2Fog1pXhHDXJtLHefk6yYZwAN8=; b=bBDNCeAgq1I7erOfy25vjMcgnkKPvmMlPtfxklCapNKDiUnlbOFdutmLvIAdlyM7K5 d/YzuPSsYdWgiIVw6M81k6GKubvBuUtqHWcxNneMwH8+3t5VdU89+kxsRx/0JWrl0X1v FfQIAC/NDJ752DsDg3F6aKUoHwGy1jHzB0Jgw= 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:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=kRozOJcU/8V0BnQ/n2Fog1pXhHDXJtLHefk6yYZwAN8=; b=YPFaau65BAx7oIaRKtqkfPPpKpqoHBP/Y/XwHirqgOwUkuU6slET34j3PIvmAQlA0z aUdl181E3W2qljwbu37xGEtRoUUNQHNDidmp/BZymA1PO1Eo/+T0eA7rTeh969FF/quj 6AlZm5Uj7OCIGe1iHK+qIGWVaCMyvvXerKy1vkofRouDWjxC1/vJsQ465tOp43GUZJ+I EvWK/Rgx2GhwhKYOFFGnJZLueiW0PjjeXQM4vIDrv92WBXxXeTdCSB2PdZsy8SGStgSj 1vegrnt4SM7bRJezhCqmhPo691+00eMUghwo4b4p9kpc7QevL3UtsbIe2kFWawj2oogf t8tw== X-Gm-Message-State: AOAM531mTUgnHtmyGlWJe6EsscvOpvvHwDkRoxJCmJuyWF4Ur8HnXOje QpxY5gEgGvUQ6FV/yh06/haSJw== X-Google-Smtp-Source: ABdhPJzAJp9mz1b2kvn/8cvjH2bFw3wc5OktyHnOltsWM0NhPa5ahuymaawPuutDX6+tJ4KwBfd8tA== X-Received: by 2002:a63:584e:: with SMTP id i14mr451658pgm.329.1602187518509; Thu, 08 Oct 2020 13:05:18 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j19sm8237222pfe.108.2020.10.08.13.05.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 13:05:16 -0700 (PDT) Date: Thu, 8 Oct 2020 13:05:15 -0700 From: Kees Cook To: Tommi Rantala Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan Subject: Re: [PATCH 01/13] selftests: filter kselftest headers from command in lib.mk Message-ID: <202010081305.32C244AB5@keescook> References: <20201008122633.687877-1-tommi.t.rantala@nokia.com> <20201008122633.687877-2-tommi.t.rantala@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201008122633.687877-2-tommi.t.rantala@nokia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2020 at 03:26:21PM +0300, Tommi Rantala wrote: > Commit 1056d3d2c97e ("selftests: enforce local header dependency in > lib.mk") added header dependency to the rule, but as the rule uses $^, > the headers are added to the compiler command line. > > This can cause unexpected precompiled header files being generated when > compilation fails: > > $ echo { >> openat2_test.c > > $ make > gcc -Wall -O2 -g -fsanitize=address -fsanitize=undefined openat2_test.c > tools/testing/selftests/kselftest_harness.h tools/testing/selftests/kselftest.h helpers.c > -o tools/testing/selftests/openat2/openat2_test > openat2_test.c:313:1: error: expected identifier or ‘(’ before ‘{’ token > 313 | { > | ^ > make: *** [../lib.mk:140: tools/testing/selftests/openat2/openat2_test] Error 1 > > $ file openat2_test* > openat2_test: GCC precompiled header (version 014) for C > openat2_test.c: C source, ASCII text > > Fix it by filtering out the headers, so that we'll only pass the actual > *.c files in the compiler command line. > > Fixes: 1056d3d2c97e ("selftests: enforce local header dependency in lib.mk") > Signed-off-by: Tommi Rantala Ah yes, thanks! Acked-by: Kees Cook -- Kees Cook