Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FA22C6FD19 for ; Fri, 10 Mar 2023 20:50:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbjCJUu1 (ORCPT ); Fri, 10 Mar 2023 15:50:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231256AbjCJUuX (ORCPT ); Fri, 10 Mar 2023 15:50:23 -0500 Received: from sonic314-27.consmr.mail.ne1.yahoo.com (sonic314-27.consmr.mail.ne1.yahoo.com [66.163.189.153]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8795856AA for ; Fri, 10 Mar 2023 12:50:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678481400; bh=KdM6F2zSCxYq550y3/x8Lg3b4muVh7ZZO4D5IzcZ3Es=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=ckggdJGsi+D6p3VumnhYp7J6yc0lvrI++QVQtGZuxC/RgitMnt5pJwFAtdbrCo91dflnc807qLyrB8OAXWTAjoPXklAb+OmIWi05y789GIqUoOQE7wFF9Kw5tG3ol42p/a7ROTxbotfga5H+zjrNdJVkRsg51BTR2rm9wqbx5DXGkGCawe4t2aPF6/r6C+KHr9py/07Gxg6cRz6XwCmSdk/NzZgEUu6OJt+xwQBfYwhuel9ETyiOvr49qkrZuRCprBDrEzkpXNN7+kfK+MUs4y9MSHdkIGkvh8X4NC6RpSEHHWBUks+4bez6sMs+StXPAzwqfvI2syhh+8vksnIdGg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s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yE3kTELQINboi_e6z_dXuhiYu3ubHyUqwPyhZHBNTGZBV.MV Bs3pdu5krKTb8o_pbqwAyQVxkgGV9NkZ4gZJrdRIZjVUrWtvxylv.a2WvlalZKk6e3YGz1I0w6rn hvfAAQ1uz8D6PfLgR5TrvzOk5ZXjsXjn36bhJrMXQg4O.svCVrXmAwmlg7XmRZqNdtQxh23OTaiX GhXM1NlxLI_.AHDOatIZCS8cJCN74FVkDvYPdH2p5aAVFdEf6fqg3wFSqcf7B2oV_Bvog5syfSZn lGjVactHlLnh6g4evRkCe_7aXIYFf0hqxvrY2rs2vGpj0C.1ClnJp_HeumSxjgwG_KTq5U9bdSku iR12qgChpC0W.aXfoKn9IhHjnX5w976dJxxiRK_VLgJhW2PL_4p7Be8tLjBQNFuABd25uCvu11rk JXC0gLEkpfjhlT7YVioGExO9O6r8HWaiKJT_zrQGmWv3HHZqpx3aOIcMvjTr2VlrqMDb.At1yhYv ionTvxFH4E618o2CP10zcFa8xUugz1tvTC_VZwjqg01JqodWBebZdpvb41Cv6.WXS2QNVhdAqLsE j1MvSwWAHGJ1h3uWZuH5a_tN8lq2kopO0p0ycTZO0XpBX5ovgPF2OSTzqES5B.N4rYi_qnjKOGq1 zDFCYFeLNAug- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Fri, 10 Mar 2023 20:50:00 +0000 Received: by hermes--production-ne1-759c9b8c64-f7wvp (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 4519a212add4ad7f27e5b83a7a787923; Fri, 10 Mar 2023 20:49:58 +0000 (UTC) Message-ID: Date: Fri, 10 Mar 2023 12:49:57 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v1 0/2] Add destructor hook to LSM modules Content-Language: en-US To: Mirsad Goran Todorovac , linux-kernel@vger.kernel.org Cc: linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, Greg Kroah-Hartman , Andy Shevchenko , =?UTF-8?Q?Thomas_Wei=c3=9fschuh?= , Mimi Zohar , Paul Moore , =?UTF-8?Q?Christian_G=c3=b6ttsche?= , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , Frederick Lawler , casey@schaufler-ca.com References: <20230310192614.GA528@domac.alu.hr> From: Casey Schaufler In-Reply-To: <20230310192614.GA528@domac.alu.hr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: WebService/1.1.21284 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/10/2023 11:26 AM, Mirsad Goran Todorovac wrote: > LSM security/integrity/iint.c had the case of kmem_cache_create() w/o a proper > kmem_cache_destroy() destructor. LSMs should be using the security blobs associated with system objects rather than doing their own memory management. > > Introducing the release() hook would enable LSMs to release allocated resources > on exit, and in proper order, rather than dying all together with kernel shutdown > in an undefined order. > > Thanks, > Mirsad > > --- > include/linux/lsm_hooks.h | 1 + > security/integrity/iint.c | 7 +++++++ > 2 files changed, 8 insertions(+) > > -- > Mirsad Goran Todorovac > Sistem inženjer > Grafički fakultet | Akademija likovnih umjetnosti > Sveučilište u Zagrebu > > System engineer > Faculty of Graphic Arts | Academy of Fine Arts > University of Zagreb, Republic of Croatia > The European Union