From: "Serge E. Hallyn" <serge@hallyn.com>
To: Paul Moore <paul@paul-moore.com>
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] lsm: use lsm_blob_alloc() in lsm_bdev_alloc()
Date: Wed, 6 Aug 2025 20:13:18 -0500 [thread overview]
Message-ID: <aJP9rnEH1OJA2JJ6@mail.hallyn.com> (raw)
In-Reply-To: <20250806212552.240730-2-paul@paul-moore.com>
On Wed, Aug 06, 2025 at 05:25:53PM -0400, Paul Moore wrote:
> Convert the lsm_bdev_alloc() function to use the lsm_blob_alloc() helper
> like all of the other LSM security blob allocators.
>
> Signed-off-by: Paul Moore <paul@paul-moore.com>
Acked-by: Serge Hallyn <serge@hallyn.com>
> ---
> security/security.c | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/security/security.c b/security/security.c
> index ad163f06bf7a..a88ebfca3224 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -823,16 +823,8 @@ static int lsm_msg_msg_alloc(struct msg_msg *mp)
> */
> static int lsm_bdev_alloc(struct block_device *bdev)
> {
> - if (blob_sizes.lbs_bdev == 0) {
> - bdev->bd_security = NULL;
> - return 0;
> - }
> -
> - bdev->bd_security = kzalloc(blob_sizes.lbs_bdev, GFP_KERNEL);
> - if (!bdev->bd_security)
> - return -ENOMEM;
> -
> - return 0;
> + return lsm_blob_alloc(&bdev->bd_security, blob_sizes.lbs_bdev,
> + GFP_KERNEL);
> }
>
> /**
> --
> 2.50.1
>
next prev parent reply other threads:[~2025-08-07 1:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 21:25 [PATCH] lsm: use lsm_blob_alloc() in lsm_bdev_alloc() Paul Moore
2025-08-06 21:35 ` Casey Schaufler
2025-08-07 1:13 ` Serge E. Hallyn [this message]
2025-08-07 1:49 ` Paul Moore
2025-08-11 22:16 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aJP9rnEH1OJA2JJ6@mail.hallyn.com \
--to=serge@hallyn.com \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox