Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4113952rdh; Fri, 29 Sep 2023 11:28:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXlmPx37xfipwkk551Bx9HcnzVQ46atv0FpKMFF8tPvVbVrHjinmPYQ7rmLaWQPCkR0xxE X-Received: by 2002:a17:90a:3483:b0:274:4e9b:7a1a with SMTP id p3-20020a17090a348300b002744e9b7a1amr4807354pjb.44.1696012122876; Fri, 29 Sep 2023 11:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696012122; cv=none; d=google.com; s=arc-20160816; b=bEDIcwg44aJztkElBvtHq2/HEFbdyh2xlwTZiPg8Cr01VCJ3vDR+SB0uqIUmSCy199 d7x5+4bHrJwJllr5Xebm4oCQQ4+jsYJoQJ9BTIx24t4Ggd6AFWeqq+oKcEtzFLWCa99w H+XhZig1cb2HZUfdabUCYP5oROQVDAzRnKpif696zaXXk8pyp7IxEFqOQSCizpZB8Pb8 gkpaMK7Ti2n1Yz359o5GR8WP9D+M5Ldq8vJds/PnBoAqCkIv9/il6x7CvQi2uZded7Ms E8LAQOjGb+lYDPA7VlttmChizZ1Q0u6nC3eJ01XUK/nZoymbAtoc5LK1SV6YBfz9Urcn LRmg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rxYI9ulX5XzPX5XOXonON+SMQGYguOvm0R6V5aclg6A=; fh=VsAwT/zurujF07uWDaFAC8KdU1EvC1el4XI6UNuYWKE=; b=PhaBFoJ5pHPZ4JNW2ECh10E1RNAeLEZpT5OuT1XUniqdz/4qqoYOhnEpVlm+Egx0Rs AQ+H7bUegfV2yJ8EtFyQ9Q0i0jHGYIiT5Zmh9QOmlOYy7XZBESGKR/JfX8pijNLznhPh M9iMMzvS7cF5lepnxfequGDYhzO4g1ozp1AZq2B4wjfmJdkrYdlhC1JOE1EMw6IeHyWG IERegxHhPmX0ocY0DqjOX2v7wQ/PWKhY+XN01U73SlBztLda76groCJJ38AE97LpvMwE I0C3AMd7bNJl0Nw8NiMxIWcXlo+pTEiIqKixRp8Pykq2ycsuNEzrb8MaqFAomWUspeFo gSpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bu1AoD1M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id g14-20020a17090a640e00b00278f7d7cd43si2039005pjj.168.2023.09.29.11.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 11:28:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bu1AoD1M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DFBB9805E43B; Fri, 29 Sep 2023 10:06:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233472AbjI2RGT (ORCPT + 99 others); Fri, 29 Sep 2023 13:06:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233215AbjI2RGS (ORCPT ); Fri, 29 Sep 2023 13:06:18 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFD1B193 for ; Fri, 29 Sep 2023 10:06:16 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-68fb85afef4so12257348b3a.1 for ; Fri, 29 Sep 2023 10:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696007176; x=1696611976; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=rxYI9ulX5XzPX5XOXonON+SMQGYguOvm0R6V5aclg6A=; b=bu1AoD1MBVuaFoU4Kuqjuqz5JwkYDxAb/pFXZk9XNWc31UlGWoURxzrRJKID/C5YQq GEenO95S0XOakk+8QV8UB7b5BzrBZ6AmxiUv10KSb1orI0GOiPELysEe8Wuk5eVnd8pN qcXdvyBgGUXe5HqINyWSntdWcpSuTAG/sM+cA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696007176; x=1696611976; h=in-reply-to:content-transfer-encoding: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=rxYI9ulX5XzPX5XOXonON+SMQGYguOvm0R6V5aclg6A=; b=Dpq4yiDbA4OydnHqYEnK8j+wZQKdFheXxhTPV4GCY2phGRERtxftCyPdc766L4seMl pPgcCKBOj8Fiktl1uNkgpBhiYcxAvxRxaqY+5yZbgCiNsyPRO9122JxnEv+FWqBSGSrK Gm2Sbsl1cY4pLDnKn7/3ZtCFk9juiCTbNKJB+rcJm3UlN04IKRlWmuZFHmjMKt07UwBM Esr2YU+T97wqFudAwb+VndAkRleZRq23CVvdp8WbT4lPOVtdPPljbeNhISDSCvd32XII Mi1aXy+5gBX6kIrlITSL5DQaUcpG0K6JjNgbHgi42ZWZ0litm1vbpJtl8bhp72PkKROZ 7aOw== X-Gm-Message-State: AOJu0YyfgS/N2otpCGPSVCPQyV2/tIReYYDr+Bus8QWIryvg+ZbLmmbf K/HayxVzb13GYyNHq/5qrU/JjA== X-Received: by 2002:a05:6a20:3d04:b0:153:7978:4faa with SMTP id y4-20020a056a203d0400b0015379784faamr5859933pzi.37.1696007176255; Fri, 29 Sep 2023 10:06:16 -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 fk1-20020a056a003a8100b00682868714fdsm15810970pfb.95.2023.09.29.10.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 10:06:15 -0700 (PDT) Date: Fri, 29 Sep 2023 10:06:14 -0700 From: Kees Cook To: Pedro Falcato Cc: Eric Biederman , Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Sebastian Ott , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Andrew Morton , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH v4 4/6] binfmt_elf: Use elf_load() for library Message-ID: <202309291005.80DD5F55E9@keescook> References: <20230929031716.it.155-kees@kernel.org> <20230929032435.2391507-4-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 29 Sep 2023 10:06:32 -0700 (PDT) On Fri, Sep 29, 2023 at 01:12:13PM +0100, Pedro Falcato wrote: > On Fri, Sep 29, 2023 at 4:24 AM Kees Cook wrote: > > > > While load_elf_library() is a libc5-ism, we can still replace most of > > its contents with elf_load() as well, further simplifying the code. > > While I understand you want to break as little as possible (as the ELF > loader maintainer), I'm wondering if we could axe CONFIG_USELIB > altogether? Since CONFIG_BINFMT_AOUT also got axed. Does this have > users anywhere? I can't even find a libc5 image I can test. :P I made it non-default in '22: 7374fa33dc2d ("init/Kconfig: remove USELIB syscall by default") I'm not sure we can drop it entirely, though. -- Kees Cook