Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD858C43381 for ; Mon, 25 Feb 2019 01:05:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8311C2087C for ; Mon, 25 Feb 2019 01:05:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=paulo.ac header.i=@paulo.ac header.b="yRU1o+ym" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726168AbfBYBFD (ORCPT ); Sun, 24 Feb 2019 20:05:03 -0500 Received: from mail.paulo.ac ([51.15.136.203]:52908 "EHLO mail.paulo.ac" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbfBYBFC (ORCPT ); Sun, 24 Feb 2019 20:05:02 -0500 X-Greylist: delayed 566 seconds by postgrey-1.27 at vger.kernel.org; Sun, 24 Feb 2019 20:05:02 EST Received: from localhost (localhost [127.0.0.1]) by mail.paulo.ac (Postfix) with ESMTP id 756DF1C1398; Mon, 25 Feb 2019 00:55:35 +0000 (UTC) Received: from localhost.localdomain (unknown [187.113.195.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.paulo.ac (Postfix) with ESMTPSA id 71DD61C1142; Mon, 25 Feb 2019 00:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=paulo.ac; s=201902; t=1551056133; bh=R/0dX4dbid0/AowT97SOz2ChbGvDbrDkKr1ct+DvqXg=; h=From:To:Cc:Subject:Date:From; b=yRU1o+ymYhKMstjps5ABNvRk+qptMLWIXt+uFXRTO25OmHkhEtxufFCqINwtzs+9N N11s5FKSPjc7xGbhDzQzl+kdAr/4deqWHkkcRdN6Mj4m9CNBWIMWYIwV8c8ZTY7n5x TQGNu/u766Tl3AuxCymKmPwRAy9xmPrFCjoUVduLN/3oLDG0nofUsfi4kmLELO1dmu dicQIFbUTGYCpeQEOHNgyN68eBkCN0qd7KF3/ezKUWoWH7bdvQjVw0q91uZNmnlUZN 23TmfKv3gkSZc9e63EmaEa4+fi5mdjbyRiLX5WJg3OM9TDsDohiScK5cf7sjL+4Lkf jrtIVqzCjGr1Q== From: Paulo Alcantara To: selinux@vger.kernel.org Cc: paul@paul-moore.com, Paulo Alcantara Subject: [PATCH] selinux: use kernel linux/socket.h definitions for PF_MAX Date: Sun, 24 Feb 2019 21:55:28 -0300 Message-Id: <20190225005528.28371-1-paulo@paulo.ac> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org When compiling genheaders and mdp from a newer host kernel, the following error happens: In file included from scripts/selinux/genheaders/genheaders.c:18: ./security/selinux/include/classmap.h:238:2: error: #error New address family defined, please update secclass_map. #error New address family defined, please update secclass_map. ^~~~~ make[3]: *** [scripts/Makefile.host:107: scripts/selinux/genheaders/genheaders] Error 1 make[2]: *** [scripts/Makefile.build:599: scripts/selinux/genheaders] Error 2 make[1]: *** [scripts/Makefile.build:599: scripts/selinux] Error 2 make[1]: *** Waiting for unfinished jobs.... Instead of relying on the host definition, include linux/socket.h in classmap.h to have PF_MAX. Signed-off-by: Paulo Alcantara --- scripts/selinux/genheaders/genheaders.c | 1 - scripts/selinux/mdp/mdp.c | 1 - security/selinux/include/classmap.h | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c index 1ceedea847dd..544ca126a8a8 100644 --- a/scripts/selinux/genheaders/genheaders.c +++ b/scripts/selinux/genheaders/genheaders.c @@ -9,7 +9,6 @@ #include #include #include -#include struct security_class_mapping { const char *name; diff --git a/scripts/selinux/mdp/mdp.c b/scripts/selinux/mdp/mdp.c index 073fe7537f6c..6d51b74bc679 100644 --- a/scripts/selinux/mdp/mdp.c +++ b/scripts/selinux/mdp/mdp.c @@ -32,7 +32,6 @@ #include #include #include -#include static void usage(char *name) { diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h index bd5fe0d3204a..201f7e588a29 100644 --- a/security/selinux/include/classmap.h +++ b/security/selinux/include/classmap.h @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ #include +#include #define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \ "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append", "map" -- 2.20.1