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 E0350C27C4F for ; Tue, 18 Jun 2024 15:49:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 590DD6B037C; Tue, 18 Jun 2024 11:49:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 518C86B037D; Tue, 18 Jun 2024 11:49:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E0C26B037E; Tue, 18 Jun 2024 11:49:32 -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 1B0BD6B037C for ; Tue, 18 Jun 2024 11:49:32 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BB2E98034D for ; Tue, 18 Jun 2024 15:49:31 +0000 (UTC) X-FDA: 82244444142.07.D6A01DA Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf18.hostedemail.com (Postfix) with ESMTP id CE4151C0013 for ; Tue, 18 Jun 2024 15:49:29 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b="swQgC/68"; spf=pass (imf18.hostedemail.com: domain of romank@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=romank@linux.microsoft.com; dmarc=pass (policy=none) header.from=linux.microsoft.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718725766; 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=tX2N35H3fv6NeRdhpyR+cJNtoGziZpdk/cgSbaToEsk=; b=lNIdXL416ti/3RqHHwezCMNWsbZaz7t92NAW/u4bW0nWREhh12Vn/ruzf/X2LggWLfPAPI f1lUgrQHh96ktT6x/ydWb+ssv6lzP+CfpAqnzTlJzW5pdICGPSbOsNMO3hblReDN+u8HCl U7JdD6CF888VmO4iJSar1Vfi4jDy+nc= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b="swQgC/68"; spf=pass (imf18.hostedemail.com: domain of romank@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=romank@linux.microsoft.com; dmarc=pass (policy=none) header.from=linux.microsoft.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718725766; a=rsa-sha256; cv=none; b=Ug/++8eGayxA/71VW851FMJwOBjGIdgcODLHlNWvLp7EulE6C0KerYGER1q3UPmuVkUzZJ +RxVHXHO1X9LYUPuTowax6VSSdU+SeflfAANsi7hlqE8L37MaCn8lZY6QU0tkzLXBFt0/I lGhA1cQI8rKYxEaxl1lywbFa5JK9Cto= Received: from [10.137.186.190] (unknown [131.107.159.62]) by linux.microsoft.com (Postfix) with ESMTPSA id 3D1DB20B7004; Tue, 18 Jun 2024 08:49:28 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3D1DB20B7004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1718725768; bh=tX2N35H3fv6NeRdhpyR+cJNtoGziZpdk/cgSbaToEsk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=swQgC/68sz1D7Dfg/1aePI2cIVOlg3Ha1InwP6XMzD0fxH3G96AcP787s9wS/JSU5 ueAd6M/bSSYuH48oEzrGCHAMvdZuc5pbsTygCqLcFFTjw31t1ebaaPdVacODf4zY1j ZzfM/Q3UPibpBXGhndLcgTpjWgvFyVkWWAxKzhkM= Message-ID: <63cf9746-204e-4b04-8bd4-a43a2e7a6cc3@linux.microsoft.com> Date: Tue, 18 Jun 2024 08:49:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] binfmt_elf, coredump: Log the reason of the failed core dumps To: Kees Cook Cc: akpm@linux-foundation.org, apais@linux.microsoft.com, ardb@kernel.org, bigeasy@linutronix.de, brauner@kernel.org, ebiederm@xmission.com, jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, nagvijay@microsoft.com, oleg@redhat.com, tandersen@netflix.com, vincent.whitchurch@axis.com, viro@zeniv.linux.org.uk, apais@microsoft.com, ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev References: <20240617234133.1167523-1-romank@linux.microsoft.com> <20240617234133.1167523-2-romank@linux.microsoft.com> <202406171649.8F31EAFE@keescook> Content-Language: en-US From: Roman Kisel In-Reply-To: <202406171649.8F31EAFE@keescook> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: CE4151C0013 X-Stat-Signature: t4gfdtsug7o6r8ku4dz8gm5sy6rw3r85 X-HE-Tag: 1718725769-148862 X-HE-Meta: U2FsdGVkX1+CThZwST2VKOUqKv8Zv7+jGPd7/S/6/oBzVmtvwyH324S3H1RTDmyq1WSdt83D1ii1KTGMUZl8LoAip9agPKSvAf887gOP/Ia0+gwwBZoQgYKf3tTzcSQpmzR54iN8YU/MXIuNG0/fSgi930K7171OkUhO7/KJKWcbAPFISXqGeRbRY/eY1iFAvhVQbFjLKi935UWHJxmQyD0F9RJVzoAKpX7wzSEwNjR6j8nSOUA1s0a6YnPdKrIH5YbTVylrvio1AXFT73npJCmPcQfAN2QtWy5MXYGORdM7o/esKyH1qS7PuZAM3LV38QcYF3fCJThE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0mf0vTYc0nUQfGpyJtyD0q5ZnZmkCssiFmqs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.027128, 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 6/17/2024 4:52 PM, Kees Cook wrote: > On Mon, Jun 17, 2024 at 04:41:30PM -0700, Roman Kisel wrote: >> Missing, failed, or corrupted core dumps might impede crash >> investigations. To improve reliability of that process and consequently >> the programs themselves, one needs to trace the path from producing >> a core dumpfile to analyzing it. That path starts from the core dump file >> written to the disk by the kernel or to the standard input of a user >> mode helper program to which the kernel streams the coredump contents. >> There are cases where the kernel will interrupt writing the core out or >> produce a truncated/not-well-formed core dump. > > Hm, I'm all for better diagnostics, but they need to be helpful and not > be a risk to the system. All the added "pr_*()" calls need to use the > _ratelimited variant to avoid a user inducing massive spam to the system > logs. And please standardize the reporting to include information about > the task that is dumping. Otherwise the logging isn't useful for anyone > reading it. Something that includes pid and task->comm at the very > least. :) Appreciate your suggestions very much! Rate-limiting has definitely slipped off my mind, my bad. Will also fix the reporting format to make it useful. > > For example, see report_mem_rw_reject() in > https://lore.kernel.org/lkml/20240613133937.2352724-2-adrian.ratiu@collabora.com/ Thanks, that's awesome! > > -Kees > -- Thank you, Roman