Message ID | 20230310231107.10954-2-mirsad.todorovac@alu.unizg.hr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp22221wrd; Fri, 10 Mar 2023 15:26:04 -0800 (PST) X-Google-Smtp-Source: AK7set9CpuOnY7lKV/td9M956xYnM1R6XUtmBW8x/u6vnw3sJMgkoHAbZR1ioV9Kc9tOWuEjwLhJ X-Received: by 2002:a05:6a20:c126:b0:cd:74aa:df55 with SMTP id bh38-20020a056a20c12600b000cd74aadf55mr22229997pzb.25.1678490764643; Fri, 10 Mar 2023 15:26:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678490764; cv=none; d=google.com; s=arc-20160816; b=M/8bMRtpYeEfyLNM9QGlaawWs1mIorrs9Eo0Ktte7PnzpQrgHjtiijlxE7nI2vbLUn b9jFJU4WV2BJTAA3D0tTYULxIrNGM0D06lb/kdQzFqnXlruqEBO2T0tylIypmuhTtKG0 +2ZRAloN1hCI81DgP0CEmFH0K3g45nK3AUSkPsvxA3dFFmb7cKWco+G3yPxhNNg4SXUM tfqjM8usshdmvW3yznE0E4PSfAzzKt4HOMI6fYuUm7EheBKJvE+hHqufejMpEhNS6hQQ iSGTVyWIwYskLM7t2QuTMOiBfvIIhJ+ifD3Sjv6aYGCbIXVkjrdDk/hgSmpAaOEEne5U +21Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=ED6ezLXrL9CFXsqxAbBr7DDMkDwEYUgpEvjNk2r2pSg=; b=M7Gqg6gfJdrF0Ck+H40CoUhYAA0qAcurvpCah9SToR0ZOyagus2mVnElLuOYi0S38Z G4SlDIuPYkQZ1sHwuwT5Kw7GWwXRjy0kUzOMzSafRJ2KqEg0vEwZ1TPbF1Rdjh11NmWK iL/yl0xLJehfryqFLl7NqExJE5aJyAowV5dDpAWzzXz2YtBXojraLMibjuFu4zN3Drgd AEqzs6tByFgs9OL6p+MfG/bhWgwv/sdQw0HEBuMqP9NzfRZ7bBX6exF16JmTVTRgaIKi JzBjwjVnEqCk9JqaUQVPBJggl+UWgfwvQJq4DNqjXLbt8FtcUv8zuqrymth6dFx0//re jhBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=JktBqM7m; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=ajKfVE80; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t190-20020a6381c7000000b00502fd79e642si854438pgd.696.2023.03.10.15.25.51; Fri, 10 Mar 2023 15:26:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=JktBqM7m; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=ajKfVE80; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231668AbjCJXSL (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Fri, 10 Mar 2023 18:18:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbjCJXRo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Mar 2023 18:17:44 -0500 Received: from domac.alu.hr (domac.alu.unizg.hr [161.53.235.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10C1AFF31 for <linux-kernel@vger.kernel.org>; Fri, 10 Mar 2023 15:17:43 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id BD7E5604ED; Sat, 11 Mar 2023 00:17:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1678490261; bh=5I+WvBSzoM2mlJPk0nTQr8Oi3xePeOSo4Gorb+Mc1uY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JktBqM7mrXFW7qOe94eXOvome05S27eBUgDKRO89O+QeZgZD3aaL5l/mOtyiIoOSr NvyNTgoT/v67X3qgCvI0Wm9QFlKtyC2W9vs1qrjp6G60Cpd4WHVOt/r4NAcx3oeHGc F4NAnWC+UEP0kDmjCS/rMHnzW98ruQGBZQP3KLFIFwAWJ+nVRZvaay6sYuV3rqNvcp kUnOa3jLfRsG//Uu+eS3rKLQ4zabUg4jcd6Ksaw/CG2TdEJjzxvEf4v1bkifrs5low XYgCmnFqSG7AH7ZHCpPXykpSaTcMaCv2Z+OzWa70DiwKRAsDui0pV3KaOdPmrmWMup eUT1mFysgw9yg== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4HtJHmUCYQqj; Sat, 11 Mar 2023 00:17:39 +0100 (CET) Received: by domac.alu.hr (Postfix, from userid 1014) id 96161604EF; Sat, 11 Mar 2023 00:17:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1678490259; bh=5I+WvBSzoM2mlJPk0nTQr8Oi3xePeOSo4Gorb+Mc1uY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ajKfVE80Mc+oBKQN7UKhTFCrez7FjkNjFx/fm08z4P6I01WMSUfhlN4DnoUWsV2Fa 0q5girtd+ubwIaXhCkCuFNmBWNJCrDwyk+s6DJkAtKsk+EYXuI95f5Qt7YCMWGhKIL VVWBiD2N+aeJKq6sZX2knItZ2aBZ3Vl3O62U9uhkyTM7OOTFiZ1DeZ8MieqIKnoDRz lnpdEr2gDYpzWCuSBNaL91gmgyUG5v7yyswT0MEo7fPt2IFBg+vCa5+EjBUTabTWSa uHFHkBlcATdkMgwTTZBtP7XtR16FUGbky6FXs4oNoAG2CUkKThzMK2Jls85goyp8wE 6yKLCWAzb4l0g== From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr> To: Paul Moore <paul@paul-moore.com>, Roberto Sassu <roberto.sassu@huawei.com>, linux-kernel@vger.kernel.org Cc: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Mimi Zohar <zohar@linux.ibm.com>, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net>, Casey Schaufler <casey@schaufler-ca.com>, =?utf-8?q?Christian_G=C3=B6ttsche?= <cgzones@googlemail.com>, =?utf-8?q?Mic?= =?utf-8?q?ka=C3=ABl_Sala=C3=BCn?= <mic@digikod.net>, Frederick Lawler <fred@cloudflare.com> Subject: [PATCH v1 2/2] integrity: Add the release() hook to the integrity LSM module Date: Sat, 11 Mar 2023 00:11:10 +0100 Message-Id: <20230310231107.10954-2-mirsad.todorovac@alu.unizg.hr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230310231107.10954-1-mirsad.todorovac@alu.unizg.hr> References: <20230310231107.10954-1-mirsad.todorovac@alu.unizg.hr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, PP_MIME_FAKE_ASCII_TEXT,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760025131709327698?= X-GMAIL-MSGID: =?utf-8?q?1760025131709327698?= |
Series |
[v1,1/2] LSM: add a release() hook for the clean exit cleanup of the LSM modules
|
|
Commit Message
Mirsad Todorovac
March 10, 2023, 11:11 p.m. UTC
The kmem_cache_create() callback in the init() hook of the integrity LSM
module doesn't have a corresponding kmem_cache_destroy() function call.
The allocated cache is destroyed on kernel shutdown in an undefined manner.
This patch should define a proper destructor to deallocate resource in a
well-behaved, defined order.
Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mimi Zohar <zohar@linux.ibm.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Thomas Weißschuh <linux@weissschuh.net>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Cc: Christian Göttsche <cgzones@googlemail.com>
Cc: Mickaël Salaün <mic@digikod.net>
Cc: Frederick Lawler <fred@cloudflare.com>
---
security/integrity/iint.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/security/integrity/iint.c b/security/integrity/iint.c index 8638976f7990..3f69eb702b2e 100644 --- a/security/integrity/iint.c +++ b/security/integrity/iint.c @@ -179,9 +179,16 @@ static int __init integrity_iintcache_init(void) 0, SLAB_PANIC, init_once); return 0; } + +static int __exit integrity_iintcache_release(void) +{ + kmem_cache_destroy(iint_cache); +} + DEFINE_LSM(integrity) = { .name = "integrity", .init = integrity_iintcache_init, + .release = integrity_iintcache_release, };