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 BC062C3DA7F for ; Sat, 10 Aug 2024 04:06:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 340F86B008A; Sat, 10 Aug 2024 00:06:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CBA76B0092; Sat, 10 Aug 2024 00:06:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 144506B0095; Sat, 10 Aug 2024 00:06:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E6F256B008A for ; Sat, 10 Aug 2024 00:06:25 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 568E841784 for ; Sat, 10 Aug 2024 04:06:25 +0000 (UTC) X-FDA: 82434998730.08.AD851D0 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id 82211C000F for ; Sat, 10 Aug 2024 04:06:22 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=E962WysW; spf=pass (imf28.hostedemail.com: domain of kees@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kees@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723262715; 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=zPFNgHLlU1ksuQvNMbOiQMxA2NcnyIn1aINJWBcFi/8=; b=RxUnwv6pvTvSiOUB15tMEmeZGdUbc5roZtRgPhFR5munWyn/mddMXt3OH7gQq7oHTRpGsr VT2NtDP8sO2yvSh7q+R5mexxG5zVkGa89JJzjmakoSplBbXxXD6plri3RfFAPDvH+IM3mS u1TfCuwH4IWZRIJUUrcyh4TbZ3n5PsM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723262715; a=rsa-sha256; cv=none; b=zJWuBiGUDQY5jYHm/ujE9e3kl+Z5xZEanw5HzuNB0UltL4pNt39rFSVbjrJcJHawvBrOPv WazXhIXBXRGUGjuzZtIPTzRK+VH/5Wxa30+xJnC6G7CYh0N5qHqWWXo7TwWIlljz7hYWgc o4A+dn9JPdH7LLm//GoKdVAluHLxAPM= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=E962WysW; spf=pass (imf28.hostedemail.com: domain of kees@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kees@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 887126112F; Sat, 10 Aug 2024 04:06:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 341D4C32781; Sat, 10 Aug 2024 04:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723262781; bh=SOtjsHWHRwe769zIY4hqS+ETtzzThW1sY7Ow+VYY1gs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E962WysW/7ySwspbABoO0RJDoRAliGwxCOx6lTfj91l7RBY0US2Q0b4bSZotvPBLK 49IfehDaJWhe1Fl64Ie71KIX22EZHac8RRFqsdoapjhZjieTYQtEI9RE3ez15YNl03 d8UnB8H5jHyymdLk7167hqDGWisnqBmvCjk2bGpmKyFX84w8maXDBE0+q6vWv5LFLZ l4cwc0fCuKJYpVB5kY4G5/ZK87zQG38tH0hGoe0MG+9rczitjxfIhVb/I2BW3zcgXS ms/l5Y8oSzbS4bfZjlocTDY6mGdtaywSYcuNlgVy+EeLcG/yI5H3QNTxxJZ8Y4mVlO JIhpaWHQN23MA== Date: Fri, 9 Aug 2024 21:06:20 -0700 From: Kees Cook To: Brian Mak Cc: "Eric W. Biederman" , Alexander Viro , Christian Brauner , Jan Kara , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Oleg Nesterov , Linus Torvalds Subject: Re: [PATCH v3] binfmt_elf: Dump smaller VMAs first in ELF cores Message-ID: <202408092104.FCE51021@keescook> References: <036CD6AE-C560-4FC7-9B02-ADD08E380DC9@juniper.net> <172300808013.2419749.16446009147309523545.b4-ty@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 82211C000F X-Stat-Signature: nf9wc6crkbroi5teafxpeiji3az7rz46 X-HE-Tag: 1723262782-330579 X-HE-Meta: U2FsdGVkX1/MIWUmQ4wP90RJCDYOOprgF6ZmX/9tK+2Mk1LGE+CFSxndIPf6Mqsl4KJTWImAfepROyWixPuuEAXiiIns/SuF1XipN9Rg5CDfJDt+uMjshIojrLHBh8+CAa1faDg85CH9zu8ODwWvSc2B6DEI7z8N+ky4tDhy8L1PRxzfg9BsnG4XQMBTBVQ959flL3SZoLM8/xFUv66YKujl+OBJ2fL34NlkBN5NLj8Ph9AbhQ1b5U6KSJzhCBkoM744wFCEvUiKdlpvZ5XbvmQijaJ1NP7m+q74HbrSodYob/I64aHR9kG1Wo5CIz3uZwdmxQ4szJPfuHtnpNqodSC7HU73eaYt6dunoEdRzTSPog16hDeQNGfsCbhV18P8ElNmB2g194zgwB8tiSpFbQLNnlemS0WBfbD6L318wm9xdBefvCbqFqh+yg+k+8J2FGzaILNYMxfNRSefNqywieNGsFgIMbmnfZJFtakzCdrUZBwbksihjGmkeWByK9nolsaTx1P/Sp49p5B7G0aJPySQs3TyGAV8gdiDdmXM5pFlMHuHaoq/owB72QMA/KMIiIiHAh0OwwdU1wIY6ZKXKjWI2+Y9rz/WFZVWfAfEYWrAn9gpSgLvjNM7GnPnT0pvz5cxmGvlPXuoUuGhFLZ4czF3gGNR/8hS4m6v/9l0yy20OaRns35zs5ifjba0UD0/nHzJ5JSbkYqrX+TtBZ5NeB99Bnr3L1J4h4851qRHZPvQPbNi1/9eBN+l2pbYomoH1lZ8M7bczNrOQJo8C6Czh9rUrDgmvTiRfhLk5QOG+KeCWbUimLqGOnzjDWla8NYA6QDQYVutPwkxbXBnYnb1V7dbjIpVryWq4wE88veEvof3LrQzmpcwbpLLivxPHYWBmCaC+QxqGwcr7LUzptSpGzdt32C3D442qzLpBwWi6QjslAlJ6jmI2sUhSZy3DPNNuUW0lIZJrTQlXM/MEVO nj1+iawe jqYB2EDu85AWPNq49Ta8r7GIJRd+AityLO+18tNWkuccR7JqRWmBvPkth/Eab0i0rnhcuxmWpMr0Xjqtxr92QjeEFilQFtdOD/bA3zKDYDy81yHK87ha10uC+Z6YZEMJZgvK1J3FlJRmcL7qHuyNc4hPKVg/4SH9jWcT1YbHp8VT8iQLbWM1TRtLZXN9m6si5qz0B7/7mXHwI+YHA6lfD213P4kpJHmTytEDIZgRQaRAu0gGr0qhERtSWEDiUbJKrpQAOQMyFfwwPL5nECQNCddUejEa+4nhL1yaLduqs1SSzlkLusWW3Vsy1JCf9aLXK3ukmf7wYP5KBoGHjihMGWlujL5c74pwDNrW8A1mhqk5+OFm0edcStsdMuw== 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, Aug 10, 2024 at 12:52:16AM +0000, Brian Mak wrote: > On Aug 6, 2024, at 10:21 PM, Kees Cook wrote: > > > > On Tue, 06 Aug 2024 18:16:02 +0000, Brian Mak wrote: > >> Large cores may be truncated in some scenarios, such as with daemons > >> with stop timeouts that are not large enough or lack of disk space. This > >> impacts debuggability with large core dumps since critical information > >> necessary to form a usable backtrace, such as stacks and shared library > >> information, are omitted. > >> > >> We attempted to figure out which VMAs are needed to create a useful > >> backtrace, and it turned out to be a non-trivial problem. Instead, we > >> try simply sorting the VMAs by size, which has the intended effect. > >> > >> [...] > > > > While waiting on rr test validation, and since we're at the start of the > > dev cycle, I figure let's get this into -next ASAP to see if anything > > else pops out. We can drop/revise if there are problems. (And as always, > > I will add any Acks/Reviews/etc that show up on the thread.) > > > > Applied to for-next/execve, thanks! > > > > [1/1] binfmt_elf: Dump smaller VMAs first in ELF cores > > https://urldefense.com/v3/__https://git.kernel.org/kees/c/9c531dfdc1bc__;!!NEt6yMaO-gk!FK3UfXVndoYpve8Y7q7vacIoHOrTj2nJgSJbugqUB5LfciKy0_Xvit9aXz_XCWlXHpdRQO2ArP0$ > > Thanks, Kees! And, thanks Linus + Eric for taking the time to comment on > this. > > Regarding the rr tests, it was not an easy task to get the environment > set up to do this, but I did it and was able to run the tests. The rr > tests require a lot of kernel config options and there's no list > documenting what's needed anywhere... Thanks for suffering through that! > All the tests pass except for the sioc and sioc-no-syscallbuf tests. > However, these test failures are due to an incompatibility with the > network adapter I'm using. It seems that it only likes older network > adapters. I've switched my virtualized network adapter twice now, and > each time, the test gets a bit further than the previous time. Will > continue trying different network adapters until something hopefully > works. In any case, since this error isn't directly related to my > changes and the rest of the tests pass, then I think we can be pretty > confident that this change is not breaking rr. Perfect! Okay, we'll keep our eyes open for any reports of breakage. :) -Kees -- Kees Cook