From patchwork Thu Jul 25 08:05:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169688 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp11302389ilk; Thu, 25 Jul 2019 01:05:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6ArfsF+5g8XyvB/fCh/YVaYv7yP81bQNH+qIB9R6vt+/b+DSPnfGiJ9WStPcLVOg+VRXf X-Received: by 2002:a17:902:2868:: with SMTP id e95mr83976913plb.319.1564041945815; Thu, 25 Jul 2019 01:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564041945; cv=none; d=google.com; s=arc-20160816; b=w96+ZSM3AHyhW9nDHHZBhIpp084mFqOwHy/sppSOFfbk9PdDkkDqnPRUEb/qoTMtpT yzFB2POFV0wk2Ir2yZ9diQ7yof6Lh6Tb5Zun6o4JFYsesWLoACtb8ESbdCOvmEyYWS9i hbAtrigGat2f0LE2SP/+3NEhOi9iRpqGb7TmNldf1VCC7Ut6cpSaPEOzTsJkXQUvfAgv bV1kEpHMSzF3B9lvHtrE1FLqcc7jE7Br+/W8N5l/X2ZfI48vgZffNnNtMRPaA+FRCnU6 QSWZqJ5/A40Idjv97sS+Zzr3lH7s0f+vsvCoRP0HOwMpwkJo3BZ7353snYwIyvRd24yq n3pA== 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 :dkim-signature:dkim-filter; bh=7BLg13CdKPhyaQ1kBrxCgb7bB9yny46HPZX8sZdYLjk=; b=dWdVwMnxWhNzEkyrIo5y1iJdm3bpy2gDLZeZphkdCOM0DMcP3/u2eEmsZd/vUGiYNX EzTIvc/lEEYUoou8MfKZtCvC930RPyYmUTldoUTVugAUvaPyrM1wKUkyKNc4vAwHfoQY 2LollOCUp/X2oLuO9nSBPb9vFa7DykQzxLgX+QBG13/N1Lhyl4xk/gpcZH9Yx12QgbsQ P3ittEbC5JWoa+WIwuXztFKqxC2kQjXeDH16EqWpjdzkiC1/S/a5wpj0gHdc4xpSv5xH LksyI675TsNL2GdI4PhmzJ0Sdkik8scrGHqfu+EO3Jadw4C4BmY0tWBffwV8dxVlXSt5 wygQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aYQecNMD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12si22363750pgu.469.2019.07.25.01.05.44; Thu, 25 Jul 2019 01:05:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aYQecNMD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389032AbfGYIFm (ORCPT + 29 others); Thu, 25 Jul 2019 04:05:42 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:60142 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387586AbfGYIFm (ORCPT ); Thu, 25 Jul 2019 04:05:42 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x6P85GFC002747; Thu, 25 Jul 2019 17:05:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x6P85GFC002747 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1564041917; bh=7BLg13CdKPhyaQ1kBrxCgb7bB9yny46HPZX8sZdYLjk=; h=From:To:Cc:Subject:Date:From; b=aYQecNMDwtqd1VXqs9tx5rDiHj/U+GzMdzLvjkHp09Lhyt+3+n1+Fzxnd8Osq2jo4 cjFq75wNGYB8ayoOUlyika0wM2n9P6Mwt8YIjTH3IT2dR8Do84sZUL+20kfBsKm+Sk wFhjJNEMleOQdjBa01v0NZ3eLw1euN8X0kO99KRYPrz9nSGA36rAy5zC1i5xWCSZjN knADuTqBCKWDl17DXbwrSj9sl7ah0A/2leFfJbxY22ZfLENtR8ZDZf/ZKUdpDm7mlk Pech/BCJJ0AYnYS1bFiN1Lc8tFFgD58+Xaw12pCxzYmUiAzUSULWRU710My0n5+cFo MQYGvJTlU6RWw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Greg KH , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: detect missing "WITH Linux-syscall-note" for uapi headers Date: Thu, 25 Jul 2019 17:05:13 +0900 Message-Id: <20190725080513.4071-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org UAPI headers licensed under GPL are supposed to have exception "WITH Linux-syscall-note" so that they can be included into non-GPL user space application code. Unfortunately, people often miss to add it. Break 'make headers' when any of exported headers lacks the exception note so that the 0-day bot can easily catch it. Signed-off-by: Masahiro Yamada --- This patch depends on the following: https://lore.kernel.org/patchwork/patch/1105289/ I will turn on the error after all headers are fixed. scripts/headers_install.sh | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.17.1 diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 47f6f3ea0771..bbaf29386995 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -23,6 +23,12 @@ TMPFILE=$OUTFILE.tmp trap 'rm -f $OUTFILE $TMPFILE' EXIT +# SPDX-License-Identifier with GPL variants must have "WITH Linux-syscall-note" +if [ -n "$(sed -n -e "/SPDX-License-Identifier:.*GPL-/{/WITH Linux-syscall-note/!p}" $INFILE)" ]; then + echo "error: $INFILE: missing \"WITH Linux-syscall-note\" for SPDX-License-Identifier" >&2 + exit 1 +fi + sed -E -e ' s/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g s/__attribute_const__([[:space:]]|$)/\1/g