Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37067458rwd; Tue, 11 Jul 2023 09:03:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlHUGqOET7+If4g5+oau8YfVVfxYVoMV1AfA9GAxF0JA8cAHDz4xytNauf+xDDGhOlwYEmW5 X-Received: by 2002:a17:90a:1b09:b0:263:f776:8ba3 with SMTP id q9-20020a17090a1b0900b00263f7768ba3mr13260806pjq.9.1689091391035; Tue, 11 Jul 2023 09:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689091391; cv=none; d=google.com; s=arc-20160816; b=CPIN2lrx5hgndGwWG1Z+FsKJi6LfZkBrAb/YIYEFJcccitY8GVmMhSaDnm9O92A3u1 e8Gd7guFOFMuEk8Hme9BJ9cISLmj+9dByIn8Gx1Vw1Nj9pMDqkD2cj8djdpSnVOL5RQq D+jIZgiYEVWupcAkET3qb/Egq+WXvUliDDdi1hK8Fv8OS2Zmc1zGaFxgfINk9JR9GVxq kpjtlkDztRcWDdeU2iiHudfi5RzGNm/HU0VG8C+vkJ6jj1Ay1D0QrsgLEWufXfIOOcFW +D2RdzK835akEOr5ah1gilcgp2ZC/sqG/G/6zQQNt8+Pds3mtIZQJZWPVtDN8742EiRs 1/4w== 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=/cNKZT0w/ttrTTuQnq2pupPxaZ8+d56ppimt6LWSmTY=; fh=rHOtpCh469xEAjD6nRc/zoWEnkSg7uL+pYnBoKQj+8M=; b=GL7rmlB8ydsjj0mN7sf+76x5tnw1/IOrvh5+U/7WsvnRpBU31XhZhTTnvh9VhOiPwM qo6jMWQ5l1o4DVAc/qjMoz1Q2J/CqyWuvO2UVspXbpvmaHh+P5/7IVsZfmNRGF29e3Iy HX04bFgtLX09GxRk5Ski0j9Ygbg4e7tDOsapi86En6AszoVSsmFIzUI6FOVQaTYv7l8h YPNtUsAglYsZHkDLUIxatLXoc9+7v08ZfauHzjdysomLzyu8vdeSksRS9WICkEBiFcoR KbzCqLZMTWq4lnkHwz+Nhd83z2i5jCfOvoIkQxeBcs66RAV/hdfJ4+twLdFO8iXqXrHy Ir/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=I7NZ7oud; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gc21-20020a17090b311500b0023a177c4951si1826489pjb.39.2023.07.11.09.02.54; Tue, 11 Jul 2023 09:03:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=I7NZ7oud; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232187AbjGKPyA (ORCPT + 99 others); Tue, 11 Jul 2023 11:54:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231219AbjGKPx7 (ORCPT ); Tue, 11 Jul 2023 11:53:59 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DA7BFB for ; Tue, 11 Jul 2023 08:53:57 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-66869feb7d1so3133678b3a.3 for ; Tue, 11 Jul 2023 08:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689090836; x=1691682836; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/cNKZT0w/ttrTTuQnq2pupPxaZ8+d56ppimt6LWSmTY=; b=I7NZ7oudXfX7DjTOHGibnmEqu5Y6r8jhwGNq5nuByp5Cm8CzCU+gBB6L8H3wfxEBLH PCkIik1Ed0RTDeFUuIdLGcrQrp8GWBfKtwRkSFpJawxZhaTPedElAPQxXBeihxdL+vKe wuwPQtwSgiId3KLkKrEBCOCzZMeONSlUH1xrY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689090836; x=1691682836; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/cNKZT0w/ttrTTuQnq2pupPxaZ8+d56ppimt6LWSmTY=; b=aOtbZqbh/MVlTtWyj1eAxaMQGBNlhIucUQa/0ReeRJESXWGfQ65FWy1s5HWunnujhp /M7b78vmcIpLZTM7Z0aem6IVoKomYQl0T1Sz7R0RYQe+/WW5QzNLobrLNGNuF88/FjuZ 5wo2iBJPoMGNIWLciPgQEz01+1HpsdRgZwYxodtB3Tb4OdY/HfdehzqlXiP1O9WZ4IJD 3oZ+2/YxTnbkyxefbRijr15c97mzbU8O+VAZ28TUcyFAuLSLkzkId5eymmGxUT067H/E Toz2UWzE7+hwRCTm8eHOTa2kp9dBKfeMG2XSaiYPTCakUvdKzx0yqwr3pQLo/QYeBjsR P5zw== X-Gm-Message-State: ABy/qLaCDJ6AWv1Ar4v3SZA1t7YNI+YfkH4O76lZqE/8vPbTFbYaGA5w WQz2FdnJ43SnD/+z1i8n58IQBg== X-Received: by 2002:a17:902:c212:b0:1b8:5bb4:8230 with SMTP id 18-20020a170902c21200b001b85bb48230mr12101183pll.50.1689090836550; Tue, 11 Jul 2023 08:53:56 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id i5-20020a1709026ac500b001b8918da8d1sm2100722plt.80.2023.07.11.08.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 08:53:56 -0700 (PDT) Date: Tue, 11 Jul 2023 08:53:55 -0700 From: Kees Cook To: Greg Ungerer Cc: linux-riscv@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, palmer@dabbelt.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, brauner@kernel.org Subject: Re: [PATCH v2 2/2] riscv: support the elf-fdpic binfmt loader Message-ID: <202307110852.E093C93F@keescook> References: <20230711130754.481209-1-gerg@kernel.org> <20230711130754.481209-3-gerg@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230711130754.481209-3-gerg@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 11, 2023 at 11:07:54PM +1000, Greg Ungerer wrote: > Add support for enabling and using the binfmt_elf_fdpic program loader > on RISC-V platforms. The most important change is to setup registers > during program load to pass the mapping addresses to the new process. > > One of the interesting features of the elf-fdpic loader is that it > also allows appropriately compiled ELF format binaries to be loaded on > nommu systems. Appropriate being those compiled with -pie. > > Signed-off-by: Greg Ungerer ELF stuff looks fine to me. If the RISC-V folks are happy with the rest, this looks good. Acked-by: Kees Cook Please feel free to carry this in the RISC-V tree. If you'd rather it go via execve tree, please let me know. :) -Kees -- Kees Cook