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

Borislav Petkov
2014-06-13T15:36:46Z

On Fri, Jun 13, 2014 at 08:46:09AM -0400, Vivek Goyal wrote:
> If not, then we really can't do anything about it. A large memory
> allocation will fail and user will get error.

Of course we can! You can't trust userspace and you need to check the
values it gives you through the syscall.

And you need a sane default. The fact that I even have to state this
explicitly...!

So what if userspace gives a maximum value for which allocation
succeeds? Does that mean that the kernel should blindly comply and
allocate? Of course not! That would be dumb.

> I disagree here. What if new kernel supports (2 * COMMAND_LINE_SIZE)
> length command line. We don't want to truncate command line to smaller
> size because running kernel does not support that long a command line.

Do you have a sensible use case where 2048 cmdline size (on x86) won't
be enough and you really need it larger?

And even if this is a problem - which I seriously doubt - it would be
problem with the 1st kernel too, not only with the kexec-ed one.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--