From patchwork Tue Apr 9 21:38:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10892549 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 8CBFA17EF for ; Tue, 9 Apr 2019 21:41:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FB27285C6 for ; Tue, 9 Apr 2019 21:41:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 744692887B; Tue, 9 Apr 2019 21:41:08 +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=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 1DBAF285C6 for ; Tue, 9 Apr 2019 21:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbfDIVlF (ORCPT ); Tue, 9 Apr 2019 17:41:05 -0400 Received: from sonic301-38.consmr.mail.ne1.yahoo.com ([66.163.184.207]:44187 "EHLO sonic301-38.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726860AbfDIVlF (ORCPT ); Tue, 9 Apr 2019 17:41:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1554846063; bh=is2u5Y0DRwzBY1W00Se6/XMCwBAVUpvFG8LStFYaqTs=; h=From:To:Cc:Subject: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p4HriljoLLT6TzNG4U_Wi7pMSG3TtN3K9Sivyw6PnNZ Em5fi1QTZ1OujnQh4l4QkMaS7iMb0oa8DilERtU.U6fdMDFgCaffuQXQpktTQuZ5rhXxtVqxJZNi HMQBJ5nB2WgrUEInhuP57k6tObqP9Bpxl5_HKubQZ6hI_nXEl80RbmyZTsDNm_sLivutS06Q3WyR DMYJo3t1YpXk7.SiDsQqM.9hqM1r77K5xbTXvIihfpkZ2KePS1I6sq9q8aMeibS5FvBjsEJzLQcU FxHS5FL3U1_ko6O8chDJPtkfC0vB0SWTTcCFaao4ymBsy2ZJ9lesNLaEihg_S_ZBH7lXgrSt_G3C gynWm9oo3qilb7HGCLKbDjyRyRm8NF29MKHQXHj0Ud1dqh1BeoRHFuQJdZy72F93JEY50z3Q.H2A kYB4ecRIF0j4foV.zDwKYeLL50I4k149DlvG4qakghL137qLOq8_u1AsI Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Apr 2019 21:41:03 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO localhost.localdomain) ([67.169.65.224]) by smtp423.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 9c4e55bd3d312d6c1e8f7ed93770d720; Tue, 09 Apr 2019 21:39:56 +0000 (UTC) From: Casey Schaufler To: casey.schaufler@intel.com, jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Cc: casey@schaufler-ca.com Subject: [PATCH 04/59] LSM: Create an lsm_export data structure. Date: Tue, 9 Apr 2019 14:38:51 -0700 Message-Id: <20190409213946.1667-5-casey@schaufler-ca.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190409213946.1667-1-casey@schaufler-ca.com> References: <20190409213946.1667-1-casey@schaufler-ca.com> Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org 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 49f2685324b0..81f9f79f9a1e 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -76,6 +76,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);