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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89AA9C021B2 for ; Sat, 22 Feb 2025 14:51:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE9196B0085; Sat, 22 Feb 2025 09:51:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E99986B0088; Sat, 22 Feb 2025 09:51:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D60DC6B0089; Sat, 22 Feb 2025 09:51:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B7A926B0085 for ; Sat, 22 Feb 2025 09:51:09 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5BA4A141711 for ; Sat, 22 Feb 2025 14:51:09 +0000 (UTC) X-FDA: 83147868258.09.EB32ED7 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf14.hostedemail.com (Postfix) with ESMTP id BF84C10000B for ; Sat, 22 Feb 2025 14:51:07 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=D+Y6vDpu; spf=pass (imf14.hostedemail.com: domain of kees@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=kees@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740235867; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bS2LVkZtad6wgV1dES5Uwcbo0h+b3o/Ng7N8MxUDkDE=; b=jrWX8aHQhHA0x9BGangl9NMvP0Mb/b+X1V8vxHjEuQV0+Ypy+oinE0H/hjO+Q0tcxm/0Zb 6alyr0+QN6zv4HoVGFMi7P9ZS7yR1nrDigbiy8dN9N5utdcSNFdJ8+yX0Qat7FapdXyfVw MwuwlCySokKe6tQIcAb6/6DPCxT0PvY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=D+Y6vDpu; spf=pass (imf14.hostedemail.com: domain of kees@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=kees@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740235867; a=rsa-sha256; cv=none; b=Cu5Ni0IAnWK6qX5vCm2NVBdlH463GziTZzvLJr0m0Age5dghnFSMmRQoCkmN9kXl1MVNVa yA+1y86RURn3EUJI8hGT4Unl1KAxZtgfe9X2NWWTr4dV0ODvt1c/euUlNQhvGykLw9W6Da Y8u/PgyktoQvUjnfmeUJcwrE7WMJXGI= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 6151C61127; Sat, 22 Feb 2025 14:51:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94563C4CED1; Sat, 22 Feb 2025 14:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740235866; bh=gBxM8tvdfd2PMBLv7RTxItVJfVROKTcaFuwa68QoYUY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D+Y6vDpupTWoBky9TbcnGqpd1BFqsqxaFaPUT4ZLMBR326vrKF5hqeKx6p3nncKjS 4DGOd1oU9IUXPq1eibU+/G3Y8YhvN27bHwhV7/scSLbBTPhHHx8peSlLD/yra3NL6f Z2/b44zGOLA/bVi4MtAPheZxsxgF6yNAK9ntam/VE2nwsJ9XbHub3dpQKiRMW/qXI7 SCa3Vpn+kSq/M9QKaXC6ekT3CZgV15k3vCUxO50LIsN//bJvqrJLwEB1Qc5VzJfkYj d92PVci5XVX05UqaGPeeVC13LglHPJKARKRhhsDwI+ag4eXEm9h02fNmYEKRmEFT7K qZsw6q/60AyTw== Date: Sat, 22 Feb 2025 06:51:02 -0800 From: Kees Cook To: Brian Mak Cc: Jan Kara , Michael Stapelberg , Christian Brauner , "Eric W. Biederman" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Oleg Nesterov , Linus Torvalds , Alexander Viro Subject: Re: [PATCH v3] binfmt_elf: Dump smaller VMAs first in ELF cores Message-ID: <202502220647.861603A725@keescook> References: <036CD6AE-C560-4FC7-9B02-ADD08E380DC9@juniper.net> <20250218085407.61126-1-michael@stapelberg.de> <39FC2866-DFF3-43C9-9D40-E8FF30A218BD@juniper.net> <202502191134.CC80931AC9@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Queue-Id: BF84C10000B X-Stat-Signature: s78di45u4xfuz7zrjtnbqacysatftzd1 X-Rspamd-Server: rspam03 X-HE-Tag: 1740235867-177033 X-HE-Meta: U2FsdGVkX1/Ywe4aeuWNuYoPPlITL5f0NLLWLRaHuaSQE0lxLiL6UH/Ul3U9oDFAgZRRNbAjE81vEMZ60iYw8nAN73RlkSzPqwS5izGG1tlaomHBrFmSfoiHTcQ/cx9y2bH0V1nplyMcesmEXtw+u0Cfb7TflERwRaY1ePyTmg3Ls6nUmRnwb9NvLQ6CKCmST+aTXOyB1EZKF+ma+dfUPauSS56Z9xUSL0K0QR+ujfIXwsXh6k3sSNHxnEiUCWqF2vbeNNOccvGnU6Klwhk4c7ZVtMf91GsWAA/p5fB+yKyPDJURXCEou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S5CILxM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Sat, Feb 22, 2025 at 02:13:06AM +0000, Brian Mak wrote: > On Feb 19, 2025, at 12:38 PM, Brian Mak wrote > > > I will also scratch up a patch to bring us back into compliance with the > > ELF specifications, and see if that fixes the userspace breakage with > > elfutils, while not breaking gdb or rr. > > I did scratch up something for this to fix up the program header > ordering, but it seems eu-stack is still broken, even with the fix. GDB > continues to work fine with the fix. Okay, thanks for testing this! > Given that there's no known utilities that get fixed as a result of the > program header sorting, I'm not sure if it's worth taking the patch. > Maybe we can just proceed with the sysctl + sorting if the core dump > size limit is hit, and leave it at that. Thoughts? Yeah, I like that this will automatically kick on under the condition where the coredump will already be unreadable by some tools. And having the sysctl means it can be enabled for testing, etc. -Kees -- Kees Cook