From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7DD0C433B4 for ; Tue, 18 May 2021 06:41:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B054060240 for ; Tue, 18 May 2021 06:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239757AbhERGnF (ORCPT ); Tue, 18 May 2021 02:43:05 -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-arch@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.