From patchwork Tue Sep 11 16:42:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10595929 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 33DA76CB for ; Tue, 11 Sep 2018 16:49:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20E3728CF9 for ; Tue, 11 Sep 2018 16:49:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13D0E29896; Tue, 11 Sep 2018 16:49:51 +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 USFB19PA16_EEMSG_MP12.csd.disa.mil (uphb19pa13.eemsg.mail.mil [214.24.26.87]) (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 EBEC628CF9 for ; Tue, 11 Sep 2018 16:49:45 +0000 (UTC) X-EEMSG-check-008: 126274123|USFB19PA16_EEMSG_MP12.csd.disa.mil Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.2]) by USFB19PA16_EEMSG_MP12.csd.disa.mil with ESMTP; 11 Sep 2018 16:49:44 +0000 X-IronPort-AV: E=Sophos;i="5.53,361,1531785600"; d="scan'208";a="15731464" IronPort-PHdr: 9a23:ucjDuhz1EADO+KzXCy+O+j09IxM/srCxBDY+r6Qd1ukSK/ad9pjvdHbS+e9qx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ETAYUEgwUhNBgBAgEBAQEBAQIBbBwMgjUkgmADAwECJBMGAQEMIAsBAgMJAQFACAgDAS0UAREGAQcFBgIBAQEYBIMAgWoDFQOaQYocgWozgnUBAQWBBAEBaoI7A4JRCBeJNYEbF4IAgRIngjaCCYJ3ARIBhXeIBxkIhR9AMESNGAmCCY13HViIH4V+jiOHNzhkcU0jFTuCbIIZDBeDRYocAVVPewEBiySCPQEB Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 11 Sep 2018 16:49:44 +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 w8BGnhUc023263; Tue, 11 Sep 2018 12:49:43 -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 w8BGgWqO031963 for ; Tue, 11 Sep 2018 12:42:32 -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 w8BGgScv023093 for ; Tue, 11 Sep 2018 12:42:32 -0400 IronPort-PHdr: 9a23:FMcDNRFMgT5eyuM2bram8Z1GYnJ96bzpIg4Y7IYmgLtSc6Oluo7vJ1Hb+e431wKbQJ3R56sVk+OP6ObtVGkb7tCEuXEGNplNU0xNkt0YyionBsPNEkjnNLjydSVvF81ZWU5N5Hq7OFVbHMvkIlbb5Ha16G1aAQ3xYCxyIOm9AYvOl4Ky3uG29YfUZlBDjSGwcJtpJxW/sAvVu9NTioIkIaE0mVPSunUdXeNQyCtzIE6L2Rbx4sDl5Jl47yFZoO4s7eZbVqP7dP9gEfkCU3ItNGYu4detsBDCSU2J6yJaQ2wWlR0OCA/Av1n2XZb05zPzrfE1mDKbMsv/Ua0uVHy84r1qRh7lhGZPNzMw/GzNzM0lpLNSoBWm4Rd4xoM= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1CVAQACrpdbly0bGNZcHAEBAQQBAQoBAYNLgWcog3KIE1+LP4FggSWBYZNbgXqEdwJCg0ghNBgBAgEBAQEBAQIUAQEBAQEGGAZMhUUDAyMEGQEBNwEPJQImAgJFEgYBDAYCAQGDHYFqAxUDmg6KHG97M4J1AQEFgQQBAWqCPgOCUAgXdIg/gRsXggCBEieCNoIJhiuCV4gHGQiFHz8wRI0QCYIIjXQdWIgdhXuOGIc3gg1NIxU7gmyCGQwOCRGDNIocAVVPjhoBAQ X-IPAS-Result: A1CVAQACrpdbly0bGNZcHAEBAQQBAQoBAYNLgWcog3KIE1+LP4FggSWBYZNbgXqEdwJCg0ghNBgBAgEBAQEBAQIUAQEBAQEGGAZMhUUDAyMEGQEBNwEPJQImAgJFEgYBDAYCAQGDHYFqAxUDmg6KHG97M4J1AQEFgQQBAWqCPgOCUAgXdIg/gRsXggCBEieCNoIJhiuCV4gHGQiFHz8wRI0QCYIIjXQdWIgdhXuOGIc3gg1NIxU7gmyCGQwOCRGDNIocAVVPjhoBAQ X-IronPort-AV: E=Sophos;i="5.53,360,1531800000"; d="scan'208";a="366484" Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.34]) by goalie.tycho.ncsc.mil with ESMTP; 11 Sep 2018 12:42:31 -0400 IronPort-PHdr: 9a23:xSSSYR+pSnuzX/9uRHKM819IXTAuvvDOBiVQ1KB+0e8fIJqq85mqBkHD//Il1AaPAd2Eraocw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1JuPoEYLOksi7ze+/94HRbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbOSxaE62Y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AQIBAQEBAQECARMBAQEBAQYYBkwMgjUkgmADAyMEGQEBNwEPJQImAgJFEgYBDAYCAQGDHYFqAxUDmkqKHG97M4J1AQEFgQQBAWqCPAOCUQgXdIhBgRsXggCBEieCNoIJhiuCV4gHGQiFH0AwRI0YCYIJjXcdWIgfhX6OI4c3gg1NIxU7gmyCGQwOCRGDNIocAVVPjl4BAQ X-IronPort-AV: E=Sophos;i="5.53,361,1531785600"; d="scan'208";a="15730822" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from updc3cpa06.eemsg.mail.mil ([214.24.27.45]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 11 Sep 2018 16:42:30 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;96fa20a4-a132-443a-982d-f0f7413b7d26 Authentication-Results: upbd19pa13.eemsg.mail.mil; spf=None smtp.pra=casey@schaufler-ca.com; spf=None smtp.mailfrom=casey@schaufler-ca.com; spf=None smtp.helo=postmaster@sonic304-27.consmr.mail.ne1.yahoo.com; dkim=pass (signature verified) header.i=@yahoo.com X-EEMSG-check-008: 169256946|UPBD19PA13_EEMSG_MP13.csd.disa.mil X-EEMSG-SBRS: 3.5 X-EEMSG-ORIG-IP: 66.163.191.153 X-EEMSG-check-002: true IronPort-PHdr: 9a23:QmCbSBM41z75V1jjO7wl6mtUPXoX/o7sNwtQ0KIMzox0K/7ypsbcNUDSrc9gkEXOFd2Cra4c1KyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhjexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Qiqp4bt1RxD0iScHLz85/3/Risxsl6JQvRatqwViz4LIfI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E Received: from sonic304-27.consmr.mail.ne1.yahoo.com ([66.163.191.153]) by upbd19pa13.eemsg.mail.mil with ESMTP; 11 Sep 2018 16:42:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1536684134; bh=N5v7KHPlnfqRXXitoCugLJ0nrFlPhT5lpP9Xc3EmxdE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=IbO2ongcP5jJuu/CnN8PZHjGp1zRuPa6wVU2LJN8ebq8MzmusDTODB6u93gSV4ljEHireSvD+YWutAP0F6XCNvE07/5nam7paSGNbnqckVLpzXts83gFNO3dAYX7HrESMCG0bk1vpfkKPnbj1AONWHU5dotSe4fbG0Xu6AnAMsAjrJVqFW6fKofZ6u3ETYqryuRrAGkO4ECxCoLRfr0w9j21REauljX2MYMzw+s9D+KMSg9nA9wdbMFjHkwbVhmJ+c4SFmvmuWC8rZ94uLdhywFwyaIB8dwlRvy2MrejODbn+SLqnEz7dw+YNb6aQuR5RDYcL1npGELQK2yWQu8jMQ== X-YMail-OSG: JEIb.HYVM1ntd7YZyk4jZAcMYrAtD0kCYJYHHSoG8YZ65nbIyCeqn5t6sOD5f_k PgTj8WwFwhYntbl.XjLcCgAEMrAVzsoK1YPXgt_Pwl7SCI10NRhO6MUs_k4AwbEM6o01ilfRs8Cp .hiYvX.STZCiSFS1jGoKkUY5DQX7BrWkooYnDb867POrFK6x9h3W28ofRFecKtfgVOMn7brdM99G fK9jDCZ3UD1Mv5chDzEhMyDkUIE6kpttqm99EGWAg.rMN9QXqMRQTxjP2NbM9fyzqGN9qAp_DQw3 .biyO_icPkqJ5SCip8S5bIyBQVrhda7iRPPXIxG4RKMftO1K7yQ.Xd47H6lEIACnkMMJsefjuwt3 hvy5IwvnmHaFVra0TX8Xld83UPDKlGp4RoSx_S_GiP2ASwOclPswtmQ2qMJLWuBgpYAAMrdC8RBk ttLmImDicK_Nlvf.vONoCeq5.pmQrN8kkGDx225pHNe5TKQnYOg7NWwkXr1DKs33ObPVxrmhZmPe ZSm0eYVKc9FGMD96B47bPG1jsHTiqEvtViAaECM26JzaQzlgL3.WEwg8fL3U7rer_hVabMOukuEt 4JT7gT9tYn2zIAtSyZvk9I5qzc_OvtvLhdmP0PudFmhmkWsLwnCyRh8aAOpBJxGEHvQsR3Sof1PT V9jsW7tBP83DTPNeXakMw7dUHtMUwWtzn5yzqSl3DY_kDqsmJRa9Bhn8_QJvkJFJ2GxypH8gucrv tEkyujKndCqJoh1J8V0j.JDEOqcOZySocAKw6a79rk7U6hoKikjCaJsBZ5TAN9wSwBX2aNDmwVMs hQD8IaWu.mw67nlEKtXBy0NcfQpb8qvaypKJFLP8ZUQDzHQ3c1oVaplnuegbXorRwqK18Nu9NV2O YzedTT9yHPGpoiFa9XL3zYkaPZImS8_OL16hnmju..0f_n5haEJrKJiETJdx2ZF49lBDuNtcnsnB 0tqoOChlefEfUqrUuStYDNHXhlGbDViDRPpFz.d4frLE_V9Y7smGMW1R.YVGYBEUe1eEN_bCK9M. QaZFUz0TbfhstLIrjpxghb8m_wkelcymUG4qmQ9oIP7M- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Tue, 11 Sep 2018 16:42:14 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.102]) ([67.169.65.224]) by smtp406.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID c8704c613dd392accb6a6912bf806e15; Tue, 11 Sep 2018 16:42:14 +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: <03851eb1-46cd-9d31-9ad5-0b80a24f5288@schaufler-ca.com> Date: Tue, 11 Sep 2018 09:42:10 -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 09/10] LSM: Infrastructure management of the inode security 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 inode->i_security blob out of the individual security modules and into the security infrastructure. Instead of allocating the blobs from within the modules the modules tell the infrastructure how much space is required, and the space is allocated there. Signed-off-by: Casey Schaufler --- include/linux/lsm_hooks.h | 3 ++ security/security.c | 83 ++++++++++++++++++++++++++++++- security/selinux/hooks.c | 32 +----------- security/selinux/include/objsec.h | 5 +- security/smack/smack_lsm.c | 70 ++++---------------------- 5 files changed, 98 insertions(+), 95 deletions(-) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index 167ffbd4d0c0..416b20c3795b 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -2030,6 +2030,7 @@ struct security_hook_list { struct lsm_blob_sizes { int lbs_cred; int lbs_file; + int lbs_inode; }; /* @@ -2092,9 +2093,11 @@ static inline void loadpin_add_hooks(void) { }; #endif extern int lsm_cred_alloc(struct cred *cred, gfp_t gfp); +extern int lsm_inode_alloc(struct inode *inode); #ifdef CONFIG_SECURITY void lsm_early_cred(struct cred *cred); +void lsm_early_inode(struct inode *inode); #endif #endif /* ! __LINUX_LSM_HOOKS_H */ diff --git a/security/security.c b/security/security.c index 5430cae73cf6..2501cdcbebff 100644 --- a/security/security.c +++ b/security/security.c @@ -41,6 +41,7 @@ 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; +static struct kmem_cache *lsm_inode_cache; char *lsm_names; static struct lsm_blob_sizes blob_sizes; @@ -101,6 +102,10 @@ int __init security_init(void) lsm_file_cache = kmem_cache_create("lsm_file_cache", blob_sizes.lbs_file, 0, SLAB_PANIC, NULL); + if (blob_sizes.lbs_inode) + lsm_inode_cache = kmem_cache_create("lsm_inode_cache", + blob_sizes.lbs_inode, 0, + SLAB_PANIC, NULL); /* * The second call to a module specific init function * adds hooks to the hook lists and does any other early @@ -111,6 +116,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); + pr_info("LSM: inode blob size = %d\n", blob_sizes.lbs_inode); #endif return 0; @@ -288,6 +294,13 @@ 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); + /* + * The inode blob gets an rcu_head in addition to + * what the modules might need. + */ + if (needed->lbs_inode && blob_sizes.lbs_inode == 0) + blob_sizes.lbs_inode = sizeof(struct rcu_head); + lsm_set_size(&needed->lbs_inode, &blob_sizes.lbs_inode); } /** @@ -311,6 +324,46 @@ int lsm_file_alloc(struct file *file) return 0; } +/** + * lsm_inode_alloc - allocate a composite inode blob + * @inode: the inode that needs a blob + * + * Allocate the inode blob for all the modules + * + * Returns 0, or -ENOMEM if memory can't be allocated. + */ +int lsm_inode_alloc(struct inode *inode) +{ + if (!lsm_inode_cache) { + inode->i_security = NULL; + return 0; + } + + inode->i_security = kmem_cache_zalloc(lsm_inode_cache, GFP_NOFS); + if (inode->i_security == NULL) + return -ENOMEM; + return 0; +} + +/** + * lsm_early_inode - during initialization allocate a composite inode blob + * @inode: the inode that needs a blob + * + * Allocate the inode blob for all the modules if it's not already there + */ +void lsm_early_inode(struct inode *inode) +{ + int rc; + + if (inode == NULL) + panic("%s: NULL inode.\n", __func__); + if (inode->i_security != NULL) + return; + rc = lsm_inode_alloc(inode); + if (rc) + panic("%s: Early inode alloc failed.\n", __func__); +} + /* * Hook list operation macros. * @@ -557,14 +610,40 @@ EXPORT_SYMBOL(security_sb_parse_opts_str); int security_inode_alloc(struct inode *inode) { - inode->i_security = NULL; - return call_int_hook(inode_alloc_security, 0, inode); + int rc = lsm_inode_alloc(inode); + + if (unlikely(rc)) + return rc; + rc = call_int_hook(inode_alloc_security, 0, inode); + if (unlikely(rc)) + security_inode_free(inode); + return rc; +} + +static void inode_free_by_rcu(struct rcu_head *head) +{ + /* + * The rcu head is at the start of the inode blob + */ + kmem_cache_free(lsm_inode_cache, head); } void security_inode_free(struct inode *inode) { integrity_inode_free(inode); call_void_hook(inode_free_security, inode); + /* + * The inode may still be referenced in a path walk and + * a call to security_inode_permission() can be made + * after inode_free_security() is called. Ideally, the VFS + * wouldn't do this, but fixing that is a much harder + * job. For now, simply free the i_security via RCU, and + * leave the current inode->i_security pointer intact. + * The inode will be freed after the RCU grace period too. + */ + if (inode->i_security) + call_rcu((struct rcu_head *)inode->i_security, + inode_free_by_rcu); } int security_dentry_init_security(struct dentry *dentry, int mode, diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 2720fe3ebf5f..0b593030d9f2 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -148,8 +148,6 @@ static int __init checkreqprot_setup(char *str) } __setup("checkreqprot=", checkreqprot_setup); -static struct kmem_cache *sel_inode_cache; - /** * selinux_secmark_enabled - Check to see if SECMARK is currently enabled * @@ -245,13 +243,9 @@ static inline u32 task_sid(const struct task_struct *task) static int inode_alloc_security(struct inode *inode) { - struct inode_security_struct *isec; + struct inode_security_struct *isec = selinux_inode(inode); u32 sid = current_sid(); - isec = kmem_cache_zalloc(sel_inode_cache, GFP_NOFS); - if (!isec) - return -ENOMEM; - spin_lock_init(&isec->lock); INIT_LIST_HEAD(&isec->list); isec->inode = inode; @@ -259,7 +253,6 @@ static int inode_alloc_security(struct inode *inode) isec->sclass = SECCLASS_FILE; isec->task_sid = sid; isec->initialized = LABEL_INVALID; - inode->i_security = isec; return 0; } @@ -337,14 +330,6 @@ static struct inode_security_struct *backing_inode_security(struct dentry *dentr return selinux_inode(inode); } -static void inode_free_rcu(struct rcu_head *head) -{ - struct inode_security_struct *isec; - - isec = container_of(head, struct inode_security_struct, rcu); - kmem_cache_free(sel_inode_cache, isec); -} - static void inode_free_security(struct inode *inode) { struct inode_security_struct *isec = selinux_inode(inode); @@ -365,17 +350,6 @@ static void inode_free_security(struct inode *inode) list_del_init(&isec->list); spin_unlock(&sbsec->isec_lock); } - - /* - * The inode may still be referenced in a path walk and - * a call to selinux_inode_permission() can be made - * after inode_free_security() is called. Ideally, the VFS - * wouldn't do this, but fixing that is a much harder - * job. For now, simply free the i_security via RCU, and - * leave the current inode->i_security pointer intact. - * The inode will be freed after the RCU grace period too. - */ - call_rcu(&isec->rcu, inode_free_rcu); } static int file_alloc_security(struct file *file) @@ -6840,6 +6814,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), + .lbs_inode = sizeof(struct inode_security_struct), }; static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { @@ -7109,9 +7084,6 @@ static __init int selinux_init(void) default_noexec = !(VM_DATA_DEFAULT_FLAGS & VM_EXEC); - sel_inode_cache = kmem_cache_create("selinux_inode_security", - sizeof(struct inode_security_struct), - 0, SLAB_PANIC, NULL); avc_init(); avtab_cache_init(); diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h index 3304a1ee58a4..7a3d18fa9b13 100644 --- a/security/selinux/include/objsec.h +++ b/security/selinux/include/objsec.h @@ -59,10 +59,7 @@ enum label_initialized { struct inode_security_struct { struct inode *inode; /* back pointer to inode object */ - union { - struct list_head list; /* list of inode_security_struct */ - struct rcu_head rcu; /* for freeing the inode_security_struct */ - }; + struct list_head list; /* list of inode_security_struct */ u32 task_sid; /* SID of creating task */ u32 sid; /* SID of this object */ u16 sclass; /* security class of this object */ diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 364699ad55b9..6617abb51732 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -288,24 +288,18 @@ static struct smack_known *smk_fetch(const char *name, struct inode *ip, } /** - * new_inode_smack - allocate an inode security blob + * init_inode_smack - initialize an inode security blob + * @isp: the blob to initialize * @skp: a pointer to the Smack label entry to use in the blob * - * Returns the new blob or NULL if there's no memory available */ -static struct inode_smack *new_inode_smack(struct smack_known *skp) +static void init_inode_smack(struct inode *inode, struct smack_known *skp) { - struct inode_smack *isp; - - isp = kmem_cache_zalloc(smack_inode_cache, GFP_NOFS); - if (isp == NULL) - return NULL; + struct inode_smack *isp = smack_inode(inode); isp->smk_inode = skp; isp->smk_flags = 0; mutex_init(&isp->smk_lock); - - return isp; } /** @@ -824,17 +818,13 @@ static int smack_set_mnt_opts(struct super_block *sb, /* * Initialize the root inode. */ - isp = smack_inode(inode); - if (isp == NULL) { - isp = new_inode_smack(sp->smk_root); - if (isp == NULL) - return -ENOMEM; - inode->i_security = isp; - } else - isp->smk_inode = sp->smk_root; + lsm_early_inode(inode); + init_inode_smack(inode, sp->smk_root); - if (transmute) + if (transmute) { + isp = smack_inode(inode); isp->smk_flags |= SMK_INODE_TRANSMUTE; + } return 0; } @@ -963,48 +953,10 @@ static int smack_inode_alloc_security(struct inode *inode) { struct smack_known *skp = smk_of_current(); - inode->i_security = new_inode_smack(skp); - if (inode->i_security == NULL) - return -ENOMEM; + init_inode_smack(inode, skp); return 0; } -/** - * smack_inode_free_rcu - Free inode_smack blob from cache - * @head: the rcu_head for getting inode_smack pointer - * - * Call back function called from call_rcu() to free - * the i_security blob pointer in inode - */ -static void smack_inode_free_rcu(struct rcu_head *head) -{ - struct inode_smack *issp; - - issp = container_of(head, struct inode_smack, smk_rcu); - kmem_cache_free(smack_inode_cache, issp); -} - -/** - * smack_inode_free_security - free an inode blob using call_rcu() - * @inode: the inode with a blob - * - * Clears the blob pointer in inode using RCU - */ -static void smack_inode_free_security(struct inode *inode) -{ - struct inode_smack *issp = smack_inode(inode); - - /* - * The inode may still be referenced in a path walk and - * a call to smack_inode_permission() can be made - * after smack_inode_free_security() is called. - * To avoid race condition free the i_security via RCU - * and leave the current inode->i_security pointer intact. - * The inode will be freed after the RCU grace period too. - */ - call_rcu(&issp->smk_rcu, smack_inode_free_rcu); -} - /** * smack_inode_init_security - copy out the smack from an inode * @inode: the newly created inode @@ -4619,6 +4571,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 *), + .lbs_inode = sizeof(struct inode_smack), }; static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { @@ -4637,7 +4590,6 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(bprm_set_creds, smack_bprm_set_creds), LSM_HOOK_INIT(inode_alloc_security, smack_inode_alloc_security), - LSM_HOOK_INIT(inode_free_security, smack_inode_free_security), LSM_HOOK_INIT(inode_init_security, smack_inode_init_security), LSM_HOOK_INIT(inode_link, smack_inode_link), LSM_HOOK_INIT(inode_unlink, smack_inode_unlink),