From patchwork Thu Feb 28 22:18:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10833843 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 D9FBB18EC for ; Thu, 28 Feb 2019 22:20:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC43B2F2CB for ; Thu, 28 Feb 2019 22:20:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C07482F359; Thu, 28 Feb 2019 22:20:00 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable 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 479B72F2DD for ; Thu, 28 Feb 2019 22:20:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729573AbfB1WTz (ORCPT ); Thu, 28 Feb 2019 17:19:55 -0500 Received: from sonic315-15.consmr.mail.gq1.yahoo.com ([98.137.65.39]:43643 "EHLO sonic315-15.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729483AbfB1WTv (ORCPT ); Thu, 28 Feb 2019 17:19:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1551392390; bh=4mpagIDXm11/iyGeFHwFTRusBEV7uw7XCGP/FLtH+mg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject;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sWtzg3SQR3D1d5YMcqt_0wv5_0TIpfnDvoW.kw7gRJY 7ZDOXvvSlB8nJmujVlIVaUe5ZjvLTAnM.KWnGuoNXLlJQ6ANt_TE5jRGylbSKh4Co0XtSd4KdDoR _8A_6P8zqY5h15qAHyd2GDiqfp5lC7a21NXeJoV_Qp28FRyfOTH6FDfaQmKPVwbzdhBhPLGT9ATt T6tvRH7eqYkxIpgqHSpzs5b2qzBojHNpC4h6Nwj6lxrd0Yazq5XNZ9Zna3FLAE.RYNxGeg8MUzK2 _ZiU4g2T.Z1YdUbHkbgCg_BxHJsAL_Nr7El2qWPzt9rEXg5EL7EaI02_Cj7ec8vnhvmZ7072Og2V fLQLbGQ1lIWgaq5uPj_a0eKBdA7IZgIMfQ6phJf3ABfbmMQpwdTKwhrpq4QUPyVAbecDp5BAicrA ZiIzNspl1.fzEIkb.SCkaTvVmecpA9fmRQ4oAAZKq Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Thu, 28 Feb 2019 22:19:50 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO localhost.localdomain) ([67.169.65.224]) by smtp403.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID eca90f2e660dab57d5d3726b0a8f0373; Thu, 28 Feb 2019 22:19:45 +0000 (UTC) From: Casey Schaufler To: jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Cc: keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, paul@paul-moore.com Subject: [PATCH 05/97] LSM: Create an lsm_export data structure. Date: Thu, 28 Feb 2019 14:18:01 -0800 Message-Id: <20190228221933.2551-6-casey@schaufler-ca.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190228221933.2551-1-casey@schaufler-ca.com> References: <20190228221933.2551-1-casey@schaufler-ca.com> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP When more than one security module is exporting data to audit and networking sub-systems a single 32 bit integer is no longer sufficient to represent the data. Add a structure to be used instead. Signed-off-by: Casey Schaufler --- include/linux/security.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/security.h b/include/linux/security.h index 13537a49ae97..a79fe8ef9d84 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -73,6 +73,18 @@ enum lsm_event { LSM_POLICY_CHANGE, }; +/* Data exported by the security modules */ +struct lsm_export { + u32 selinux; + u32 smack; + u32 apparmor; + u32 flags; +}; +#define LSM_EXPORT_NONE 0x00 +#define LSM_EXPORT_SELINUX 0x01 +#define LSM_EXPORT_SMACK 0x02 +#define LSM_EXPORT_APPARMOR 0x04 + /* These functions are in security/commoncap.c */ extern int cap_capable(const struct cred *cred, struct user_namespace *ns, int cap, unsigned int opts);