Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1727150pxj; Wed, 19 May 2021 12:26:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhD9No6NF2mxaVaL7KQgMeHfZK5CFJUJDZGJv6hMCd/vDWMgQjHIMq/qZnzef9S1NdcFHk X-Received: by 2002:a5d:8246:: with SMTP id n6mr1238814ioo.73.1621452395117; Wed, 19 May 2021 12:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621452395; cv=none; d=google.com; s=arc-20160816; b=EtlPioJrEn8KM8EL4RVxIgR9p7q2wIY4tFqHYzKDhW015o0TiWRCk2rHorhzoAG8rb RfeF/KrBYapSyr7IHgQ4z2q4XO4sqivM78WtYlBRiMQHqza3OnFh6ak74R/D1IEs4wKT u1jeiC3jBtSv18rF2Og6CPgtHDJtuj7oBwevIBcGEl7jKoQSDacw0luQYLdNTpDDMxpW fkwdXkP1jNDk2WkbSabMv/bRx+VJB/1OvBJTAGrblPbXV1Ci6kyz4WmiQ3VPhUuYI+Fi DNJ5zCfB8OvcSvb9x6Lw7Ni3tvVQj6OiIkQtWXIAoVLbFUJ1SbB3f5kmYJFtT0oDT9uF l5lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qB9OFnBMcAjCRRKnjLXGphv1Xf4AIj6KZusezLcH8sY=; b=mfZqe2bDsQ9U7eCxsHlL/afKHXEPZ9yKRkyM1t3JKo4u1aSC7L76/+8vlbjwL8cgEB rbqoY+CFDHsPbrcclgNyQY++17i1VXZ1UUQ+Ym9mqgsvti5sEXky7ZDz7DX9qB9Svvhp lsBkHtQPTH0KE5DkApS08zMB6My8iUthQL76VP/hkCTETEzaWNyjdFRPPbsdczxpexB2 cCPQIkumtotNhjjNASOaUXshXB7wnBAdDTyxebVjQM+2MvkAmeodAbFTeaNDAr4TaBYx x4M2KjLes6saVKAXId9CN3jtpE8Xah6V2xzZ8g54wHDaznDRtvcAJsVc+oS62XO/3Na5 ZMZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GYQJtAh0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si191180jap.30.2021.05.19.12.26.22; Wed, 19 May 2021 12:26:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GYQJtAh0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345323AbhESJ5l (ORCPT + 99 others); Wed, 19 May 2021 05:57:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:58390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239269AbhESJ5k (ORCPT ); Wed, 19 May 2021 05:57:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 863CD610A1; Wed, 19 May 2021 09:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621418179; bh=sZokVnqgg00yP4zqIdHOGtJNBrDhc7J4zbJvv0Ja+io=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GYQJtAh0WaKxA6miEevGbUjT/mk3FvnIDKg/CajqjoSahOznMEGHCRzfEIrcVsIgw jVonLhDVI3iO2i3b48e+LZgxHdDKmIXzTZmGy8LtB+vutYxuwIPD3D0SfNma2Dy8bH fIaAfkbRt74xUeORaRxWYpDorVwd4ufaJvtD42xpkC7PBMC6VvqF0GH+RRw5BS9Y9F V/XLOyj7zDVj9SRnU2xFjKcCjHrJhnvUImDYRi1Ao/BOX9t7RGebtf4046niW1Mxzw 6jRAK7SIiwi+H/pR2F0wkuhdZKh7EXx+LRh+Cy2bMyX9b9vO+N7Fcdjv0axjqcDG8o QNbVDBUWvjxFg== Received: by mail-wr1-f53.google.com with SMTP id a4so13364466wrr.2; Wed, 19 May 2021 02:56:19 -0700 (PDT) X-Gm-Message-State: AOAM531dYy8s1uPLEIP3jP1WMmCoOn6IeJm4Iq2/B6YOHtnmza8eUHk5 pvFhIrr7F+ECAsC+KvifBVO/8I6Bbyc2hrszHeQ= X-Received: by 2002:adf:e589:: with SMTP id l9mr13892459wrm.361.1621418178204; Wed, 19 May 2021 02:56:18 -0700 (PDT) MIME-Version: 1.0 References: <20210517203343.3941777-1-arnd@kernel.org> <20210517203343.3941777-2-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Wed, 19 May 2021 11:55:05 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/4] kexec: simplify compat_sys_kexec_load To: "Eric W. Biederman" Cc: linux-arch , Christoph Hellwig , Alexander Viro , Andrew Morton , Borislav Petkov , Brian Gerst , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Linux ARM , Linux Kernel Mailing List , Linux-MM , kexec@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 12:45 AM Eric W. Biederman wrote: > Arnd Bergmann writes: > > On Tue, May 18, 2021 at 4:05 PM Arnd Bergmann wrote: > >> On Tue, May 18, 2021 at 3:41 PM Eric W. Biederman 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