summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_misc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-09-05 20:45:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-09-05 20:45:18 -0700
commit1fc5a74b108fc90951890ec513ac81869f5eaff1 (patch)
treeddd247abac0e8e148e4ded357db093bee4fe35ed /fs/binfmt_misc.c
parent9f0346dcbea363787186c94ef94dd01aaa215afa (diff)
parent3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d (diff)
downloadlinux-stable-1fc5a74b108fc90951890ec513ac81869f5eaff1.tar.gz
linux-stable-1fc5a74b108fc90951890ec513ac81869f5eaff1.zip
Merge tag 'kmalloc_obj-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull kmalloc_obj conversions from Kees Cook: "Another run of the Coccinelle script for converting kmalloc() family of allocations to kmalloc_obj() via the existing rules in scripts/coccinelle/api/kmalloc_objs.cocci" * tag 'kmalloc_obj-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: treewide: refresh kmalloc_obj() conversions drm/amd/display: Fix harmless type mismatch in allocation
Diffstat (limited to 'fs/binfmt_misc.c')
-rw-r--r--fs/binfmt_misc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index ddfd3aa57..620da8594 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -331,8 +331,8 @@ static int entry_attach_interpreter(struct binfmt_misc_entry *e,
return -ENOSPC;
/* One allocation, both strings in it, like the entry's own buffer. */
- interp = kmalloc(struct_size(interp, name, nlen + plen + 2),
- GFP_KERNEL_ACCOUNT);
+ interp = kmalloc_flex(*interp, name, nlen + plen + 2,
+ GFP_KERNEL_ACCOUNT);
if (!interp) {
dec_ucount(ucounts, UCOUNT_BINFMT_MISC_INTERPRETERS);
return -ENOMEM;
@@ -858,8 +858,7 @@ static struct binfmt_misc_entry *create_entry(const char __user *buffer,
if ((count < 11) || (count > MAX_REGISTER_LENGTH))
return ERR_PTR(-EINVAL);
- e = kmalloc(struct_size(e, buf, count + MISC_DELIM_PAD),
- GFP_KERNEL_ACCOUNT);
+ e = kmalloc_flex(*e, buf, count + MISC_DELIM_PAD, GFP_KERNEL_ACCOUNT);
if (!e)
return ERR_PTR(-ENOMEM);