From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D713618EFCC for ; Thu, 2 Jan 2025 14:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735828842; cv=none; b=aYAtvkeL2Hd+Pip4qDRJbA2pTav1BAm7NhtnK4WLIq9ydz6IUbmOFafkWiOwabhzBNLs7AUCj8oDd2gEyE7DF4JxTWWQQYF+MMKVcFVFiN6hvhK6hYDAc09eoGTURpASUBVfOLbBA4UPMfGGTweL7uaTc1Kj7xRtSsMm4GGhB9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735828842; c=relaxed/simple; bh=LA6Y1zYSOdmImjH3VijlhopS2JyOus20MZb0uerH7LA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dAaS8Os4ATwnFQG35PCmNzB1xno+XTNY+VrontLjBx/THwToZGGoe/gtN+xnFLQB6nuV31cKtqZaYSpBgpurty/biWLS299+9e/FKIDzmH2ZrrVnMMBi1qWDves7K2oy/IUGSOAX1UCID+tEL86iGZgJmhYSn0BsVr0/FuHGM8I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 22C9911FB; Thu, 2 Jan 2025 06:41:08 -0800 (PST) Received: from e133380.arm.com (e133380.arm.com [10.1.197.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DC2283F59E; Thu, 2 Jan 2025 06:40:38 -0800 (PST) Date: Thu, 2 Jan 2025 14:40:33 +0000 From: Dave Martin To: Akihiko Odaki Cc: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@daynix.com Subject: Re: [PATCH] elf: Correct note name comment Message-ID: References: <20241225-elf-v1-1-79e940350d50@daynix.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241225-elf-v1-1-79e940350d50@daynix.com> Hi, On Wed, Dec 25, 2024 at 03:46:44PM +0900, Akihiko Odaki wrote: > NT_PRSTATUS note is also named "CORE". Correct the comment accordingly. > > Fixes: 00e19ceec80b ("ELF: Add ELF program property parsing support") > Signed-off-by: Akihiko Odaki > --- > include/uapi/linux/elf.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h > index b54b313bcf07..4f00cdca38b2 100644 > --- a/include/uapi/linux/elf.h > +++ b/include/uapi/linux/elf.h > @@ -372,8 +372,8 @@ typedef struct elf64_shdr { > * Notes used in ET_CORE. Architectures export some of the arch register sets > * using the corresponding note types via the PTRACE_GETREGSET and > * PTRACE_SETREGSET requests. > - * The note name for these types is "LINUX", except NT_PRFPREG that is named > - * "CORE". > + * The note name for these types is "LINUX", except NT_PRSTATUS and NT_PRFPREG > + * that are named "CORE". > */ > #define NT_PRSTATUS 1 > #define NT_PRFPREG 2 [...] This still seems rather confusing. It's not clear which note types are being referred to in "for these types". I think this statement was supposed to refer only to the architectural regset notes. I guess "CORE" was for generic coredump notes goverened by common specs, and LINUX was for Linux-specific stuff, but I suspect that this distinction may have bitrotted. It looks like the ELF specs never defined the core dump format, so the concept of non-OS-specific coredump notes may not make much sense. The ELF specs _do_ explicitly say [1] that the note name must be taken into account when identifying the type of a note, so the note name for each kind if note should really be documented explicitly. Is it worth adding explicit #defines for the note name of each kind of note, to make the ABI contract explicit? Cheers ---Dave [1] e.g.: System V ABI - DRAFT 24 April 2001 https://refspecs.linuxfoundation.org/elf/gabi4+/contents.html (Linked from ELF and ABI Standards, https://refspecs.linuxfoundation.org/elf/index.html )