Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1356318ybj; Tue, 5 May 2020 18:57:07 -0700 (PDT) X-Google-Smtp-Source: APiQypKj1wc5yBi1FK4PX35OnNpkt2vNtXxQlRI+v4JHc+nCRzy4KKBx4PHUXWjNf6JONXZArcQW X-Received: by 2002:a05:6402:391:: with SMTP id o17mr5084600edv.71.1588730227500; Tue, 05 May 2020 18:57:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588730227; cv=none; d=google.com; s=arc-20160816; b=Oja9TSl7cBe6+DAtL3Wdakg7sZAAnzXy4Eq9Spf8qZzGryD8GPwfqTKgU5s4wH1V96 p9asZFLr5Eogb1fUVZjocl6ELu/7uaAM+/rkPDiklJWWMdNSPv1GHcapLb3bV0q3BFM+ dtMsn0cH0IX14HdrQ1r1KDunLBmMEt9XMOskbdQvm+XQdX43y7SvT7VnatLARdoO6DC0 oj8fUItNFjSripKhHhMtUKfsKpVnz7S1ft9MgNChqlLTKZ+/wZ09i5cG00VdQt9PThDt OwIK7RW1Z/d0rIab54Mnr+c0ZIzCEQCh3QO5lQt+HimmScRTuEsS2EOjmJsv/hGTrWAs wXaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=qmvdG7p6e6Acl9I4vzAwMCDyl5hiqrJddxAfbhxUf2g=; b=yjKvjfzZJw/xxtEQYM7Q9YtL58UJ6VjBeI1VtwHU4JHgQ3bw7c+sfTGEnudUi9cyU3 78WGVIiXFOTKzSuJsVvGch1tG5tG/JtaNNmvc1uhSrzAgRsiE96ZLcDy12HzaNZfpiG5 J8D5CjxLW1iXd8TyXekkwQ35IAYLfnkwC0q2Pt8XOMJ41yk/UG42+FqLa0lUe1+IaNrc 52s1FpA5op+KBkjpBAx7JBM+6uQB/6rnOEjGxvTW+FgLBzYiVc68xwLYQzhvQpapSpcR t2Y/0c/DtkNLD4QCWUwS+tPaGZ6kec4fr8wpjH1KUTIj+gUYnTvkuGSOUdD4DHMyImss RoJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=BVvIl436; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t27si227122edt.100.2020.05.05.18.56.44; Tue, 05 May 2020 18:57:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=BVvIl436; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729885AbgEFBw6 (ORCPT + 99 others); Tue, 5 May 2020 21:52:58 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:15014 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727986AbgEFBw6 (ORCPT ); Tue, 5 May 2020 21:52:58 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1588729977; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=qmvdG7p6e6Acl9I4vzAwMCDyl5hiqrJddxAfbhxUf2g=; b=BVvIl436OAbgimWVljfFR2i5TOm7Q6Zntw1HSJVWTfMgftDxqycaSaZE27/NK61zgJ6CtVAH x3R9NhWwmquz7df/TQiReILdiPYc0kSrIt+HGjhwW6C2npidhVuja3CtQCIz7xiUKTkWMWl3 J2dlFhgi7RkWwkMwv34QGZtfE0I= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5eb2186f.7fc768df54c8-smtp-out-n03; Wed, 06 May 2020 01:52:47 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BFA26C432C2; Wed, 6 May 2020 01:52:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from sidgup-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sidgup) by smtp.codeaurora.org (Postfix) with ESMTPSA id 03105C433CB; Wed, 6 May 2020 01:52:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 03105C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sidgup@codeaurora.org From: Siddharth Gupta To: Masahiro Yamada , Sam Ravnborg Cc: Siddharth Gupta , linux-kernel@vger.kernel.org, maennich@google.com Subject: [PATCH v3] scripts: headers_install: Exit with error on config leak Date: Tue, 5 May 2020 18:52:37 -0700 Message-Id: <1588729957-19164-1-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Misuse of CONFIG_* in UAPI headers should result in an error. These config options can be set in userspace by the user application which includes these headers to control the APIs and structures being used in a kernel which supports multiple targets. Signed-off-by: Siddharth Gupta --- scripts/headers_install.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index a07668a..94a8335 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -64,7 +64,7 @@ configs=$(sed -e ' d ' $OUTFILE) -# The entries in the following list are not warned. +# The entries in the following list do not result in an error. # Please do not add a new entry. This list is only for existing ones. # The list will be reduced gradually, and deleted eventually. (hopefully) # @@ -98,18 +98,19 @@ include/uapi/linux/raw.h:CONFIG_MAX_RAW_DEVS for c in $configs do - warn=1 + leak_error=1 for ignore in $config_leak_ignores do if echo "$INFILE:$c" | grep -q "$ignore$"; then - warn= + leak_error= break fi done - if [ "$warn" = 1 ]; then - echo "warning: $INFILE: leak $c to user-space" >&2 + if [ "$leak_error" = 1 ]; then + echo "error: $INFILE: leak $c to user-space" >&2 + exit 1 fi done -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project