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 2EC88C021AA for ; Wed, 19 Feb 2025 16:20:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B02FE6B00BF; Wed, 19 Feb 2025 11:20:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A8C1B440156; Wed, 19 Feb 2025 11:20:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DE776B00C3; Wed, 19 Feb 2025 11:20:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6CE796B00BF for ; Wed, 19 Feb 2025 11:20:29 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B0CF71415D8 for ; Wed, 19 Feb 2025 16:20:28 +0000 (UTC) X-FDA: 83137206936.30.555257F Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf06.hostedemail.com (Postfix) with ESMTP id 3A24718001C for ; Wed, 19 Feb 2025 16:20:25 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=bvwGXcjG; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=WfVoEapw; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=bvwGXcjG; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=WfVoEapw; spf=pass (imf06.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739982026; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=P6V+BUY/JEvJ94fWLWOg0Xs7qQ+LQG+BjLQoaO/Fp5k=; b=Yo2dcxqz6CIuZgyPzKrSJa3iP60cc/ifkRc2hXz5jVSxzCUAhwEmkxeAgdtNbeiHhrhr5X x053YZcURHX8TDwpmuH6+w7pRrGfuzxLtHogBBBz5+BNDWnRVqOaSWHrKVJOTcYNhvtw48 oh5Ftcb7MP7sOZZoaGokIHNz5b/Q1DQ= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=bvwGXcjG; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=WfVoEapw; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=bvwGXcjG; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=WfVoEapw; spf=pass (imf06.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739982026; a=rsa-sha256; cv=none; b=SZRA6YI4zFieWsST9RkeRv1XIic/bdCwI48fYFE7v+V8DWeYi/gdjHtX1iSkJPcysW+YoW C8ALcFr8okTANo9wSu9YTvrnUAs80CVcLM3BGDT0nqjC995REya8eCHpRZ5xyX24SwrD6u DDOKMXKt3V7I6e5ckCCFxQPOlWp0olM= Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 665EB211B3; Wed, 19 Feb 2025 16:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1739982021; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P6V+BUY/JEvJ94fWLWOg0Xs7qQ+LQG+BjLQoaO/Fp5k=; b=bvwGXcjG14SPhpCsD0rBKONmr0b0jzzxODLq1NRDgyb4eBH5/kVaYWu8AQBkFn2AgbhQko prCq+iYhlDcOlwuGPBnojDVGsh2h3MIkjh3q0iloPbeWsO2VTDP009XJFfkkjkjV1iX0P6 nq2UN9RCKur1NjqjAkKNeetebFA5cRo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1739982021; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P6V+BUY/JEvJ94fWLWOg0Xs7qQ+LQG+BjLQoaO/Fp5k=; b=WfVoEapwxOvLlq96tBnm0CHJU/7usq7IAU7z2TjYxEJ6vsgYYOrvPowHQIqf7QNFCnbF6A QVtfh6q/L5J25BAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1739982021; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P6V+BUY/JEvJ94fWLWOg0Xs7qQ+LQG+BjLQoaO/Fp5k=; b=bvwGXcjG14SPhpCsD0rBKONmr0b0jzzxODLq1NRDgyb4eBH5/kVaYWu8AQBkFn2AgbhQko prCq+iYhlDcOlwuGPBnojDVGsh2h3MIkjh3q0iloPbeWsO2VTDP009XJFfkkjkjV1iX0P6 nq2UN9RCKur1NjqjAkKNeetebFA5cRo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1739982021; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P6V+BUY/JEvJ94fWLWOg0Xs7qQ+LQG+BjLQoaO/Fp5k=; b=WfVoEapwxOvLlq96tBnm0CHJU/7usq7IAU7z2TjYxEJ6vsgYYOrvPowHQIqf7QNFCnbF6A QVtfh6q/L5J25BAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 58048137DB; Wed, 19 Feb 2025 16:20:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id nkkmFcUEtmecRQAAD6G6ig (envelope-from ); Wed, 19 Feb 2025 16:20:21 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 0AE27A08A7; Wed, 19 Feb 2025 17:20:17 +0100 (CET) Date: Wed, 19 Feb 2025 17:20:17 +0100 From: Jan Kara To: Brian Mak Cc: Michael Stapelberg , Christian Brauner , "Eric W. Biederman" , Jan Kara , Kees Cook , "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: References: <036CD6AE-C560-4FC7-9B02-ADD08E380DC9@juniper.net> <20250218085407.61126-1-michael@stapelberg.de> <39FC2866-DFF3-43C9-9D40-E8FF30A218BD@juniper.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <39FC2866-DFF3-43C9-9D40-E8FF30A218BD@juniper.net> X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 3A24718001C X-Stat-Signature: z5xuhq91u4gtrowndkcejn94r7w1a4je X-HE-Tag: 1739982025-671403 X-HE-Meta: U2FsdGVkX1/Yxpq5aALgYTx3CMM9qXVX9erH5o0eHIUHf/NAJFMvObSgReI0N0nk0P5ysX0XGnmEhmB3Jnith9sr95sAkvM+NOM4aZ/6VZsI+EpBMz5kYKW6SLie73H1TezEWLgLt5fArEhhp0E3hRn5NrlmwX0Zs9jvJpxSdfosYWDFm5aiJ7jp76IQTdGbG+/zwhl5/P6VFr/ghdU5cYa1ds2N1MFwoeWMmiF4/aHCFOZ/7fofxWUTaVWbG4JGnm9cASX8n5VC19JCzq/MCK8jr15DKb79plXuPeyj3dOJCeJ9s20GBZZgiLlsKm9oeIi7Ls4nN3jYEw3oJF+MF1pc+a6/dsXMgEFMu3l2wsrYZFKHtNw1RVZ5udKlif4Km6qLnZkAQ1DcNV9jedLQFreg4vcZDcXL5cj9gaoJ4qSopo/WU9TdzThxOuvdgxQ5EwPNOnyNTrlwmCw5WuH53YoVVUyGf0ViHS9TTINBhWjPmrSytsWtJYWti28NmOR7YXtL/mh9crM8nblJsRIl84oqOah9CFWMiS/KEUrXzZFpJSGKTDIi0Oj9kyZ0M3m9dTkc0BD5FmFJ61Gm0Ac92hkXMwzbrMNtRTkRpTcGVKvFeA53UHVDFtDhbBZxX2/rDTJyrbnceMOK5LPJ6LQyBWQotAehomXtziWLT9DJCgMMNCgMqAiXJwBmvlFJkHTxiElsxDg2z7/tF7LfEnA2kHveyW9BtI7J8QgypjOI8wFVZ02C8pjEXJIdxKs2SQ49ayO4CLClndM8HokwSKw6TlpKs5n/78WPA07GuY0SvaGay33kr6zSnkvRlVJvoLVmaT1mCXZLPnm+lEamCC+yJm622uOSi6ZsJSBipBixY5OClB6htwkWNECheflpGgy5Mwp+xhEdqTKaKK/3uFlUJfWSz414cbzF8fMyiOk2lOKzUhZBVDz3wyIL6YMHtlTgEfKH1piSqugMxZiyFI6 dGYODQlM batUFfikDqOONfdraqgPautNA/L40Rav53oXVb/0Fb4H4kVbkXRNHI1f/0rwzEr8H7CKqgbJ5rlHc3HFdlIOK1aAuUDbR+uU5o3BnbnD1w7DP1BYpOAP2mjQa/4lqoIvndW4F4iChd4K/+wNrvQw9WVE/HIVfzh7ysrNeyL51N2JY+A72VA9iROYj3IvdEUXlt/5cV39HRAjzGvE+pmhFIBG6E4r1VotLOdMjvkSRyAmHO5Ast+MFYQPhvtg4dSr2BAooPYrCAxwq/CKP1tojf823xO9TC+7KRfqpBoUSYURRrL06FcQlnLyJAfq7p+njYC8y29gEmfKqVuUESrr2SEpjKowr74nzZj9BOzCqnTLjEEy+ajgGpoRMZxvoA+Vv7BsNrIvUXZWJRdjtMNaf1HG13YcQcffXXessqKExtb0SKmdDz5MS4KevoO8AJ/0LKnmJPNsX9sSHFVKXNfJr9hmM0J7lRVd4ParlCkQGvVWQWLxILYoXs+zxqzTCYcn0nIS5uslaPh67AFk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000030, 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 Tue 18-02-25 19:53:51, Brian Mak wrote: > On Feb 18, 2025, at 12:54 AM, Michael Stapelberg wrote: > > > I think in your testing, you probably did not try the eu-stack tool > > from the elfutils package, because I think I found a bug: > > Hi Michael, > > Thanks for the report. I can confirm that this issue does seem to be > from this commit. I tested it with Juniper's Linux kernel with and > without the changes. > > You're correct that the original testing done did not include the > eu-stack tool. > > > Current elfutils cannot symbolize core dumps created by Linux 6.12+. > > I noticed this because systemd-coredump(8) uses elfutils, and when > > a program crashed on my machine, syslog did not show function names. > > > > I reported this issue with elfutils at: > > https://urldefense.com/v3/__https://sourceware.org/bugzilla/show_bug.cgi?id=32713__;!!NEt6yMaO-gk!DbttKuHxkBdrV4Cj9axM3ED6mlBHXeQGY3NVzvfDlthl-K39e9QIrZcwT8iCXLRu0OivWRGgficcD-aCuus$ > > …but figured it would be good to give a heads-up here, too. > > > > Is this breakage sufficient reason to revert the commit? > > Or are we saying userspace just needs to be updated to cope? > > The way I see it is that, as long as we're in compliance with the > applicable ELF specifications, then the issue lies with userspace apps > to ensure that they are not making additional erroneous assumptions. > > However, Eric mentioned a while ago in v1 of this patch that he believes > that the ELF specification requires program headers be written in memory > order. Digging through the ELF specifications, I found that any loadable > segment entries in the program header table must be sorted on the > virtual address of the first byte of which the segment resides in > memory. > > This indicates that we have deviated from the ELF specification with > this commit. One thing we can do to remedy this is to have program > headers sorted according to the specification, but then continue dumping > in VMA size ordering. This would make the dumping logic significantly > more complex though. > > Seeing how most popular userspace apps, with the exception of eu-stack, > seem to work, we could also just leave it, and tell userspace apps to > fix it on their end. Well, it does not seem eu-stack is that unpopular and we really try hard to avoid user visible regressions. So I think we should revert the change. Also the fact that the patch breaks ELF spec is an indication there may be other tools that would get confused by this and another reason for a revert... Honza -- Jan Kara SUSE Labs, CR