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=-6.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 55BC1C433EA for ; Wed, 15 Jul 2020 06:38:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32D30206D5 for ; Wed, 15 Jul 2020 06:38:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Nrld92ni" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728912AbgGOGiS (ORCPT ); Wed, 15 Jul 2020 02:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728297AbgGOGiS (ORCPT ); Wed, 15 Jul 2020 02:38:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51FF8C061755; Tue, 14 Jul 2020 23:38:18 -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:Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JjVa0h4uFSr2pzBmFgAMpiW1sZBe7zjYlnhnjdkNvjg=; b=Nrld92niBIg4BKo4cgE4ZelgP1 innve4muRc5oAjEgDb57YCbrEE7Qhj1OHEYntVm8RUPhrwuYfkfwbJi9Oyr0v+kS5H7cWJ28EIcDu eBk4EMFXio/feaPCuFfNKiqK+oK+b0sReMiV39yvKE2ck5BsAgomojcLfYg+EbPZQnR8VozRs8Qo4 y9prd7gaPANubKbwYqofAG9GYDcftRZz0Je5yJrlzZWJaApD/582jp3jEOcLN3eR96aQjAnzeKb1B s90pKPMZye8LhKiBd14Zdj/Fk2Z02lLSAYHqzJ3lsDft+djoqBJF0ov6Tq61SvUg2t9zpoSQQ0RxM 9XqazZHA==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvb3Y-00010O-1N; Wed, 15 Jul 2020 06:38:16 +0000 Date: Wed, 15 Jul 2020 07:38:15 +0100 From: Christoph Hellwig To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Kees Cook , Andy Lutomirski , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Al Viro , Luis Chamberlain , linux-fsdevel@vger.kernel.org, Tetsuo Handa , linux-security-module@vger.kernel.org, "Serge E. Hallyn" , James Morris , Kentaro Takeda , Casey Schaufler , John Johansen , Christoph Hellwig Subject: Re: [PATCH 6/7] exec: Factor bprm_stack_limits out of prepare_arg_pages Message-ID: <20200715063815.GF32470@infradead.org> Reply-To: Iha@infradead.org References: <871rle8bw2.fsf@x220.int.ebiederm.org> <87365u6x60.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87365u6x60.fsf@x220.int.ebiederm.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 08:31:03AM -0500, Eric W. Biederman wrote: > > In preparation for implementiong kernel_execve (which will take kernel > pointers not userspace pointers) factor out bprm_stack_limits out of > prepare_arg_pages. This separates the counting which depends upon the > getting data from userspace from the calculations of the stack limits > which is usable in kernel_execve. > > The remove prepare_args_pages and compute bprm->argc and bprm->envc > directly in do_execveat_common, before bprm_stack_limits is called. > > Signed-off-by: "Eric W. Biederman" > --- This looks basically identical to my "exec: split prepare_arg_pages". I slightly prefer the version I had, but this looks ok as well: Reviewed-by: Christoph Hellwig