Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3324900ybz; Mon, 4 May 2020 00:21:18 -0700 (PDT) X-Google-Smtp-Source: APiQypK/ReAe8qldWUJRP5+0BLGuGJdq+qmXE+LdTc8A0/WZ3ycA3hkUw3M8vRku9zEWj4HxzbGN X-Received: by 2002:a05:6402:1a2f:: with SMTP id be15mr13609052edb.385.1588576878082; Mon, 04 May 2020 00:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588576878; cv=none; d=google.com; s=arc-20160816; b=nKQzds0A5VC4ARdjXhAxWnrRlcH4M8l4+I2JEI4jbepEGAdSn6FQOfW1MZeD6ZXW3k fPZ4oDgi2p58ugqRaS8pou51fmV2mR/f5IzppdiJVnSFCTPnaUzi+m9ihmvEDW2Zr1Gv /deUnAsUe3xa78Kacvmfirrfx6kdbWf2zgzeO/Po2StzX+9KJiVBivKiapQopIsiiucu QnLo1qV4bMtTXqAFUIM4rP4fOh2oSWWD69Wfyee4mKWZ7SC3tAxIPn6CVlnTWXW7CSae wJi5XP6YO/BS6ZlDz6zoOCyXmz9WTp8reVNcrHnCUgApAGBfYsuVYYYtFH7OdO9j6Srp cK5Q== 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=Si+uHh7+JIQDmUm173RyRUWl4SOLFbyk0wxcbPR9Eng=; b=iNW/ytT0NdAENwWEfFoPKB8Eh+84KWJt2xE87nkc9qODgRYe+EMivXAA6M5gAGot4t LyI8s7AHBXafpEvSw56VPxSDBzVRAaviJw3syG1105EcXw7vrHmXeqlCcnQVaW/CbYp6 lal7klTRDLZm99SZcbVQH8GDDCkZ2seDT/evXn5RMvgTXxp9VXUrnfeUg6uaq5XusMuL GKIVTq8XHvyG/tUdDe9/epFO9nN1PyKDMt17ZdCS0d8GqvbJxvIZJ7RMO2KW6pqRup6j XSwc/3LYD8g4F6OqpuPrAxKrNMfmYy2TtRK3np7f0xwueKTayhoA8C/2Y7MUeGgxOZKL 8KSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QJB2PJEo; 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 h4si6188918edv.521.2020.05.04.00.20.55; Mon, 04 May 2020 00:21:18 -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=QJB2PJEo; 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 S1727116AbgEDHTI (ORCPT + 99 others); Mon, 4 May 2020 03:19:08 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:36590 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbgEDHTI (ORCPT ); Mon, 4 May 2020 03:19:08 -0400 Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com [209.85.222.46]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 0447IqMq019915 for ; Mon, 4 May 2020 16:18:53 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 0447IqMq019915 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1588576733; bh=Si+uHh7+JIQDmUm173RyRUWl4SOLFbyk0wxcbPR9Eng=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QJB2PJEoO2SlXyapAnkLthBSlF9o5alXfMYFBiQ7M7HzmN9+lhj6/ypahR+uZbvid x+zKE0C7hdQwNpW4gib9zsxXbEXb5YPeOYFHHcQXNw+qXCnEnoiSHfan+CkBihE5mV EP5VPIQnXA0qB+mooAd5GPzhKM3qwi09nvh2azFi12LNN1S1YXLvmzetZN5N5eaWEJ KQWG2IvHrW6s7cHbft+i5Yk+vJsFfO0ULwlhjl6RLW2jEwZ3CLWZxsz9S7QESanRYQ 3i5wzPlrJabfO4b9qrnyNf5pvPIMBnkDgQhg9uH9VYwQl9+fVjkC2cnUjDjnSkJ1aE wNDDEuLN4aAwg== X-Nifty-SrcIP: [209.85.222.46] Received: by mail-ua1-f46.google.com with SMTP id z16so6166449uae.11 for ; Mon, 04 May 2020 00:18:53 -0700 (PDT) X-Gm-Message-State: AGi0Puaa2ooZpIRY21/Q44N85qv5kY9QKmTy9SAXMWrff318op/F88iM Ha0Vy97ejrlZNbX6WWuXhpajh9S04TvwDkiSVCM= X-Received: by 2002:ab0:69c9:: with SMTP id u9mr10567025uaq.121.1588576731993; Mon, 04 May 2020 00:18:51 -0700 (PDT) MIME-Version: 1.0 References: <1588476545-21082-1-git-send-email-sidgup@codeaurora.org> In-Reply-To: <1588476545-21082-1-git-send-email-sidgup@codeaurora.org> From: Masahiro Yamada Date: Mon, 4 May 2020 16:18:16 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] scripts: headers_install: Exit with error on config leak To: Siddharth Gupta Cc: Sam Ravnborg , Linux Kernel Mailing List 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 Sun, May 3, 2020 at 12:29 PM Siddharth Gupta wrote: > > Misuse of CONFIG_* in UAPI headers should result in an error as it exposes > configuration of different targets to userspace. Sorry, I missed to point out this. This statement is not precious; it does not expose the kernel configuration at all. include/generated/autoconf.h is not available from userspace. So, all the CONFIG options are undefined. Could you reword the commit somehow? > > 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 -- Best Regards Masahiro Yamada