Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1358919ybj; Thu, 7 May 2020 22:43:01 -0700 (PDT) X-Google-Smtp-Source: APiQypLKz5wFGcx8gayTXf4luD7z+xN6eniJOYVouJ7306g+DxBkk0Gw71FEj0UI40rtbdDS1ApS X-Received: by 2002:a17:906:7e19:: with SMTP id e25mr494148ejr.358.1588916581565; Thu, 07 May 2020 22:43:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588916581; cv=none; d=google.com; s=arc-20160816; b=KuE/pY1gJVUFmeWvlIXJC+SHqhciO+nXAr+wxcGHSo0Bd5BzSVW0T6BysYeUwZG/Gj oKDb0M9nG3IVK1IbXFH1QrQNIWYjFH3na3jnxIltsJpf4yMdPg0WmihG8N9PoAXnTHbK jCnBEWpTJviS9rNCWFulh2W4ALhWSFhYOuqOlrk6Mj9fFokZu/a3pe4BoXnE9mcqKMnO Arit3Fey3yiDAGohuRz8ERtSEYJi+K62IFvcCw4OkH7jQhkYOWfBa7cjPnlYQHMw+c8Y a2Oww95OdbQiFSki1Q5K56V3tVtMUj8r6XnruPDKCcGrvHpA3qxxRRg+JV9/fw3Ss3h4 kTFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=SqKr69BWgpV8udoi/Flc/nNEFYVLgHRZP6ZiW69HDQQ=; b=iOg7xDXPsvWCNlP/gRe76a5mUfTLaNEtcR0RGWfwCSc/I4YzSdVfLCX/bDZjqu/uzd H6kiX28Pj1Zx/XsuzKw8RTEMLqwRyLWrnO+ujmToq8YDxu9YOqxmNiToHYGkY4P4ps3X 1dsEpVPEpSBleYe/LMX4gwjdKA6MnIfHGdDOhLdQAScDw4IGaGGKz7A7n3ySn6onumTh tfi2xA1xMI/B+6tabE/2N8ZEy58EcxlYszOOQZQdSCLd7Gn2+xWwPfjHqzCHBFsfSjAa YOC31SrNYMFN/w9BGEtLSL19CrLv6kmsRuYuUAbzMvVl/UW0m4opZq8Awc1oEMNcd2zE 8hJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BYPavCJd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c13si412633edq.97.2020.05.07.22.42.39; Thu, 07 May 2020 22:43:01 -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=pass header.i=@nifty.com header.s=dec2015msa header.b=BYPavCJd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbgEHFjZ (ORCPT + 99 others); Fri, 8 May 2020 01:39:25 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:34644 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbgEHFjY (ORCPT ); Fri, 8 May 2020 01:39:24 -0400 Received: from mail-vk1-f176.google.com (mail-vk1-f176.google.com [209.85.221.176]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 0485dAgs031709 for ; Fri, 8 May 2020 14:39:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 0485dAgs031709 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1588916351; bh=SqKr69BWgpV8udoi/Flc/nNEFYVLgHRZP6ZiW69HDQQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BYPavCJdDx9mWU/oYwDFRkdGBtMHQLhI4ehXr7WRmITBv5v2PKwD6ptkpn1+Mu0id fpxv2lZJdBw1o8dCt9IL+D/bBPucLIKGMFI1RF4mq/6J7FtpcMwmlfpFvJN19e+Yu/ ePIji5FU3kBkKasUqseZbbALnD8UmmbKG3p6XqgH8vnf2Avwzn2dX3hdmvl9TmaY/n xk4YPQAMW4c+ZsI3r46vCHHqoZtIFPiCKTsi+VZjBeg6olxm76MlcIq6dirxS8yjeH TtsLe7mvNkJO/kdnFZk3B8FZgw9v+egP/aM/pOmJrLOOJ6Xgx0NORotCq1xMgj3USf b9hP9EADz5xWw== X-Nifty-SrcIP: [209.85.221.176] Received: by mail-vk1-f176.google.com with SMTP id w188so133393vkf.0 for ; Thu, 07 May 2020 22:39:11 -0700 (PDT) X-Gm-Message-State: AGi0PuZQJJN8IImKMWfR2KyxS4qLiVZsr7VKj/RutG+XYl8m9WtIORzv t7dvemuZrZTjg3jiVIGoFV/mPz8tQ4RhBWgVsuA= X-Received: by 2002:a1f:1ed1:: with SMTP id e200mr501090vke.96.1588916350322; Thu, 07 May 2020 22:39:10 -0700 (PDT) MIME-Version: 1.0 References: <1588729957-19164-1-git-send-email-sidgup@codeaurora.org> In-Reply-To: <1588729957-19164-1-git-send-email-sidgup@codeaurora.org> From: Masahiro Yamada Date: Fri, 8 May 2020 14:38:34 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] scripts: headers_install: Exit with error on config leak To: Siddharth Gupta Cc: Sam Ravnborg , Linux Kernel Mailing List , Matthias Maennich Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 6, 2020 at 10:53 AM Siddharth Gupta wrote: > > 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 Applied to linux-kbuild. Thanks. > --- > 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 -- Best Regards Masahiro Yamada