Messages in this thread Patch in this message | | | From | Fabian Frederick <> | Subject | [PATCH 1/1] fs/binfmt_elf.c: replace count*size kmalloc by kmalloc_array | Date | Wed, 25 Jun 2014 20:41:49 +0200 |
| |
kmalloc_array manages count*sizeof overflow.
Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Fabian Frederick <fabf@skynet.be> --- fs/binfmt_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 3892c1a..49b1880 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1816,7 +1816,7 @@ static int elf_note_info_init(struct elf_note_info *info) INIT_LIST_HEAD(&info->thread_list); /* Allocate space for ELF notes */ - info->notes = kmalloc(8 * sizeof(struct memelfnote), GFP_KERNEL); + info->notes = kmalloc_array(8, sizeof(struct memelfnote), GFP_KERNEL); if (!info->notes) return 0; info->psinfo = kmalloc(sizeof(*info->psinfo), GFP_KERNEL); -- 1.9.1
| |