Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1476194pxj; Wed, 19 May 2021 06:54:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxx1Mym0/ceGPFAzaWvZGKCk20PAihZx905SWIaTz4dkynQX1f8+yfqjpc9If3E4AzTF1ku X-Received: by 2002:a05:6402:cb8:: with SMTP id cn24mr14410269edb.325.1621432463972; Wed, 19 May 2021 06:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621432463; cv=none; d=google.com; s=arc-20160816; b=Sn6XIoEYkax13sXdHmUb1Q42gTPo2dMo7p5UmjeWSNEkorDqRA1djrRdRy4l5Da3Uv 8greBR+RHUeNZUx9iH+fGroh6F6oMIA+MhvGt5QGnLbRqJCChL8DXZBS0Y5ZrOXTgofJ 4bF7VOdjfYvqa1mi0JhS96hoSgwyRnzB1BtPhavYq3Gx0fs1A9daeXuGVhDY6z6jgifi srVYJmK64nbbLxpxm3XAU9Y+14ArvWnJp98aLVINA4S16FPAbwMl7mzhawz9eVeeZIIm qIJ2+SRMSbyQRp0n94OBQS13uf1jB1Fadx4a5W8aq0LIv1eHVVuadqVZTJuKrjDuaXOg shvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dWGhCQRTKQ7yccRLGUQNnETO9ChctiK/g8rLylI0oJA=; b=nQOGSQl9iAAsfxZdmhMVPwDYBDhnWTJaLOg1vSSlQN/cLk3gBIeUgU9W48BfdCrd7X wc1y1Kvh6nXvsQ162cNQi5RMMVkvpYnxeC/V4bednfQADSwVmMX3iyen7ud1p7U/uduk QQYHHpUgcG6MHwIplcPFG1q40zT4xag3VfF4pgwsyOlUFJDeRnRO8ZJ+nOQBK2+M4LnK ESf77AkX8NBO+uBBUvqb9DhyQCDIqyByr0DfuxWUn8QFcwJxq1J304tlOCmsHS+ZYjcN EckHRZ9Iw81Tp6xhaufg8fjTKKo1gznQXJ3yMbSKd7ZSC4WkpW4wg9ozdIwR3ZBQCzqI 57kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=egmZl1PT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m14si20202855edr.306.2021.05.19.06.54.00; Wed, 19 May 2021 06:54:23 -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=@infradead.org header.s=casper.20170209 header.b=egmZl1PT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242190AbhERGnH (ORCPT + 99 others); Tue, 18 May 2021 02:43:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239746AbhERGnE (ORCPT ); Tue, 18 May 2021 02:43:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED15C061573; Mon, 17 May 2021 23:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=dWGhCQRTKQ7yccRLGUQNnETO9ChctiK/g8rLylI0oJA=; b=egmZl1PT7u82JatkbyGXeH/9NN jhaKyX5We5mWcOM/lDZ5RxzGup4x8GVqidK0TN7wKRRvQP8IGmxzvVq0CAp6l4XeQH75hggx3bu48 UG6KWUgY+fOzytBC13USeGiBkRM6ecCNYUGMBajkM3mo3i5jKFWuwF95EbJjRnXQe7Xq/bQE33CN9 1caA4At3YDa1pGcKMU632544oIlZuT82e8wACee+qtmIxrzV5Y98nOwQgDulW9uUF8p6mjwUjxLef s53WeXzYmmPZYoVHIRWyTWZZj6DhnqOUNohCzE69HpOT4zEqE+i1t2LBkBr8o5EjiwRS7qOX4NKAo Mctg6q7w==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1litP3-00Dika-IP; Tue, 18 May 2021 06:40:47 +0000 Date: Tue, 18 May 2021 07:40:29 +0100 From: Christoph Hellwig To: "Eric W. Biederman" Cc: Arnd Bergmann , linux-arch@vger.kernel.org, Arnd Bergmann , Christoph Hellwig , Alexander Viro , Andrew Morton , Borislav Petkov , Brian Gerst , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Linux ARM , linux-kernel@vger.kernel.org, Linux-MM , kexec@lists.infradead.org Subject: Re: [PATCH v3 1/4] kexec: simplify compat_sys_kexec_load Message-ID: References: <20210517203343.3941777-1-arnd@kernel.org> <20210517203343.3941777-2-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 10:57:24PM -0500, Eric W. Biederman wrote: > We open ourselves up to bugs whenever we lie to the type system. > > Skimming through the code it looks like it should be possible > to not need the in_compat_syscall and the casts to the wrong > type by changing the order of the code a little bit. What kind of bug do you expect? We must only copy from user addresses once anyway. I've never seen bugs due the use of in_compat_syscall, but plenty due to cruft code trying to avoid it.