Re: [PATCH v3 1/4] kexec: simplify compat_sys_kexec_load

From: Arnd Bergmann
Date: Wed May 19 2021 - 05:56:25 EST


On Wed, May 19, 2021 at 12:45 AM Eric W. Biederman
<ebiederm@xxxxxxxxxxxx> wrote:
> Arnd Bergmann <arnd@xxxxxxxxxx> writes:
> > On Tue, May 18, 2021 at 4:05 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
> >> On Tue, May 18, 2021 at 3:41 PM Eric W. Biederman <ebiederm@xxxxxxxxxxxx> wrote:
>
> I think something like the untested diff below is enough to get rid of
> compat_alloc_user cleanly.
>
> Certainly it should be enough to give any idea what I am thinking.

Yes, that looks sufficient to me. I had started a slightly different
approach by trying
to move the kimage_alloc_init() into the top-level entry points to
avoid the extra
kmalloc, but that got rather complicated, and your patch is simpler overall.

The allocation could still be combined with kexec_load_check() into a new
function to reduce the number of duplicate lines, but if you think the current
version is ok, then I'll leave this part as it is.

I've fixed a duplicate kfree() and some whitespace damage, and rebased the
rest of my series on top of this to give it a spin on the build test boxes.
I'll send a v4 series once I have made sure there are no build-time regressions.

Can I add your Signed-off-by for the patch?
Is there a set of tests I should run on it?

Arnd