The patch titled Subject: resource: Use 2-factor allocator calls has been added to the -mm tree. Its filename is resource-add-walk_system_ram_res_rev-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/resource-add-walk_system_ram_res_rev-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/resource-add-walk_system_ram_res_rev-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Kees Cook <keescook@xxxxxxxxxxxx> Subject: resource: Use 2-factor allocator calls As already done treewide, switch from open-coded multiplication to using 2-factor allocation helpers. Link: http://lkml.kernel.org/r/20180704173153.GA34386@beast Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx> Cc: AKASHI Takahiro <takahiro.akashi@xxxxxxxxxx> Cc: Baoquan He <bhe@xxxxxxxxxx> Cc: Wei Yang <richard.weiyang@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN kernel/resource.c~resource-add-walk_system_ram_res_rev-fix kernel/resource.c --- a/kernel/resource.c~resource-add-walk_system_ram_res_rev-fix +++ a/kernel/resource.c @@ -453,7 +453,7 @@ int walk_system_ram_res_rev(u64 start, u int ret = -1; /* create a list */ - rams = vmalloc(sizeof(struct resource) * rams_size); + rams = vmalloc(array_size(rams_size, sizeof(struct resource))); if (!rams) return ret; @@ -469,8 +469,8 @@ int walk_system_ram_res_rev(u64 start, u int rams_new_size; rams_new_size = rams_size + 16; - rams_new = vmalloc(sizeof(struct resource) - * rams_new_size); + rams_new = vmalloc(array_size(rams_new_size, + sizeof(struct resource))); if (!rams_new) goto out; _ Patches currently in -mm which might be from keescook@xxxxxxxxxxxx are ntfs-aops-remove-vla-usage.patch ntfs-decompress-remove-vla-usage.patch ntfs-mft-remove-vla-usage.patch resource-add-walk_system_ram_res_rev-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html