Re: [PATCH 07/13] kexec: Implementation of new syscall kexec_file_load

From: Borislav Petkov
Date: Mon Jun 16 2014 - 18:11:15 EST


On Mon, Jun 16, 2014 at 05:43:13PM -0400, Vivek Goyal wrote:
> Actually currently I am using vzalloc() for command line buffer
> allocation.
>
> image->cmdline_buf = vzalloc(cmdline_len);
> if (!image->cmdline_buf)
> goto out;
>
> Should I switch to using kzalloc() instead?

Well, vzalloc could trigger the OOM killer, can't it, for the right
size? If so, then we will have a serious problem.

And this snippet above is down the syscall path.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/