Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3537649rdh; Thu, 28 Sep 2023 15:02:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXm4RKFZF1uUlkzZdilAmf4olsXubgHqe2QXPIaRIKXmHgVJIq65skZISfUjmLDSMV2hH/ X-Received: by 2002:a05:6a00:2d20:b0:690:d42e:c310 with SMTP id fa32-20020a056a002d2000b00690d42ec310mr2454055pfb.16.1695938534477; Thu, 28 Sep 2023 15:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695938534; cv=none; d=google.com; s=arc-20160816; b=Qbz9P60qVnO2gEMvC7uEH5USFIi1bnG7YJrcG5aG8LjlopqjmoDbfPtVmVVF0zBWDz ZR4BLkVYzjzLVfGaZU6bj3urO3mu4HwpvgGwioPqBVu3v8ccKbocCiiER02uXb+p/zmh 8/naATDy9YNc06lHzhqSIID4nSb8jCHdgw04J6mdL/sGybblcTfkbf7v/pWVQWquFtPA G9xWIZQIKnK4YRDY0k6TV3UjXvAySYV4+zl/puAVVPgB+nx7SNBK2mRwToUiwvuBmZ+7 WdSV7sXMj6pc3diPRWUrhwQHbajykVjozkjalZzHbq3M+uNmv2SZnyH/0+/705D2+1e1 rQOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=qI4XghGXIMa5N9aYtul1yzQ/Grglthn81P30tLktnuU=; fh=LfAXanCmZBdW5uOKF/z2v9pAxwHDhBuZXBmoM6E45wQ=; b=QCS/MkB+gVU6ixTDjDHVohpOhHv8olHq9bIYDnrm332VwotQ8H9UHPhUS+5fPgf/pD ZWza8vWB8xMnIdIKvY0iesFZh421aktXP8hfip1fo5L4EzzgrKbkET2PgHKSh+w/x5VK QXYczQm03d0XrUWCtjksHnsE0cH6OUMa4YgzvhfwvwS1GWfsMHMtXHU1xiVk4eKkLYbJ tfjOBbA6xgYDSebMYAwiHcWELyodMtjpU9B5s1J42oNNpE26pIt4t5er046t2w3kDuXq 33gpyxS5YRp9hBioBBkWaGJ79H1VDXlNNEWdYqNYmI6PjNF5gG7d9eCYkWFTJXv63IKD md1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VkW+23p3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id p33-20020a056a0026e100b00690d79bafd9si17906914pfw.168.2023.09.28.15.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 15:02:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VkW+23p3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D5C7C802090C; Thu, 28 Sep 2023 05:56:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbjI1M4Q (ORCPT + 99 others); Thu, 28 Sep 2023 08:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232559AbjI1M4O (ORCPT ); Thu, 28 Sep 2023 08:56:14 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 936C7198 for ; Thu, 28 Sep 2023 05:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695905728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qI4XghGXIMa5N9aYtul1yzQ/Grglthn81P30tLktnuU=; b=VkW+23p3t+DLbC9yQBrpTX5iCnXkDrZ1VFT3pMNFsoz3G0r60qZwPjLjjemyTgVtCmST3T ElTW05x2aryT4BMswNOvKOybCyUtRxRJrNIuenZjSsqT32+8PnwCmHHzPE+mAFm2pV+4O1 obb3VHYHE2cs/4arEbsWkPvlNbZl4sE= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-kg_FSwKMOfyz643adDXB9A-1; Thu, 28 Sep 2023 08:55:27 -0400 X-MC-Unique: kg_FSwKMOfyz643adDXB9A-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-774382db0a5so1316515485a.2 for ; Thu, 28 Sep 2023 05:55:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695905726; x=1696510526; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qI4XghGXIMa5N9aYtul1yzQ/Grglthn81P30tLktnuU=; b=aq2t2BDaOlDA0nQnVx43WF+xiDnk2w/rg5z3Qs8YtUv3pHnGUtG8UJA156gzYWxSMS aU8iejC3++m+Ej0CeryMZNss80V0ngVxBNY06ZamzqKIfb7dzvGzy4/A5VjbeVodfuCW LERbb0WiDdqDu26REeLAKjBrKu/GWN5Df/DLJAY3brqtkD55kq1aCL7KuBp3IVgNh+Xo 5CYPKUPGtrhL40HuViYGNu6kx8L6xmVvcYef4F+nZpkjFALio0nzQWNOPWeNBXRVy/is oJpiHgxnWDymAuwzFxRFbnfy8/CGd30QnFV7sufLWdwzx4sPRI9urXuqsLBa38RfAgI0 3ilQ== X-Gm-Message-State: AOJu0YyYVX/aoTkNmIYo1lEcV70LkkrqcQnl2dBUnvDxsjl55EO1u4zF 8JDWTKn28Nltd6Q6jgb7iFnh4QdqE4xlFx+XFtiDbWlHyFMkkV9y7hc28qPlhvtcBLqILLttiMj rKbGje2464PjWS6cjmoW++R9Lw4X4k52sjWc= X-Received: by 2002:a05:620a:430e:b0:76c:c601:367f with SMTP id u14-20020a05620a430e00b0076cc601367fmr923537qko.36.1695905726452; Thu, 28 Sep 2023 05:55:26 -0700 (PDT) X-Received: by 2002:a05:620a:430e:b0:76c:c601:367f with SMTP id u14-20020a05620a430e00b0076cc601367fmr923525qko.36.1695905726184; Thu, 28 Sep 2023 05:55:26 -0700 (PDT) Received: from rh (p200300c93f19a200f43f623a676b2d27.dip0.t-ipconnect.de. [2003:c9:3f19:a200:f43f:623a:676b:2d27]) by smtp.gmail.com with ESMTPSA id c1-20020ac84e01000000b00403ad6ec2e8sm3676249qtw.26.2023.09.28.05.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:55:25 -0700 (PDT) Date: Thu, 28 Sep 2023 14:55:22 +0200 (CEST) From: Sebastian Ott To: Kees Cook cc: Eric Biederman , =?ISO-8859-15?Q?Thomas_Wei=DFschuh?= , Al Viro , Christian Brauner , Pedro Falcato , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v3 0/4] binfmt_elf: Support segments with 0 filesz and misaligned starts In-Reply-To: <20230927033634.make.602-kees@kernel.org> Message-ID: <6208fd50-43cd-85fc-e9a6-f10281a15902@redhat.com> References: <20230927033634.make.602-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed 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_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 05:56:33 -0700 (PDT) On Tue, 26 Sep 2023, Kees Cook wrote: > This is the continuation of the work Eric started for handling > "p_memsz > p_filesz" in arbitrary segments (rather than just the last, > BSS, segment). I've added the suggested changes: > > - drop unused "elf_bss" variable > - report padzero() errors when PROT_WRITE is present > - refactor load_elf_interp() to use elf_load() > > This passes my quick smoke tests, but I'm still trying to construct some > more complete tests... I've repeated all my tests with this one - no issues found. Thanks, Sebastian