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 C452EC3DA5D for ; Mon, 22 Jul 2024 19:33:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A6636B0085; Mon, 22 Jul 2024 15:33:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 356356B0088; Mon, 22 Jul 2024 15:33:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2452F6B0089; Mon, 22 Jul 2024 15:33:41 -0400 (EDT) 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 007356B0085 for ; Mon, 22 Jul 2024 15:33:40 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 70E22A5F7D for ; Mon, 22 Jul 2024 19:33:40 +0000 (UTC) X-FDA: 82368388200.14.96EFCC8 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf28.hostedemail.com (Postfix) with ESMTP id 9CD9FC0006 for ; Mon, 22 Jul 2024 19:33:38 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=K0WwCs2F; spf=pass (imf28.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=1721676796; 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=iJVrpP7xI5TjeNlTtrzs9oyrSA2ufOMqSutgFuOLvmE=; b=LVNEA6d8lPgYchBnNtg+Ui6pXm4aY+0kKv2PqPRmfyaSf9tRgNzFI1mp/JvpsrYbte1ShT XISefkrAYW5dh2qXvoPRpSgKq04RdFFROG5kEx/ORghZFMJq8+Vd8VsDWm6IiMP/MY/VOZ VbIq7Q2Fe6QCOP6IPtTkMKvCq+JYB1s= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=K0WwCs2F; spf=pass (imf28.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=1721676796; a=rsa-sha256; cv=none; b=Q6RZEpmOr804DbvcHx7IUf5QpRn/F7OWKxC2bq1WoBuue5fOL8vcG9yp5ssmjzKPxQ0ao8 Rb7yugPkHYmEhEngArOqlvIDgyXm57VJa+EiGJ2KuZPphnV9qVRUPWCIiC7muQ9CYoUWH2 i+baKjCHclc90LJw7eq7QgtgefRM8n0= Received: from [10.137.186.190] (unknown [131.107.159.62]) by linux.microsoft.com (Postfix) with ESMTPSA id 3A29F20B7165; Mon, 22 Jul 2024 12:33:37 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3A29F20B7165 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1721676817; bh=iJVrpP7xI5TjeNlTtrzs9oyrSA2ufOMqSutgFuOLvmE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=K0WwCs2Fg3A5Ob7+LH/0y+sxt6WB/DG7QQa3d7L3SicJ/FjQvKaNsQN19Zku5M9I5 kKtPDRQHH3pJE46MjiIHVqpS5Zy0e4ChFsUhXB47xpU/jWoTgWvQM5K0tsz6FVllTC iScxaBmjFiB3VYolDNXaDnI0Pp0uPgbh8HI583SQ= Message-ID: Date: Mon, 22 Jul 2024 12:33:38 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/2] 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, benhill@microsoft.com, ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev References: <20240718182743.1959160-1-romank@linux.microsoft.com> <202407191026.DC2644DD88@keescook> Content-Language: en-US From: Roman Kisel In-Reply-To: <202407191026.DC2644DD88@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: 9CD9FC0006 X-Stat-Signature: opdfg1qyrcyd7dtrb4yskkhp3hsbyqsa X-HE-Tag: 1721676818-967680 X-HE-Meta: U2FsdGVkX198J/lsXKuIZYYQS4354NbbMCcmcPxZflEmYFQtecuvneemtjxTU2iNsqcBi4upJs4/FO8Vf2sTHTWxxF1L14KYA5/CdKLtdMAwDjhGMX7fL8TdkklUAwrQue5AvXSweaqaynCQDBY4tFupVrzHqltg8TOd9s9A2XYMnP5s6xek5pxrmWCNnnkiXbawuHYKKhWTFVflM57jnoVNgKLcLmdf3Jx/uAXZqR6OUW35CsssE14bZlfZa7H+5hqIBZ+7CSO5AtfiLlV85SskVUSIDg6DGnUbO9dGKuzG1owUpYUyNMdj4Pz1qTjWbgiTrMxA3qZAG+I4wZmfjCFs/0gOor832hkRuZ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ity=0.000001, 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 7/19/2024 10:26 AM, Kees Cook wrote: > On Thu, Jul 18, 2024 at 11:27:23AM -0700, Roman Kisel wrote: >> A powerful way to diagnose crashes is to analyze the core dump produced upon >> the failure. Missing or malformed core dump files hinder these investigations. >> I'd like to propose changes that add logging as to why the kernel would not >> finish writing out the core dump file. >> >> To help in diagnosing the user mode helper not writing out the entire coredump >> contents, the changes also log short statistics on the dump collection. I'd >> advocate for keeping this at the info level on these grounds. >> >> For validation, I built the kernel and a simple user space to exercize the new >> code. >> >> [V3] >> - Standartized the existing logging to report TGID and comm consistently >> - Fixed compiler warnings for the 32-bit systems (used %zd in the format strings) >> >> [V2] >> https://lore.kernel.org/all/20240712215223.605363-1-romank@linux.microsoft.com/ >> - Used _ratelimited to avoid spamming the system log >> - Added comm and PID to the log messages >> - Added logging to the failure paths in dump_interrupted, dump_skip, and dump_emit >> - Fixed compiler warnings produced when CONFIG_COREDUMP is disabled >> >> [V1] >> https://lore.kernel.org/all/20240617234133.1167523-1-romank@linux.microsoft.com/ >> >> Roman Kisel (2): >> coredump: Standartize and fix logging >> binfmt_elf, coredump: Log the reason of the failed core dumps >> >> fs/binfmt_elf.c | 48 +++++++++---- >> fs/coredump.c | 150 +++++++++++++++++++++++++++------------ >> include/linux/coredump.h | 30 +++++++- >> kernel/signal.c | 21 +++++- >> 4 files changed, 188 insertions(+), 61 deletions(-) > > This looks good to me! I'll put this in -next once the merge window > closes. Thanks! > Kees, thank you for your guidance! > -Kees > -- Thank you, Roman