From patchwork Tue Sep 11 16:42:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10595921 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 86765112B for ; Tue, 11 Sep 2018 16:49:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72C2428CF9 for ; Tue, 11 Sep 2018 16:49:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6698729890; Tue, 11 Sep 2018 16:49:23 +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=-4.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,NO_RDNS_DOTCOM_HELO,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from UCOL19PA13_EEMSG_MP11.csd.disa.mil (ucol19pa13.eemsg.mail.mil [214.24.24.86]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA256 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 402E328CF9 for ; Tue, 11 Sep 2018 16:49:22 +0000 (UTC) X-EEMSG-check-008: 622359935|UCOL19PA13_EEMSG_MP11.csd.disa.mil X-IronPort-AV: E=Sophos;i="5.53,361,1531785600"; d="scan'208";a="622359935" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by UCOL19PA13_EEMSG_MP11.csd.disa.mil with ESMTP; 11 Sep 2018 16:49:20 +0000 X-IronPort-AV: E=Sophos;i="5.53,361,1531785600"; d="scan'208";a="18080355" IronPort-PHdr: 9a23:C9u82BUpd37l13WriK9v0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result: A2BMHwACrpdb/wHyM5BcHAEBAQQBAQoBAYNLA4EIXCiMZIs/gWCBJYFhk2+BYicTAYUEg0ghNxUBAgEBAQEBAQIBbBwMgjUkgmADAwECJBMGAQEMIAsBAgMJAQFACAgDAS0UAREGAQcFBgIBAQEYBIMAgWoDFQOaDoocgWozgnUBAQWBBAEBaoI+A4JQCBeJM4EbF4IAgRIngjYHggKCdwESAYVVIogohV4wjVQJggiNdB1YiB2Fe44Yh00iZHFNIxU7gmyCGQwXg0WKHAFVT3sBAYphgjwBAQ Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 11 Sep 2018 16:49:21 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus.infosec.tycho.ncsc.mil [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w8BGnKhJ023223; Tue, 11 Sep 2018 12:49:20 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id w8BGgMdR031942 for ; Tue, 11 Sep 2018 12:42:22 -0400 Received: from goalie.tycho.ncsc.mil (goalie.infosec.tycho.ncsc.mil [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w8BGgLZx023080 for ; Tue, 11 Sep 2018 12:42:22 -0400 IronPort-PHdr: 9a23:5WOzzh096vhqoUPEsmDT+zVfbzU7u7jyIg8e44YmjLQLaKm44pD+JxaEuKdwlFXFBNTD4qodzefbtrvvH2kJ4JLHtXEGI9RXTxFQr8IQkkQ7BdKdT1XhJavhZjc3DexZX19s4n+/PFIQE8+4bFrX8TWp9TBHPBL5OEJuI/jtXIvbjsC5zee3rpbaeAhZrCG2YbpvIhG7t0Dav48dho4xYr0pxE7vpX1FM/9T2XsuJV+XmEPk4dys+Zd47ylKk+km8c9LCv2hOv5nC7dfCi8jKSYw7czv8x/OFE2e73sbVSMdlR8bSwTG7RSvRp7qqWO6rety3iCGINf7Ba45QzWs7qpnCVfohS4LOiR/8TT/m8Vwi6UdqxWkqg== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AYBAACrpdblywbGNZcHAEBAQQBAQoBAYNLgWcog3KIcos/gWCBJYFhlVWEdwJCg0ghNxUBAgEBAQEBAQIUAQEBAQEIFgZMhUUDAyMEGQEBNwEPJQImAgJFEgYBDAYCAQGDHYFqAxUDmg6KHG97M4J1AQEFgQQBAWqCPgOCUAgXdIg/gRsXggCBEieCNoIJhiuCNSKIKIVeMI1UCYIIjXQdWIgdhXuOGIdNgXdNIxU7gmyCGQwOCRGDNIocAVVPjhoBAQ X-IPAS-Result: A1AYBAACrpdblywbGNZcHAEBAQQBAQoBAYNLgWcog3KIcos/gWCBJYFhlVWEdwJCg0ghNxUBAgEBAQEBAQIUAQEBAQEIFgZMhUUDAyMEGQEBNwEPJQImAgJFEgYBDAYCAQGDHYFqAxUDmg6KHG97M4J1AQEFgQQBAWqCPgOCUAgXdIg/gRsXggCBEieCNoIJhiuCNSKIKIVeMI1UCYIIjXQdWIgdhXuOGIdNgXdNIxU7gmyCGQwOCRGDNIocAVVPjhoBAQ X-IronPort-AV: E=Sophos;i="5.53,360,1531800000"; d="scan'208";a="366479" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.35]) by goalie.tycho.ncsc.mil with ESMTP; 11 Sep 2018 12:42:21 -0400 IronPort-PHdr: 9a23:gaAjJxXmCN/OJ6uVayGyoCr02ATV8LGtZVwlr6E/grcLSJyIuqrYZRaCtKdThVPEFb/W9+hDw7KP9fy4BipYud6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9uLhi6txndutULioZ+N6g9zQfErGFVcOpM32NoIlyTnxf45siu+ZNo7jpdtfE8+cNeSKv2Z6s3Q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NLgWcog3KIcos/gWCBJYFhlVWEdwJCg0ghNxUBAgEBAQEBAQIBEwEBAQEBCBYGTAyCNSSCYAMDIwQZAQE3AQ8lAiYCAkUSBgEMBgIBAYMdgWoDFQOaDoocb3szgnUBAQWBBAEBaoI+A4JQCBd0iD+BGxeCAIESJ4I2ggmGK4I1IogohV4wjVQJggiNdB1YiB2Fe44Yh02Bd00jFTuCbIIZDA4JEYM0ihwBVU+OGgEB X-IronPort-AV: E=Sophos;i="5.53,361,1531785600"; d="scan'208";a="18079995" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from updc3cpa05.eemsg.mail.mil ([214.24.27.44]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 11 Sep 2018 16:42:20 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;20d5fe77-63de-405b-988e-2a792b92f9cd Authentication-Results: upbd19pa01.eemsg.mail.mil; spf=None smtp.pra=casey@schaufler-ca.com; spf=None smtp.mailfrom=casey@schaufler-ca.com; spf=None smtp.helo=postmaster@sonic303-27.consmr.mail.ne1.yahoo.com; dkim=pass (signature verified) header.i=@yahoo.com X-EEMSG-check-008: 329049844|UPBD19PA01_EEMSG_MP1.csd.disa.mil X-EEMSG-SBRS: 3.5 X-EEMSG-ORIG-IP: 66.163.188.153 X-EEMSG-check-002: true IronPort-PHdr: 9a23:4NWqHRyrcg5QyKrXCy+O+j09IxM/srCxBDY+r6Qd0ugfK/ad9pjvdHbS+e9qxAeQG9mDtLQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPYQhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7Vq4/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HViIH4V+jiOHTYF3TSMVO4JsghkMDgmDRYocAVUfMI5eAQE Received: from sonic303-27.consmr.mail.ne1.yahoo.com ([66.163.188.153]) by upbd19pa01.eemsg.mail.mil with ESMTP; 11 Sep 2018 16:42:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1536684128; bh=nBnCncDmKVzJ87tFLAefacjILGjJoRt0SnrggtiqbMc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=nxfkxcIh7ryLiwE6dW63EOhsAu+D2FqTnX2fxaUjRh1VA8YCeThl/iW9Twsv96nsaSqvQBg7CMseUDi/yzT5amKh1AFu0gkd54OS/Z46n9MdQs6nHo7FlxkJ2r3h2D2vkE4dFs0VD60T6JKBznl11kwisc+9b8tW1Fvl0PvOHydg1pLbAmBHxUJTRwM/76QqGy+wWRpwVUZsVHkiw2leEJsqQ3/BR5OplCA5TcAGQc8d+115C/p10ZUyoDM9CZeUd/jF1/bZ7RRDlN2HvHia4YLuA1y8igFCG4s2L7bQE9io97Zz0MWTyI/ncOW3EI3RH8e30zwM09OGVXroaLabyg== X-YMail-OSG: Cj2tDJMVM1nElgibyS53fOy39GdwfP.FBDdn_a6Og_LyuBctD2JN6DW26M8r6LP JVtjN9Rxpi9QsxkHwByUqaxdq0ipTNz1O7cScnn6CMb22N3f6lGmm.0UJ1kS0xAlgS_.H_hc9oW8 W_2nkl8l00..jzi.fse5Oyp8XRNjIULZ5SjR4ZbIGh_J6lfgu149mLhc5byCe5Lzyl.JX6CNcEV. xo7O4VvbPNX78PFkzCl17gxDHfFBiSBH3XByJTmiDmziumn2WKSPBwev_lb_tvdzSydID1QadVdk h7kfvLfxqChaGsGJtYXV4eTibcAKTu_fkOJlSSQozDjdhY9ZIvNfd_8YsU33Sj0Dmf1SOImbfYYu 5jxR_yaVEWbgnxzojPKdu8OgxT2WwGAFgJysONy1QOVKEsWlalJnnAIWKUb6u1F_wMAk2ky3l0pL Ia_cnV1DmrU38J0yHyaADI5d7Te1rrZ5V.42EB8kCurk6rKIyEMmTkvFrkBPZNSovKm6VTYz7Yit 8QZXgah9vl8_9pzSeQ7eqbRL43vEkWWhcV1FW8SZPmXa_PjUEL3QgTY0XX_01OAUrN80m3Fi3kUZ Tqlg_qcnxlLderHw2Eg1n_VaJVaLJ0394BSOo9TFJqUfjipvYkwYVfrEqHo99.k1AeOQxSsx2yhe _eeVX5dD8t3InbxhwayKOY6S5q3LNs6Sx4cxK5fnlPaMv31IA.fQylu3vDYfI5JpiKT2J_9tvQps .NSPsLOXx6iZeKu8b.b_c_zKzNLoimcynUhrnvshwvPD2zjz0_LwrlhfbPoFLgZQrlrktxwDFNQC EVV0EZxW5_A.a2z5zTdOO3eWfqBHkriNGNFrYwAyRk8EIwL.KuwyLyyc.K6Zp1liXiWnlF0R2ATW SBElI339YGL8O6XxeXKHTX5mQ_fhE2QeMcvF50efsHWqkbkBXMCS9VdAiKTpuE6ULDkWDaDWmyWh 9.dNbIlimBfGuTzMWf1USDqO2eOuuYrrLUnRfmtXYgfuoZLKltdHTC2Dy1i64LOe8tGWnW8T9I1S wkNt970v20kDE0DTduSMByoLtB_gqzP158Z6d Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Tue, 11 Sep 2018 16:42:08 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.102]) ([67.169.65.224]) by smtp401.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID fdf625bf2d31418d1726c50ebeb00399; Tue, 11 Sep 2018 16:42:05 +0000 (UTC) To: LSM , James Morris , LKLM , SE Linux , John Johansen , Kees Cook , Tetsuo Handa , Paul Moore , Stephen Smalley , "linux-fsdevel@vger.kernel.org" , Alexey Dobriyan References: X-EEMSG-check-009: 444-444 From: Casey Schaufler Message-ID: <748e4bca-41f1-c43b-a691-bf6b3d910793@schaufler-ca.com> Date: Tue, 11 Sep 2018 09:42:02 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mailman-Approved-At: Tue, 11 Sep 2018 12:45:04 -0400 Subject: [PATCH 06/10] LSM: Infrastructure management of the file security blob X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: "Schaufler, Casey" Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP Move management of the file->f_security blob out of the individual security modules and into the infrastructure. The modules no longer allocate or free the data, instead they tell the infrastructure how much space they require. Signed-off-by: Casey Schaufler --- include/linux/lsm_hooks.h | 1 + security/apparmor/lsm.c | 19 +++++++------- security/security.c | 54 +++++++++++++++++++++++++++++++++++--- security/selinux/hooks.c | 25 ++---------------- security/smack/smack.h | 5 ++++ security/smack/smack_lsm.c | 26 +++++++----------- 6 files changed, 78 insertions(+), 52 deletions(-) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index 0bef312efd45..167ffbd4d0c0 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -2029,6 +2029,7 @@ struct security_hook_list { */ struct lsm_blob_sizes { int lbs_cred; + int lbs_file; }; /* diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index c2566aaa138e..15716b6ff860 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -431,21 +431,21 @@ static int apparmor_file_open(struct file *file) static int apparmor_file_alloc_security(struct file *file) { - int error = 0; - - /* freed by apparmor_file_free_security */ + struct aa_file_ctx *ctx = file_ctx(file); struct aa_label *label = begin_current_label_crit_section(); - file->f_security = aa_alloc_file_ctx(label, GFP_KERNEL); - if (!file_ctx(file)) - error = -ENOMEM; - end_current_label_crit_section(label); - return error; + spin_lock_init(&ctx->lock); + rcu_assign_pointer(ctx->label, aa_get_label(label)); + end_current_label_crit_section(label); + return 0; } static void apparmor_file_free_security(struct file *file) { - aa_free_file_ctx(file_ctx(file)); + struct aa_file_ctx *ctx = file_ctx(file); + + if (ctx) + aa_put_label(rcu_access_pointer(ctx->label)); } static int common_file_perm(const char *op, struct file *file, u32 mask) @@ -1131,6 +1131,7 @@ static void apparmor_sock_graft(struct sock *sk, struct socket *parent) */ struct lsm_blob_sizes apparmor_blob_sizes = { .lbs_cred = sizeof(struct aa_task_ctx *), + .lbs_file = sizeof(struct aa_file_ctx), }; static struct security_hook_list apparmor_hooks[] __lsm_ro_after_init = { diff --git a/security/security.c b/security/security.c index ff7df14f6db1..5430cae73cf6 100644 --- a/security/security.c +++ b/security/security.c @@ -40,6 +40,8 @@ struct security_hook_heads security_hook_heads __lsm_ro_after_init; static ATOMIC_NOTIFIER_HEAD(lsm_notifier_chain); +static struct kmem_cache *lsm_file_cache; + char *lsm_names; static struct lsm_blob_sizes blob_sizes; @@ -92,6 +94,13 @@ int __init security_init(void) */ do_security_initcalls(); + /* + * Create any kmem_caches needed for blobs + */ + if (blob_sizes.lbs_file) + lsm_file_cache = kmem_cache_create("lsm_file_cache", + blob_sizes.lbs_file, 0, + SLAB_PANIC, NULL); /* * The second call to a module specific init function * adds hooks to the hook lists and does any other early @@ -101,6 +110,7 @@ int __init security_init(void) #ifdef CONFIG_SECURITY_LSM_DEBUG pr_info("LSM: cred blob size = %d\n", blob_sizes.lbs_cred); + pr_info("LSM: file blob size = %d\n", blob_sizes.lbs_file); #endif return 0; @@ -277,6 +287,28 @@ static void __init lsm_set_size(int *need, int *lbs) void __init security_add_blobs(struct lsm_blob_sizes *needed) { lsm_set_size(&needed->lbs_cred, &blob_sizes.lbs_cred); + lsm_set_size(&needed->lbs_file, &blob_sizes.lbs_file); +} + +/** + * lsm_file_alloc - allocate a composite file blob + * @file: the file that needs a blob + * + * Allocate the file blob for all the modules + * + * Returns 0, or -ENOMEM if memory can't be allocated. + */ +int lsm_file_alloc(struct file *file) +{ + if (!lsm_file_cache) { + file->f_security = NULL; + return 0; + } + + file->f_security = kmem_cache_zalloc(lsm_file_cache, GFP_KERNEL); + if (file->f_security == NULL) + return -ENOMEM; + return 0; } /* @@ -962,12 +994,28 @@ int security_file_permission(struct file *file, int mask) int security_file_alloc(struct file *file) { - return call_int_hook(file_alloc_security, 0, file); + int rc = lsm_file_alloc(file); + + if (rc) + return rc; + rc = call_int_hook(file_alloc_security, 0, file); + if (unlikely(rc)) + security_file_free(file); + return rc; } void security_file_free(struct file *file) { + void *blob; + + if (!lsm_file_cache) + return; + call_void_hook(file_free_security, file); + + blob = file->f_security; + file->f_security = NULL; + kmem_cache_free(lsm_file_cache, blob); } int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) @@ -1085,7 +1133,7 @@ int security_cred_alloc_blank(struct cred *cred, gfp_t gfp) return rc; rc = call_int_hook(cred_alloc_blank, 0, cred, gfp); - if (rc) + if (unlikely(rc)) security_cred_free(cred); return rc; } @@ -1106,7 +1154,7 @@ int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp) return rc; rc = call_int_hook(cred_prepare, 0, new, old, gfp); - if (rc) + if (unlikely(rc)) security_cred_free(new); return rc; } diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 94b3123c237b..3468b4592036 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -149,7 +149,6 @@ static int __init checkreqprot_setup(char *str) __setup("checkreqprot=", checkreqprot_setup); static struct kmem_cache *sel_inode_cache; -static struct kmem_cache *file_security_cache; /** * selinux_secmark_enabled - Check to see if SECMARK is currently enabled @@ -381,27 +380,15 @@ static void inode_free_security(struct inode *inode) static int file_alloc_security(struct file *file) { - struct file_security_struct *fsec; + struct file_security_struct *fsec = selinux_file(file); u32 sid = current_sid(); - fsec = kmem_cache_zalloc(file_security_cache, GFP_KERNEL); - if (!fsec) - return -ENOMEM; - fsec->sid = sid; fsec->fown_sid = sid; - file->f_security = fsec; return 0; } -static void file_free_security(struct file *file) -{ - struct file_security_struct *fsec = selinux_file(file); - file->f_security = NULL; - kmem_cache_free(file_security_cache, fsec); -} - static int superblock_alloc_security(struct super_block *sb) { struct superblock_security_struct *sbsec; @@ -3558,11 +3545,6 @@ static int selinux_file_alloc_security(struct file *file) return file_alloc_security(file); } -static void selinux_file_free_security(struct file *file) -{ - file_free_security(file); -} - /* * Check whether a task has the ioctl permission and cmd * operation to an inode. @@ -6857,6 +6839,7 @@ static void selinux_bpf_prog_free(struct bpf_prog_aux *aux) struct lsm_blob_sizes selinux_blob_sizes = { .lbs_cred = sizeof(struct task_security_struct), + .lbs_file = sizeof(struct file_security_struct), }; static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { @@ -6927,7 +6910,6 @@ static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(file_permission, selinux_file_permission), LSM_HOOK_INIT(file_alloc_security, selinux_file_alloc_security), - LSM_HOOK_INIT(file_free_security, selinux_file_free_security), LSM_HOOK_INIT(file_ioctl, selinux_file_ioctl), LSM_HOOK_INIT(mmap_file, selinux_mmap_file), LSM_HOOK_INIT(mmap_addr, selinux_mmap_addr), @@ -7130,9 +7112,6 @@ static __init int selinux_init(void) sel_inode_cache = kmem_cache_create("selinux_inode_security", sizeof(struct inode_security_struct), 0, SLAB_PANIC, NULL); - file_security_cache = kmem_cache_create("selinux_file_security", - sizeof(struct file_security_struct), - 0, SLAB_PANIC, NULL); avc_init(); avtab_cache_init(); diff --git a/security/smack/smack.h b/security/smack/smack.h index 0c6dce446825..043525a52e94 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h @@ -362,6 +362,11 @@ static inline struct task_smack *smack_cred(const struct cred *cred) return cred->security; } +static inline struct smack_known **smack_file(const struct file *file) +{ + return file->f_security; +} + /* * Is the directory transmuting? */ diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index a06ea8aa89c4..d1430341798f 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -1571,24 +1571,12 @@ static void smack_inode_getsecid(struct inode *inode, u32 *secid) */ static int smack_file_alloc_security(struct file *file) { - struct smack_known *skp = smk_of_current(); + struct smack_known **blob = smack_file(file); - file->f_security = skp; + *blob = smk_of_current(); return 0; } -/** - * smack_file_free_security - clear a file security blob - * @file: the object - * - * The security blob for a file is a pointer to the master - * label list, so no memory is freed. - */ -static void smack_file_free_security(struct file *file) -{ - file->f_security = NULL; -} - /** * smack_file_ioctl - Smack check on ioctls * @file: the object @@ -1813,7 +1801,9 @@ static int smack_mmap_file(struct file *file, */ static void smack_file_set_fowner(struct file *file) { - file->f_security = smk_of_current(); + struct smack_known **blob = smack_file(file); + + *blob = smk_of_current(); } /** @@ -1830,6 +1820,7 @@ static void smack_file_set_fowner(struct file *file) static int smack_file_send_sigiotask(struct task_struct *tsk, struct fown_struct *fown, int signum) { + struct smack_known **blob; struct smack_known *skp; struct smack_known *tkp = smk_of_task(smack_cred(tsk->cred)); struct file *file; @@ -1842,7 +1833,8 @@ static int smack_file_send_sigiotask(struct task_struct *tsk, file = container_of(fown, struct file, f_owner); /* we don't log here as rc can be overriden */ - skp = file->f_security; + blob = smack_file(file); + skp = *blob; rc = smk_access(skp, tkp, MAY_DELIVER, NULL); rc = smk_bu_note("sigiotask", skp, tkp, MAY_DELIVER, rc); if (rc != 0 && has_capability(tsk, CAP_MAC_OVERRIDE)) @@ -4626,6 +4618,7 @@ static int smack_dentry_create_files_as(struct dentry *dentry, int mode, struct lsm_blob_sizes smack_blob_sizes = { .lbs_cred = sizeof(struct task_smack), + .lbs_file = sizeof(struct smack_known *), }; static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { @@ -4663,7 +4656,6 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(inode_getsecid, smack_inode_getsecid), LSM_HOOK_INIT(file_alloc_security, smack_file_alloc_security), - LSM_HOOK_INIT(file_free_security, smack_file_free_security), LSM_HOOK_INIT(file_ioctl, smack_file_ioctl), LSM_HOOK_INIT(file_lock, smack_file_lock), LSM_HOOK_INIT(file_fcntl, smack_file_fcntl),