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: 11058179 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5ED3C13B1 for ; Thu, 25 Jul 2019 08:05:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DA83286A2 for ; Thu, 25 Jul 2019 08:05:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E0552871C; Thu, 25 Jul 2019 08:05:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBAA9286A2 for ; Thu, 25 Jul 2019 08:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389007AbfGYIFm (ORCPT ); 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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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