From patchwork Sat Jan 4 14:38:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13926268 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 3C4ABE77199 for ; Sat, 4 Jan 2025 14:38:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B37D56B008C; Sat, 4 Jan 2025 09:38:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AE86A6B0092; Sat, 4 Jan 2025 09:38:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AFF66B0093; Sat, 4 Jan 2025 09:38:52 -0500 (EST) 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 7C9CA6B008C for ; Sat, 4 Jan 2025 09:38:52 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 03D21C0B14 for ; Sat, 4 Jan 2025 14:38:51 +0000 (UTC) X-FDA: 82970026104.11.D766C5B Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by imf16.hostedemail.com (Postfix) with ESMTP id 21095180009 for ; Sat, 4 Jan 2025 14:38:49 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="RjlViv/c"; spf=pass (imf16.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736001530; 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=3DDRJB8oNZeq6N6MlMy+rUGIqaIntb5QA28c12Ptyck=; b=xwWkug5X7RwdOwSHntGf0PFMTJDtwtWVS8RXZGHYZ7Z/+I8zFE1lLTiaj64Z3eG2x3Z2Mu eVzyH11Kpo4pZvb3X7Kjt2HBjwg2WPH3Q2BYGLT34z13Mkv4WpoEmmXJCnv08bQiJLHIte AFEjiwmIn+tBLsDhYXXjcj384cubxPI= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="RjlViv/c"; spf=pass (imf16.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736001530; a=rsa-sha256; cv=none; b=4iiXItBn3ijGIJThMQ5VvQW+hNlbC3egiJ+MGEfvcXKmfujilOpc6AO49OWiwoxCxUckOC 2Z1CAMO+VUQTSIhRyx4jk6B4MZLeKTy9kwRgCsh/5NcBLZIaguoAUR+dLTZtOswr3JlBZM hyipOqg5CjGrVfdaIli2GdnuW6gt7sQ= Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2163bd70069so84583125ad.0 for ; Sat, 04 Jan 2025 06:38:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736001529; x=1736606329; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3DDRJB8oNZeq6N6MlMy+rUGIqaIntb5QA28c12Ptyck=; b=RjlViv/cVyUYTUDnUN17TYhevECGdZZddDugBOv0rg5kmrtfqWIxJ0+HeUxuTf1BPf v4SC81o+bTD/+6Ii03C6Y5hZhJCR9jNnk95pjX9FcFPW14CLutZQYzZz7nY2QoHvd4Au TpxKU0TNmLwrmUtrT/8/7cylXMc8KmuM1l9eJ+nKS+sJdBbSHY7EC0O9E4sK1XReHAxa DtSTRP3cTwZ4/u5rMOKScQBd0jWNx2RYCHr3Kt9UYJy2bZKuLxiwdD4YzH0KA6DJNW5d 6sEPdM6WCZmm/7pvxj5pDnr15nLd+s65q2EEWAGyWBoVNNso0RSCfMFqm8Us/Ox6Of0j BEKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736001529; x=1736606329; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3DDRJB8oNZeq6N6MlMy+rUGIqaIntb5QA28c12Ptyck=; b=B+uzEWoSefCh9Gs7fhPcC12dX0Bn++XIm51Fwo2HKzAnPJ4R1xaa2lqTw2rqj2W8dA ohV9mUOUWlx561qR1fUZrZY6L3clp01c/ztCmo/oQbgXtE0wMAh9HDUaAxFnGNj2MFs3 r6A+k3pT//kk7E3mvW/gIBHjJEUnnSkORimNQ9OzkYlpw7980AhFvU9QigyZP8LGA2S7 einJKNlyt+JIQn2squRw+42aDYmVpuAHfP+PTITLcxIhi/or3WIhTf2331C/lY5HZIOv h3nEQDD2IwcxrGJ+DWuAHpOCdZiBIo6PuDUGozHdPrVlzovPrC9206j8kpeNlM/5wARc b6Ng== X-Gm-Message-State: AOJu0YwDhSIKTJmBc3YUKEbdHYC5t0g3+X9i3NBFs8vrnmTF7s9wtccf e/iVJGKD5M5g2FgJR4k5F+0aJJgpewtH2rMQhHS6zb2aNJlb/msPOyvXCaXtwyM= X-Gm-Gg: ASbGncsove0K7j3dpwAN6JIkASX1/qGJp+t+m3SagcEwxZSNXZiSChZ00BODy2nUpxr yYdhjwA/Jwd2LgYHLNoR/xpEiXB0UDSrNIEn5HeSty22fxHgWz2/XGUzRbYRv43yvcYY/FBx2zn pedqYxQcg5mb46C1FQ3DwLz1VU66DBW8dLR3jYwcHxaeie+7tYwx7pvnApEgWMcQ2cBZ7GSz60O PfB6+MFHtSU+3iyl8yFz+NeRS7/YhHDCXtCn+u0aFVlofday1x4FE29sB/S/cE= X-Google-Smtp-Source: AGHT+IHXNTPwYGpyoF2oIO9YtYeoBNZ9bkHyASDQWStwZpuI0NOPrSg1SLgfLCaPbrvbr04vYZJzgg== X-Received: by 2002:a17:902:e5c7:b0:215:bf1b:a894 with SMTP id d9443c01a7336-219e6eb5bffmr760628135ad.24.1736001528912; Sat, 04 Jan 2025 06:38:48 -0800 (PST) Received: from localhost ([2400:4050:b783:b00:4952:3c52:120a:27e9]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-219dc962c5esm260927675ad.12.2025.01.04.06.38.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Jan 2025 06:38:48 -0800 (PST) From: Akihiko Odaki Date: Sat, 04 Jan 2025 23:38:34 +0900 Subject: [PATCH v2 1/5] elf: Define note name macros MIME-Version: 1.0 Message-Id: <20250104-elf-v2-1-77dc2e06db4e@daynix.com> References: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> In-Reply-To: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Queue-Id: 21095180009 X-Stat-Signature: iz86ipg5t7cur7qbahhic4c4k8dodmag X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736001529-707399 X-HE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5ZVbxyA5DhvejbDmdSDRIurvwfQN16RtKyqFAwTWRLwr6dOpuGZJLHhed1eJYxKG0QFeZTboAb3UzWN3HXiI09Hbr05h7x9SwkzJZGE4lvr8vY7uxVSl/VKLt0AKuznRZGJCNQRKCQlY6AUkbd5LmyaCvE/HKSU5oU9vrVp3HtZyVGH8oL4+hUQGVQLcsDrA4oP2rWm1P7UbHgQbTQtgJDdWOxWHMSOxGISebGFwZiDHHXuwu/WfvvONzuYlY2j6jC/ur3iCtKE/pHh48Aaz/pjcYCsXjN3EfuwjN9Slk9bZ3S+gh X-Bogosity: Ham, tests=bogofilter, spamicity=0.000278, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: elf.h had a comment saying: > 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". However, NT_PRSTATUS is also named "CORE". It is also unclear what "these types" refers to. To fix these problems, define a name for each note type. The added definitions are macros so the kernel and userspace can directly refer to them. Signed-off-by: Akihiko Odaki --- include/uapi/linux/elf.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index b44069d29cec..014b705b97d7 100644 --- a/include/uapi/linux/elf.h +++ b/include/uapi/linux/elf.h @@ -372,8 +372,6 @@ 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". */ #define NT_PRSTATUS 1 #define NT_PRFPREG 2 @@ -460,9 +458,91 @@ typedef struct elf64_shdr { #define NT_LOONGARCH_HW_BREAK 0xa05 /* LoongArch hardware breakpoint registers */ #define NT_LOONGARCH_HW_WATCH 0xa06 /* LoongArch hardware watchpoint registers */ -/* Note types with note name "GNU" */ +/* Note used in ET_EXEC and ET_DYN. */ #define NT_GNU_PROPERTY_TYPE_0 5 +/* Note names */ +#define NN_PRSTATUS "CORE" +#define NN_PRFPREG "CORE" +#define NN_PRPSINFO "CORE" +#define NN_TASKSTRUCT "CORE" +#define NN_AUXV "CORE" +#define NN_SIGINFO "CORE" +#define NN_FILE "CORE" +#define NN_PRXFPREG "LINUX" +#define NN_PPC_VMX "LINUX" +#define NN_PPC_SPE "LINUX" +#define NN_PPC_VSX "LINUX" +#define NN_PPC_TAR "LINUX" +#define NN_PPC_PPR "LINUX" +#define NN_PPC_DSCR "LINUX" +#define NN_PPC_EBB "LINUX" +#define NN_PPC_PMU "LINUX" +#define NN_PPC_TM_CGPR "LINUX" +#define NN_PPC_TM_CFPR "LINUX" +#define NN_PPC_TM_CVMX "LINUX" +#define NN_PPC_TM_CVSX "LINUX" +#define NN_PPC_TM_SPR "LINUX" +#define NN_PPC_TM_CTAR "LINUX" +#define NN_PPC_TM_CPPR "LINUX" +#define NN_PPC_TM_CDSCR "LINUX" +#define NN_PPC_PKEY "LINUX" +#define NN_PPC_DEXCR "LINUX" +#define NN_PPC_HASHKEYR "LINUX" +#define NN_386_TLS "LINUX" +#define NN_386_IOPERM "LINUX" +#define NN_X86_XSTATE "LINUX" +#define NN_X86_SHSTK "LINUX" +#define NN_X86_XSAVE_LAYOUT "LINUX" +#define NN_S390_HIGH_GPRS "LINUX" +#define NN_S390_TIMER "LINUX" +#define NN_S390_TODCMP "LINUX" +#define NN_S390_TODPREG "LINUX" +#define NN_S390_CTRS "LINUX" +#define NN_S390_PREFIX "LINUX" +#define NN_S390_LAST_BREAK "LINUX" +#define NN_S390_SYSTEM_CALL "LINUX" +#define NN_S390_TDB "LINUX" +#define NN_S390_VXRS_LOW "LINUX" +#define NN_S390_VXRS_HIGH "LINUX" +#define NN_S390_GS_CB "LINUX" +#define NN_S390_GS_BC "LINUX" +#define NN_S390_RI_CB "LINUX" +#define NN_S390_PV_CPU_DATA "LINUX" +#define NN_ARM_VFP "LINUX" +#define NN_ARM_TLS "LINUX" +#define NN_ARM_HW_BREAK "LINUX" +#define NN_ARM_HW_WATCH "LINUX" +#define NN_ARM_SYSTEM_CALL "LINUX" +#define NN_ARM_SVE "LINUX" +#define NN_ARM_PAC_MASK "LINUX" +#define NN_ARM_PACA_KEYS "LINUX" +#define NN_ARM_PACG_KEYS "LINUX" +#define NN_ARM_TAGGED_ADDR_CTRL "LINUX" +#define NN_ARM_PAC_ENABLED_KEYS "LINUX" +#define NN_ARM_SSVE "LINUX" +#define NN_ARM_ZA "LINUX" +#define NN_ARM_ZT "LINUX" +#define NN_ARM_FPMR "LINUX" +#define NN_ARM_POE "LINUX" +#define NN_ARM_GCS "LINUX" +#define NN_ARC_V2 "LINUX" +#define NN_VMCOREDD "LINUX" +#define NN_MIPS_DSP "LINUX" +#define NN_MIPS_FP_MODE "LINUX" +#define NN_MIPS_MSA "LINUX" +#define NN_RISCV_CSR "LINUX" +#define NN_RISCV_VECTOR "LINUX" +#define NN_RISCV_TAGGED_ADDR_CTRL "LINUX" +#define NN_LOONGARCH_CPUCFG "LINUX" +#define NN_LOONGARCH_CSR "LINUX" +#define NN_LOONGARCH_LSX "LINUX" +#define NN_LOONGARCH_LASX "LINUX" +#define NN_LOONGARCH_LBT "LINUX" +#define NN_LOONGARCH_HW_BREAK "LINUX" +#define NN_LOONGARCH_HW_WATCH "LINUX" +#define NN_GNU_PROPERTY_TYPE_0 "GNU" + /* Note header in a PT_NOTE section */ typedef struct elf32_note { Elf32_Word n_namesz; /* Name size */ From patchwork Sat Jan 4 14:38:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13926269 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 8C44EE77188 for ; Sat, 4 Jan 2025 14:38:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C2AF6B0093; Sat, 4 Jan 2025 09:38:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 173FE6B0095; Sat, 4 Jan 2025 09:38:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03B6E6B0096; Sat, 4 Jan 2025 09:38:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D3DFB6B0093 for ; Sat, 4 Jan 2025 09:38:58 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 84AF8AFFB0 for ; Sat, 4 Jan 2025 14:38:58 +0000 (UTC) X-FDA: 82970026356.11.8409445 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf13.hostedemail.com (Postfix) with ESMTP id A34682000A for ; Sat, 4 Jan 2025 14:38:56 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=hUhl6nNY; dmarc=none; spf=pass (imf13.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736001536; 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=isBOK5EkoVzx0+60SYTBYbzag/ZGKna5MSZ560y293s=; b=0qlnoc84xiUS8oB28v2jU7XTA44KXfyu/ze+ltdP7o/3WJulT7CVo838SeM+G2lYx4rvYV hrWjTRX4woSmhRxkCKQ9QWmlga4T6odQZoV/s/Y5LoCQTFj1e4PJaZC7aEQQTkVdn+k3Dc PCPqspwyem4skMx220J5j9AoC+/T19k= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736001536; a=rsa-sha256; cv=none; b=ShmMrE6sUBOlTLoWt2rhAdd7QK8EA1mFRuTNCNbs9Fb/61VkmCo8pTzlTNvzAHMonabfnS z+R56IczY8vxZYB66r8sFC0/DWM8FUAKxbpJoJfiAVDqu4exVIY+YLhfnPVjJysXyRDMiN 8nfOrK7/7+PiDENQKmpalpQ972YNk2k= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=hUhl6nNY; dmarc=none; spf=pass (imf13.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-21649a7bcdcso178992165ad.1 for ; Sat, 04 Jan 2025 06:38:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736001535; x=1736606335; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=isBOK5EkoVzx0+60SYTBYbzag/ZGKna5MSZ560y293s=; b=hUhl6nNY1xYnEJf4nUI3V3HsYccq++4U400HoJ9GxzLlVpw3jZGKtrXngdNwKSWmcj UzE2sUrQxnQLcI3cOk6Fgr3nktYCa14chzBFWXA6rycnII8VrrFFqBtcgu/X8yT+3u4e oIMdbmJWocWpJ5vSafyrmS2SN/WyHFv3VgJJ03oIzW9RRdvkJ8PIAYYGDQVu4E8UA1bj kqOGJlWT41H5bRAbR3nECpFRG5O/X+GWmOOL5qezfRveDvmTBY/6UvvuY8dpDOkRcva2 NdMbdSnqVSErDsMwnnlfHsA1jYQ3UxlBYYDRvKWDTCLD2vkwA5CkQEB0DzFYzL9+IysQ nYBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736001535; x=1736606335; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=isBOK5EkoVzx0+60SYTBYbzag/ZGKna5MSZ560y293s=; b=KEnD2FSS5hNZCGKes0Asf1CSJBohcBDiVln7TqtsZRCRR9vmpYfFudeWb57G8DCgdc hvc6Ib0kCEZgygIwGSoongrF7AOtAQFPJJZtV1UieAEhaP7ESENkLjXU0aObomm6ob5C WyZDQpo+SRTyOGWeRpWLqtK9YSVkbPj1o5GGMra7tuLdKFCNz2MYzFyBHg3vK1UyszWW S1nxlm5mP75Zq3+eKsmMCP7mBtDyX92srFz9Pk/wLKlWTT5RiRsibePJyioUrXYILx+t HhQFUJmBk4NRQlKWqsumBX42fkyPurJrTbsU++QV/B8mheqGpWSELbTswxycmCw1O4pH 2Bqw== X-Gm-Message-State: AOJu0Yz9MstGIUGPbBRiyUBv6s70oNdNGhBrkCTIBguMIjtfnpDLc4t8 2LRsbo4s9sap1hNBJcDTwRJ8HZP6tZDCfkFEfv9Vx0mArYDFPgbbjfF7t73zZp0= X-Gm-Gg: ASbGnct7UgtBOIZD3dYo/WtFlx+6ePlNnSoqSkGOt7zAx3G316sFTgad3SxFI9EX1pB wkAh60CDtKJJtpWqyM941T+pEtMaiDmUh0IRvYMBiUPRmvPrAnQK+Ht1PzhavBu3ewD+w5QE6qx DPvX4NdS2uUGIy71M1fJk7eQwrFrwuWauZcCFdURlpZyqOF/mkrgA/3VB+NaRg6Y+mMnsYCVprr PzXwZ6uYe8r8hYKJuPq4l2suQa3+F0ZlS+H29hfWDKv+32JHVpHhdOya04v4Lw= X-Google-Smtp-Source: AGHT+IF6CIwlIeIPYhIfDdGvLEKVBUHmWt4TSRbGoWTRRPhul/Ngc0MsMOD2Yw2Im8h1VnwURPE7+A== X-Received: by 2002:a05:6a00:44cb:b0:725:1d37:ebff with SMTP id d2e1a72fcca58-72abe0960c6mr74590582b3a.22.1736001535492; Sat, 04 Jan 2025 06:38:55 -0800 (PST) Received: from localhost ([2400:4050:b783:b00:4952:3c52:120a:27e9]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-8427ab7830asm25799890a12.0.2025.01.04.06.38.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Jan 2025 06:38:55 -0800 (PST) From: Akihiko Odaki Date: Sat, 04 Jan 2025 23:38:35 +0900 Subject: [PATCH v2 2/5] binfmt_elf: Use note name macros MIME-Version: 1.0 Message-Id: <20250104-elf-v2-2-77dc2e06db4e@daynix.com> References: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> In-Reply-To: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Stat-Signature: zbii6yq9n6p137ekf4rnqpdwccka6axh X-Rspamd-Queue-Id: A34682000A X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1736001536-864361 X-HE-Meta: U2FsdGVkX18WuL5n5cfJywaHyi1kTsK/Ol1kVpAk0KY4psC6q4CEbW7JuzzHiXJzQVOE5UfV1aSvBB07J4ZzH0y/MakDSmP1J5NePPsF41j4YiiKYoNbPKYeC1sBYiyymLE/BEGeIJBx/JnuGWI4Vv3OeHodjPBSsJ5qJ1vr3IULcBgVzh7HnDubyTnrX5ephqjlyFyGw3af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0lNLCY4i58JdJj2Y2NU4/mkaSWhiRZXnNGJDgex8h8L7kcsdJUU673P0h9KbC5SWkpcwbNI/F4wu1FEyqc/oUWEAAHqCpnQ8Ip9cC0AGc+QN+TXlZIPWOJvl+F1NKlbl1xo9JW5Tvy0H6cd3E6iti8Q== 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: Use note name macros to match with the userspace's expectation. Signed-off-by: Akihiko Odaki --- fs/binfmt_elf.c | 21 ++++++++++----------- fs/binfmt_elf_fdpic.c | 8 ++++---- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 106f0e8af177..5b4a92e5e508 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -762,8 +762,7 @@ static int parse_elf_property(const char *data, size_t *off, size_t datasz, } #define NOTE_DATA_SZ SZ_1K -#define GNU_PROPERTY_TYPE_0_NAME "GNU" -#define NOTE_NAME_SZ (sizeof(GNU_PROPERTY_TYPE_0_NAME)) +#define NOTE_NAME_SZ (sizeof(NN_GNU_PROPERTY_TYPE_0)) static int parse_elf_properties(struct file *f, const struct elf_phdr *phdr, struct arch_elf_state *arch) @@ -800,7 +799,7 @@ static int parse_elf_properties(struct file *f, const struct elf_phdr *phdr, if (note.nhdr.n_type != NT_GNU_PROPERTY_TYPE_0 || note.nhdr.n_namesz != NOTE_NAME_SZ || strncmp(note.data + sizeof(note.nhdr), - GNU_PROPERTY_TYPE_0_NAME, n - sizeof(note.nhdr))) + NN_GNU_PROPERTY_TYPE_0, n - sizeof(note.nhdr))) return -ENOEXEC; off = round_up(sizeof(note.nhdr) + NOTE_NAME_SZ, @@ -1603,14 +1602,14 @@ static void fill_auxv_note(struct memelfnote *note, struct mm_struct *mm) do i += 2; while (auxv[i - 2] != AT_NULL); - fill_note(note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv); + fill_note(note, NN_AUXV, NT_AUXV, i * sizeof(elf_addr_t), auxv); } static void fill_siginfo_note(struct memelfnote *note, user_siginfo_t *csigdata, const kernel_siginfo_t *siginfo) { copy_siginfo_to_external(csigdata, siginfo); - fill_note(note, "CORE", NT_SIGINFO, sizeof(*csigdata), csigdata); + fill_note(note, NN_SIGINFO, NT_SIGINFO, sizeof(*csigdata), csigdata); } /* @@ -1706,7 +1705,7 @@ static int fill_files_note(struct memelfnote *note, struct coredump_params *cprm } size = name_curpos - (char *)data; - fill_note(note, "CORE", NT_FILE, size, data); + fill_note(note, NN_FILE, NT_FILE, size, data); return 0; } @@ -1767,7 +1766,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, regset_get(t->task, &view->regsets[0], sizeof(t->prstatus.pr_reg), &t->prstatus.pr_reg); - fill_note(&t->notes[0], "CORE", NT_PRSTATUS, + fill_note(&t->notes[0], NN_PRSTATUS, NT_PRSTATUS, PRSTATUS_SIZE, &t->prstatus); info->size += notesize(&t->notes[0]); @@ -1801,7 +1800,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, if (is_fpreg) SET_PR_FPVALID(&t->prstatus); - fill_note(&t->notes[note_iter], is_fpreg ? "CORE" : "LINUX", + fill_note(&t->notes[note_iter], is_fpreg ? NN_PRFPREG : "LINUX", note_type, ret, data); info->size += notesize(&t->notes[note_iter]); @@ -1821,7 +1820,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, fill_prstatus(&t->prstatus.common, p, signr); elf_core_copy_task_regs(p, &t->prstatus.pr_reg); - fill_note(&t->notes[0], "CORE", NT_PRSTATUS, sizeof(t->prstatus), + fill_note(&t->notes[0], NN_PRSTATUS, NT_PRSTATUS, sizeof(t->prstatus), &(t->prstatus)); info->size += notesize(&t->notes[0]); @@ -1832,7 +1831,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, } t->prstatus.pr_fpvalid = 1; - fill_note(&t->notes[1], "CORE", NT_PRFPREG, sizeof(*fpu), fpu); + fill_note(&t->notes[1], NN_PRFPREG, NT_PRFPREG, sizeof(*fpu), fpu); info->size += notesize(&t->notes[1]); return 1; @@ -1852,7 +1851,7 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL); if (!psinfo) return 0; - fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo); + fill_note(&info->psinfo, NN_PRPSINFO, NT_PRPSINFO, sizeof(*psinfo), psinfo); #ifdef CORE_DUMP_USE_REGSET view = task_user_regset_view(dump_task); diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index f1a7c4875c4a..96bd9d2f23d7 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -1397,7 +1397,7 @@ static struct elf_thread_status *elf_dump_thread_status(long signr, struct task_ regset_get(p, &view->regsets[0], sizeof(t->prstatus.pr_reg), &t->prstatus.pr_reg); - fill_note(&t->notes[0], "CORE", NT_PRSTATUS, sizeof(t->prstatus), + fill_note(&t->notes[0], NN_PRSTATUS, NT_PRSTATUS, sizeof(t->prstatus), &t->prstatus); t->num_notes++; *sz += notesize(&t->notes[0]); @@ -1415,7 +1415,7 @@ static struct elf_thread_status *elf_dump_thread_status(long signr, struct task_ } if (t->prstatus.pr_fpvalid) { - fill_note(&t->notes[1], "CORE", NT_PRFPREG, sizeof(t->fpu), + fill_note(&t->notes[1], NN_PRFPREG, NT_PRFPREG, sizeof(t->fpu), &t->fpu); t->num_notes++; *sz += notesize(&t->notes[1]); @@ -1530,7 +1530,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) */ fill_psinfo(psinfo, current->group_leader, current->mm); - fill_note(&psinfo_note, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo); + fill_note(&psinfo_note, NN_PRPSINFO, NT_PRPSINFO, sizeof(*psinfo), psinfo); thread_status_size += notesize(&psinfo_note); auxv = (elf_addr_t *) current->mm->saved_auxv; @@ -1538,7 +1538,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) do i += 2; while (auxv[i - 2] != AT_NULL); - fill_note(&auxv_note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv); + fill_note(&auxv_note, NN_AUXV, NT_AUXV, i * sizeof(elf_addr_t), auxv); thread_status_size += notesize(&auxv_note); offset = sizeof(*elf); /* ELF header */ From patchwork Sat Jan 4 14:38:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13926270 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 60988E77199 for ; Sat, 4 Jan 2025 14:39:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EBB166B0096; Sat, 4 Jan 2025 09:39:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E6B8C6B0098; Sat, 4 Jan 2025 09:39:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5B8A6B0099; Sat, 4 Jan 2025 09:39:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B7E0B6B0096 for ; Sat, 4 Jan 2025 09:39:06 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6C9FE1C71C3 for ; Sat, 4 Jan 2025 14:39:06 +0000 (UTC) X-FDA: 82970026692.18.430FBAD Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf13.hostedemail.com (Postfix) with ESMTP id 87FF420007 for ; Sat, 4 Jan 2025 14:39:03 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="yIjCqO/8"; dmarc=none; spf=pass (imf13.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736001543; a=rsa-sha256; cv=none; b=6fbmMT2DDKlGfp6rh8zf30MHUjd4X9n5zWo8rfEO4m+6cXB+TNYfwUFMk6cMKp2K4YrK0C QV69VsO4wTSZ4kGWuiqSheIa0+s/FQmjlOPn/XRcLgIMSspaqomtTtUsXZvVqD6l4r1Kya qY24EVK9gTCLyPGyLkGje98Whe8SFl4= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="yIjCqO/8"; dmarc=none; spf=pass (imf13.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736001543; 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=ffgGfa1tRdbMu1hKTw9Yyv/ZhjBJNeWsWiWpVjLRBnw=; b=v258qCC2AdXYmFMvddCwLWHNTczxcy8HmtKpXoGC14ZsClZ+zeQMrvKSzicWCwf9C99gdx mtfVFdPYdu/yKW0QIqrhKdFQB174n/effhY5jbAo1iEWfs4YuuJDg5L2BU/F4yxbjNGyjI WoCFn5GDdvPZZ4Ifk6H/uFwEr1gxv8I= Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2166651f752so214486725ad.3 for ; Sat, 04 Jan 2025 06:39:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736001542; x=1736606342; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ffgGfa1tRdbMu1hKTw9Yyv/ZhjBJNeWsWiWpVjLRBnw=; b=yIjCqO/8SD8Pvvbi+wF/KhDgqbIffjaXqK3uBI5Da49JLQiJJyTY1/Aii8OlhXozZ8 LlVWonZR3J/VEL6PKi4azHHZ0hsG086oQqdF36PkV++HToPCZtL2QcVIQv++a3S7b3rY ZJjbh3GVfItqusi2GSu6VQxBRfze1y6FHmIXTgIYcvqexm2jgnhRVMy7Nt7CCYlS0iJA rhH1AN4TZOeLGc6oXXLP+OaNKqlab2EAJemei4Hx9e43yzjNMmpTjakGxymzRT0r28e9 cQ02plLaivqnPO4Ae7IGHYIgmPaPzWQIGYt5xnW8ODyUj4m4KGs1i8QjYhxlDycJzgru 4OSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736001542; x=1736606342; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ffgGfa1tRdbMu1hKTw9Yyv/ZhjBJNeWsWiWpVjLRBnw=; b=edkvUD9rAGml+vch9GUzsys7f4/KebdwL6Akbb0FYfQYJZh7rGuR9ozh4t4OxQrDlZ ClbSLnURFLyGJfP06nvqD1NYIkfq1qDWiLP3Unn6Y4aP8jP9/sNPe13srbz9GAY6CKIU oxUZD6CaOr+zyL44dLjMHbRFWksDPg7rDOQl6QMwsNckHX6dPVfxj0fEJ9do3I73dVeY +i7c5wNp0Rd0Uc6bSvv0lyBF1NOiAVOJcb5bxR73TVuO/WYQslDIZ6glBs855ib2q329 O2vau8IRO+GziWgBMa/dXOl9WucwckrtK+v0Iz9TgqfprVncfgIcaOMk+D41DQ3vgvcW dvIw== X-Gm-Message-State: AOJu0YytXW37baArGpMdaP9I7oOgrW3f3NIsQzcZ6qW7w/S+k2fdb591 /ciASDEjmAHLzCZtOpuivF9qCCnfdkXzZWOYl3k3gERLdAtE7at6ha1lMyxeU/M= X-Gm-Gg: ASbGncvqhFHvr4JJpCqnLLSazA7pGfG8USbWXDzRXLMk1+QAhlGMOzUVTCA/adp9DTa zdre2VY7nRt7po2M2f/ztqQEePyvGQatbLDqdkxFAimEtdxIJrS7N0LRcuvxA64aS4CYvJqB7j+ zSuG9rLgwpHDl3Nu3DDwmXt4B2yT8iZvBAjZlfWrMR/2mpWXw1W7ERMTWTCL1N7p30uuoWxVGA6 ZIdtJN9BR4E8ngxEDbXv9+/snVb3yk7EGNBo9THregQeavhzs8DTDj/273hF6A= X-Google-Smtp-Source: AGHT+IFOWxSlU7LboQeYrGu1ZapBf19hzzItaS6bjgdVpBMRFBzVa4lgIENsB6ZfRDlcb/evlyTHrw== X-Received: by 2002:a05:6a20:2d1f:b0:1e1:b1e4:e750 with SMTP id adf61e73a8af0-1e5e04717a2mr77843013637.18.1736001542441; Sat, 04 Jan 2025 06:39:02 -0800 (PST) Received: from localhost ([2400:4050:b783:b00:4952:3c52:120a:27e9]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72aad8fd7b0sm17288107b3a.139.2025.01.04.06.38.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Jan 2025 06:39:02 -0800 (PST) From: Akihiko Odaki Date: Sat, 04 Jan 2025 23:38:36 +0900 Subject: [PATCH v2 3/5] powwerpc: Use note name macros MIME-Version: 1.0 Message-Id: <20250104-elf-v2-3-77dc2e06db4e@daynix.com> References: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> In-Reply-To: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 87FF420007 X-Stat-Signature: qo1o5s5nua5km3ojsaqd3f5qxm6bdy3p X-Rspam-User: X-HE-Tag: 1736001543-657988 X-HE-Meta: U2FsdGVkX18mBjXei5BjiwpDXx6sqonyrANt6jkUnrLMnwo5qLyP6VWMTrlqjFeQRpfryW6AYyj3cw39XthAdcetzQ7GTua8bVRgVMTMN4+YLFJZaI+e+sQRcJVN6lWEb8iXV3KsULBSNWLe9KuhXBuD00278/pTwTnTnFgL1Ls4YVMT1Rm/WvbhxzUDxQ4UyKo7Z7f2glNSVv03WB4I8MjEQNzZqX1//kwvOhgHDtVG25tEisoNaawnAhnWkLudbbJMIPApCBm2HHkhWejwJYqsUGZi66Z0qnxq8+pd+cZiVu0gUL/V7jMDoUT6R66HoNcD5ynVEzCAmrgVil98nzf7TfVisI5XkcZlty1qS++vb650NE8TTB1l5Vsd60cYJ6S7IJk5BK/QeZo4Gc4MyoVf/eIdt5/bpeV/fLvGv9bFJeTlTLBZ7USLP5vYYg+yXZLIdEco+Y84J3kW5+1ct36IU35jGYLoKW53/oU/xFVCykoQzINvLe3OXdYQLlWtW1vY8dOH0K30/MSFR4BCduiRpEXjJT6e0PYX/mTQ6njC5ZaVnvkkykYBxtGxZ7/6maaBSHzdtwPqxDNzRJqM+y0uJBwRddYcGngw/SYaKqqVHOcClIY9iFUqFyYYzvkKeq/h1e2cyXUGHimybZUYH9bIa2HO4hMhWLUNaS1fvDBpcjPxQVPe+DHkfKt6DOkobh0qnhXBap7HInebzQjHkwtPeFjplE7xMm+x+DsilMBM5WuBjyuzQXp6XcR/qMQsT91gStWQ7aoZhiCeRfHu8UJE/cs5u4aU5Nd0W/mb0zW7i6WYb1Fq3QJBkK4Sz/unaK1MgCLkXqFezg6//yaQK9gnsIZBRKAOMU90HQhVv1GoYxzE/JuQecxzgGnUENQExVo+oWBxweeu60DWWf49xvaBR5T5zyi1McZuPLZHhEWgZINHe+GnENEEanqH0PE7n3NUMFSI7f7tYuBFNI0 J2wxE8XW EqZYnec6DxO2u2Nzm3IiqiObskIQeN5EMJsGUa1TDSt/ZT81CkWte9qQLbkOUbCgC9fta577P7EaJunXI8dmjjG1qK1LSYdZk9Fe3o7iIIMkd0nfW8b1CTeRoJnsXu7yKKmpoHmzoXnrEDfgEHdwP30SiYi5hxHciTtZ+NpfHNAuFIAOzgxy3dkBm5+ir7t5+M+IFYJLN2QMmwxmEQoKVWtFZMkAcq+uLcN8L7bLtRylQPPpxHV1tG5+CUZYpprFvQjoWR8prGrQzagDL1lMf2EhvXdUc96zU6+WgWB2CKPH0TDUBnI+Bz2CSqT9DfpjMcXswNbWO8vjEKS7tD5uwUp9hncSbjeBpB1+EyigZUy7G/uwKstbWU+Yw5CWIFAXx+Mkh 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: Use note name macros to match with the userspace's expectation. Signed-off-by: Akihiko Odaki --- arch/powerpc/kernel/fadump.c | 2 +- arch/powerpc/platforms/powernv/opal-core.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 4b371c738213..d44349fe8e2b 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -751,7 +751,7 @@ u32 *__init fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs) * prstatus.pr_pid = ???? */ elf_core_copy_regs(&prstatus.pr_reg, regs); - buf = append_elf_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS, + buf = append_elf_note(buf, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); return buf; } diff --git a/arch/powerpc/platforms/powernv/opal-core.c b/arch/powerpc/platforms/powernv/opal-core.c index c9a9b759cc92..a379ff86c120 100644 --- a/arch/powerpc/platforms/powernv/opal-core.c +++ b/arch/powerpc/platforms/powernv/opal-core.c @@ -149,7 +149,7 @@ static Elf64_Word *__init auxv_to_elf64_notes(Elf64_Word *buf, /* end of vector */ bufp[idx++] = cpu_to_be64(AT_NULL); - buf = append_elf64_note(buf, CRASH_CORE_NOTE_NAME, NT_AUXV, + buf = append_elf64_note(buf, NN_AUXV, NT_AUXV, oc_conf->auxv_buf, AUXV_DESC_SZ); return buf; } @@ -252,7 +252,7 @@ static Elf64_Word * __init opalcore_append_cpu_notes(Elf64_Word *buf) * crashing CPU's prstatus. */ first_cpu_note = buf; - buf = append_elf64_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS, + buf = append_elf64_note(buf, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); for (i = 0; i < oc_conf->num_cpus; i++, bufp += size_per_thread) { @@ -279,7 +279,7 @@ static Elf64_Word * __init opalcore_append_cpu_notes(Elf64_Word *buf) fill_prstatus(&prstatus, thread_pir, ®s); if (thread_pir != oc_conf->crashing_cpu) { - buf = append_elf64_note(buf, CRASH_CORE_NOTE_NAME, + buf = append_elf64_note(buf, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); } else { @@ -287,7 +287,7 @@ static Elf64_Word * __init opalcore_append_cpu_notes(Elf64_Word *buf) * Add crashing CPU as the first NT_PRSTATUS note for * GDB to process the core file appropriately. */ - append_elf64_note(first_cpu_note, CRASH_CORE_NOTE_NAME, + append_elf64_note(first_cpu_note, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); } From patchwork Sat Jan 4 14:38:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13926271 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 E0D16E77188 for ; Sat, 4 Jan 2025 14:39:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DE096B0099; Sat, 4 Jan 2025 09:39:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 78EA26B009A; Sat, 4 Jan 2025 09:39:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6587B6B009B; Sat, 4 Jan 2025 09:39:12 -0500 (EST) 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 47F946B0099 for ; Sat, 4 Jan 2025 09:39:12 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0480480D7F for ; Sat, 4 Jan 2025 14:39:11 +0000 (UTC) X-FDA: 82970026944.15.465BB85 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by imf08.hostedemail.com (Postfix) with ESMTP id 1C6CB160005 for ; Sat, 4 Jan 2025 14:39:09 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=Vv8K+tfa; spf=pass (imf08.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736001550; 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=SYIrxPsAVLm9525H8KmJlUUcKlEHI39WEeyICf7u0AY=; b=KqmeKqRxAhFTf2vS4C/MDw+N1akKVoyA6489agcXCK7KvsRJVQhWYWeEwNk3LwtjG2M6rJ i1DJ5n+i9fcxTM7s9k5RPhduXThbAARCxv+DZHot6wvxYk9EFtWMw3n6EYMcEG5V6Ezxe8 eJp5bRTcddZa9STGc34cREot8fwRtT8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=Vv8K+tfa; spf=pass (imf08.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736001550; a=rsa-sha256; cv=none; b=kswgmgGyjAj29wdZTRWRRfMm+Ez67Wpi0XiSwsyYbY0DYeBW5PUYRb2NUxhHXWf4M6NOot VsS52bVgewHNkSoqRjs7R2+jEV5EVETTtV/iv9OK9GW5O0nrMf++ucTq3RpvBDB9us4iX8 X32rQfrefB6p+p0gXc8wE2O1skxfT2Q= Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2166651f752so214487705ad.3 for ; Sat, 04 Jan 2025 06:39:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736001549; x=1736606349; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SYIrxPsAVLm9525H8KmJlUUcKlEHI39WEeyICf7u0AY=; b=Vv8K+tfaWSUD7O7ks6CCRVOceqnAqQ1Du+X5QGv6QceAbP3k0uwjydReVGOtHhQdir MX9F6SxbStL1wVrGBdo1lfojEnxi3xZS3SPqqrA1cJD33mFmYqiuxlBslN97T9NdW73Z L9xTKtChdM8M3P/FDMSZlDy75c23b9R4fHfC2NPWpzy1YTZ/3SUIribVSPFyXGplZP01 94GIYXagwaU40lUquw2VwyeZ6P6alnLMXpB+gLWkuidjYrP826Kx+e+KmRmoc0vJgB6T qxMBHthxCSKBVBRA/uRH9KX/+vA3JKmZ39P/SXcuuYJIuPXxKwFZkeltKNoDLfnwvrL8 pcQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736001549; x=1736606349; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SYIrxPsAVLm9525H8KmJlUUcKlEHI39WEeyICf7u0AY=; b=dd/yehougqMLuPwP7b54pZdEmxg9AhHHt7vDe+kJbPp/JLRJVj/MqtX5uJt++E0gN7 Ro13ZR9aNco2zpFRaQCGmYT/M38PRAbQrBgWENSK+cDp3i3Iz7jrNXjvzg8upiNpAA0O l9qAug9dgmAH3tj7jD3B30dBPObS2mQEjIbTjQSFvEfARGNF8Y/7fNc7ZMqpOb1WCJfI siSIwrPTU/n6wk+IhQsn6LiQ2XvghKs6pu68nXNAGZoOu57Qf5seRr8Osi7JZva2V3GL mT0wbfbwZ76xkXNfy0bMc2vXEdX5lZSwcJL1VTFv8uoFtUxgxtd1NJbYIFQmnCUjL+tY 0HXQ== X-Gm-Message-State: AOJu0YzR2ifpbH8Mi15168gpXFg+VDGnLf0m/b3ulUvbKkioqr4hJmmA AxfHZnoDc5AdcehPFIQWuc2BoNGuHCQWJ59T3aUvv3J0SVvOKN0zxBVtnq5ehkg= X-Gm-Gg: ASbGncsxt/KU7RCxPNo6BeUyB1LPV15AqTkCE4OWFhhH3jRe060LJMygPOShfi9ULEP FBUastmcTnJeQFwsP7W/s93T3LNUWoy8L1khrqdishE2xoa8z0OmpUtqzeiFqazX8Sr2WkTmnp5 fFyJcxeAhHijXbNlKqQhduc38DZ9TTwp7a2hlFUtEITRSjevJMFyQAtLffaqonqr4i59ali9Mxu xLzB6KM/4njBSqEK60Cuw7ZdDt7dtdSkVNGrZqNmqqnXVvjaxoik3+iAdWOXQY= X-Google-Smtp-Source: AGHT+IEy84cJ3h5ytJvCxSHHyFyZN9d/gzxb3RlphGjioGS1LvEPzNOYZA2OsynrQSHDV4AjG+98tg== X-Received: by 2002:a17:902:db0f:b0:215:4362:bc76 with SMTP id d9443c01a7336-219e6f29827mr814402335ad.54.1736001548953; Sat, 04 Jan 2025 06:39:08 -0800 (PST) Received: from localhost ([2400:4050:b783:b00:4952:3c52:120a:27e9]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-219dc963103sm262510765ad.52.2025.01.04.06.39.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Jan 2025 06:39:08 -0800 (PST) From: Akihiko Odaki Date: Sat, 04 Jan 2025 23:38:37 +0900 Subject: [PATCH v2 4/5] crash: Use note name macros MIME-Version: 1.0 Message-Id: <20250104-elf-v2-4-77dc2e06db4e@daynix.com> References: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> In-Reply-To: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Queue-Id: 1C6CB160005 X-Stat-Signature: 3urzk7mf6ot7fei6bk7jzt11igozs9yy X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736001549-761011 X-HE-Meta: U2FsdGVkX1/Qjau/9AUJ6Em+J9istNjpd7eOHJl16Mm4yTs9QlrMCdbvq2DIJ16HON3S7SfXo6sjyHMWCyvLrhnyd3zdgdMUJ/Qyjw1CO+W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crupwsmkTjo5HQF1NAwJYmVzOIa6MRd6jVMgqXuXtyFqcrQgcEAB+eYEuKmacYpawFF5o+6Uj0N0dzk4ZF0fXwdmR4n2JtvhPd99bFlXxBlf+5FIrrYKI3MpcmZ2TwNaXIbbDtp2lS8VcSAHnP5zBAaMYlwQwgXgjH/u95AFfd1iK2FB8Wa8 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: Use note name macros to match with the userspace's expectation. Signed-off-by: Akihiko Odaki --- fs/proc/kcore.c | 12 ++++++------ include/linux/vmcore_info.h | 2 +- kernel/crash_core.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index e376f48c4b8b..e5612313b8b4 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -34,8 +34,6 @@ #include #include "internal.h" -#define CORE_STR "CORE" - #ifndef ELF_CORE_EFLAGS #define ELF_CORE_EFLAGS 0 #endif @@ -119,7 +117,9 @@ static size_t get_kcore_size(int *nphdr, size_t *phdrs_len, size_t *notes_len, *phdrs_len = *nphdr * sizeof(struct elf_phdr); *notes_len = (4 * sizeof(struct elf_note) + - 3 * ALIGN(sizeof(CORE_STR), 4) + + ALIGN(sizeof(NN_PRSTATUS), 4) + + ALIGN(sizeof(NN_PRPSINFO), 4) + + ALIGN(sizeof(NN_TASKSTRUCT), 4) + VMCOREINFO_NOTE_NAME_BYTES + ALIGN(sizeof(struct elf_prstatus), 4) + ALIGN(sizeof(struct elf_prpsinfo), 4) + @@ -444,11 +444,11 @@ static ssize_t read_kcore_iter(struct kiocb *iocb, struct iov_iter *iter) goto out; } - append_kcore_note(notes, &i, CORE_STR, NT_PRSTATUS, &prstatus, + append_kcore_note(notes, &i, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); - append_kcore_note(notes, &i, CORE_STR, NT_PRPSINFO, &prpsinfo, + append_kcore_note(notes, &i, NN_PRPSINFO, NT_PRPSINFO, &prpsinfo, sizeof(prpsinfo)); - append_kcore_note(notes, &i, CORE_STR, NT_TASKSTRUCT, current, + append_kcore_note(notes, &i, NN_TASKSTRUCT, NT_TASKSTRUCT, current, arch_task_struct_size); /* * vmcoreinfo_size is mostly constant after init time, but it diff --git a/include/linux/vmcore_info.h b/include/linux/vmcore_info.h index e1dec1a6a749..1672801fd98c 100644 --- a/include/linux/vmcore_info.h +++ b/include/linux/vmcore_info.h @@ -8,7 +8,7 @@ #define CRASH_CORE_NOTE_NAME "CORE" #define CRASH_CORE_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) -#define CRASH_CORE_NOTE_NAME_BYTES ALIGN(sizeof(CRASH_CORE_NOTE_NAME), 4) +#define CRASH_CORE_NOTE_NAME_BYTES ALIGN(sizeof(NN_PRSTATUS), 4) #define CRASH_CORE_NOTE_DESC_BYTES ALIGN(sizeof(struct elf_prstatus), 4) /* diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 078fe5bc5a74..335b8425dd4b 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -436,7 +436,7 @@ void crash_save_cpu(struct pt_regs *regs, int cpu) memset(&prstatus, 0, sizeof(prstatus)); prstatus.common.pr_pid = current->pid; elf_core_copy_regs(&prstatus.pr_reg, regs); - buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS, + buf = append_elf_note(buf, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); final_note(buf); } From patchwork Sat Jan 4 14:38:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13926272 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 AC8AAE77197 for ; Sat, 4 Jan 2025 14:39:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4CFC46B009B; Sat, 4 Jan 2025 09:39:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4802F6B009C; Sat, 4 Jan 2025 09:39:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36F2D6B009D; Sat, 4 Jan 2025 09:39:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 154C46B009B for ; Sat, 4 Jan 2025 09:39:19 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8DD47AFFE8 for ; Sat, 4 Jan 2025 14:39:18 +0000 (UTC) X-FDA: 82970027196.16.8AEDA1E Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf02.hostedemail.com (Postfix) with ESMTP id B39628000D for ; Sat, 4 Jan 2025 14:39:16 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=cnYluTLS; spf=pass (imf02.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736001556; 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=lItEO8+vDf3ne2QEFaUdlfKMhS1868rwBEwl+2/8wc8=; b=34fo8wQfW1iHuq5yGR6poW8MJGHafjsLb9q7i/opxLBMJv7S1/Ma9N73wJhvwibo3XAZnk aGOuY1av4zO4L0IdEDNzCI+Pu2tBMm96/F7Htz5xVkkl36jjgs2CvRmCh/cgZYBszAxWrP fEqlUyEAYLoeLuGLdaoVLw0Zq4bmH8Y= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=cnYluTLS; spf=pass (imf02.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736001556; a=rsa-sha256; cv=none; b=KMBKaPv0XCRg6AmHYBOxffX9Y+RASCDnIPcSgL8mcvn9szi5RoyCK5x+bLg0hZEKSRSa3O r+mc6FwodMTcBKD0475ZhiHHOeIzUndQ+kYl0Dydp6KHZ8CkHAMc4pazwI1Me3C2BEqwDO eslMo3aHAZWeT+RWFypdv7FrQbvLfbY= Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2eed82ca5b4so18392000a91.2 for ; Sat, 04 Jan 2025 06:39:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736001555; x=1736606355; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=lItEO8+vDf3ne2QEFaUdlfKMhS1868rwBEwl+2/8wc8=; b=cnYluTLSqeO41UHJKWkLRx9TjAcCNn8lZdgf+zYv3xvGmqvtY3CAAv5MtM08BLyEpW 4HWdX5ACBpjqTt0Ui5OEsI+dGwKOknFFEVpZtuF9KlyOAZNjaKjHq/WDzfNyAWmCQhXD G6m2Dsi9/1Y56NS9Nuu8ugBFZUme+uRDQkHFP3JXQK83llT/Jk0In2pJq2jE4FuCbfU5 ZB56gAjJYJ3kWmkZznTnrw7PqCV7zmlU/XmqziGTkqg2XvA0u4oC2+DrDJjDEViABlLN sLu9bOPvJWfxseWzbytjFbo3GuJFPAq7kIqKrPuxsXKBM5d0nwV5xuxVVpmBTM7oagiF RNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736001555; x=1736606355; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lItEO8+vDf3ne2QEFaUdlfKMhS1868rwBEwl+2/8wc8=; b=IuQiG/8SnwuwO8/binY8mxTTm+iGTsSw21w6j1Ls3I+4hxHqfsmnqyAh/6IoE8c5ZW Ry2eHOEOC+KRzSyl9huWi6udo0RQCHGRhZ1/URL8M9DaGYHPuo9la823CBm5YGxnUBxM 3PSGmVNWoOzckxj88XiESRk4w/HIh3f9h/+V0ckF3qmNA/gEcja75+jtbt/jJNBYFYWw erAZrQBuNFZQ2LVd8ElKjoJqK23FJPznyuMhY+TSDmwgrZj0V8+0EDuM/SZqv/VqpZzz tkKSwGyA4B+kV160vlbIIH5sefCUqN1KajohdMCEB8oU9DIcxZHL9Xp6WgRgr5n4tPuZ Ytyw== X-Gm-Message-State: AOJu0YzJzyWwvq4x0UP0QRW5+/hhCmSK5E+LI7dfZ+/005FwiD9xVFzc /J95g21SsrYSYof5oiKpfSRMZ55w7b/Rw0uWg1MG6gtm3rcZotiQ8yV7kUuyCMA= X-Gm-Gg: ASbGncsW4uplZj4SJKWhUFbzyIrL6HDMb+i2Or2HyjjUVOIur1q/iHyRAZjXnef4ut7 VEmRes40o2Z5PzNCy1mKISXRjlDRkkud/fZc+QjvZEjmvFniM2TWMQK8c6hhLBpFDACaLcRfQkh dlM+dkSBHHd7idbMFnmNdak4LIS2d1sCnxtUKEK6Vp1NLPjGWIraSY4cOdJbsDUIQJ52LcpOFE+ nIWZNm/LLVzaehoqdwFzoxXWI3hqL0KwG8ljiG6IRCckgwAmCS0Xqqx85Ewnf4= X-Google-Smtp-Source: AGHT+IE6l143okZ4K2hLdktIIklrvNPqE32MSRd/SLQaBZqLFpJB0ZcbHN/hLV+Lk0+UAUXZGQQd2Q== X-Received: by 2002:a05:6a00:4098:b0:725:c8ea:b30a with SMTP id d2e1a72fcca58-72abde2ab0emr75955118b3a.14.1736001555483; Sat, 04 Jan 2025 06:39:15 -0800 (PST) Received: from localhost ([2400:4050:b783:b00:4952:3c52:120a:27e9]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72aad8f90b9sm28017661b3a.131.2025.01.04.06.39.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Jan 2025 06:39:15 -0800 (PST) From: Akihiko Odaki Date: Sat, 04 Jan 2025 23:38:38 +0900 Subject: [PATCH v2 5/5] crash: Remove KEXEC_CORE_NOTE_NAME MIME-Version: 1.0 Message-Id: <20250104-elf-v2-5-77dc2e06db4e@daynix.com> References: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> In-Reply-To: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Queue-Id: B39628000D X-Rspamd-Server: rspam12 X-Stat-Signature: 478mdjujt3esjadi14q8w9n1kasxi1jg X-Rspam-User: X-HE-Tag: 1736001556-713656 X-HE-Meta: U2FsdGVkX1/z+hManwUZv0JYqH6+63v/e278yvi2r6vL3E8azAk9I1RFOelQCr+nHtajWc2NmOyHipUertuON0xvVAMURJC8sXH25n/M6Q31cjSQAcEf9KquJUnAjgGPOv6T0Q5HKoIXoL2fEVqCb2JJFxAjX+leWJon2q9V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sIz4iHl3v5pLx4rzTJvWHmk9kDeqYOEj/82ntJrYOveu3WirIKwgeQhKKjeGLKU5uczbhln/q2mpiMVQv52Uww0Z3c57d3s5GkhUydyyq1yBjK4mqfxAVnLvBd5h5PcnJz46wsL6RzYz32yNb8EZZHTeqm/tknlMs05T4qYsUTG/Rkmrf15WtUT10Kh/lPg== 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: Now KEXEC_CORE_NOTE_NAME is only used at one place and it does not seem to provide any value anymore. Replace the remaining usage with the literal and remove the macro. Signed-off-by: Akihiko Odaki --- arch/s390/kernel/crash_dump.c | 2 +- include/linux/kexec.h | 2 -- include/linux/vmcore_info.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c index cd0c93a8fb8b..4a9817489e35 100644 --- a/arch/s390/kernel/crash_dump.c +++ b/arch/s390/kernel/crash_dump.c @@ -253,7 +253,7 @@ static const char *nt_name(Elf64_Word type) const char *name = "LINUX"; if (type == NT_PRPSINFO || type == NT_PRSTATUS || type == NT_PRFPREG) - name = KEXEC_CORE_NOTE_NAME; + name = "CORE"; return name; } diff --git a/include/linux/kexec.h b/include/linux/kexec.h index f0e9f8eda7a3..c840431eadda 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -68,8 +68,6 @@ extern note_buf_t __percpu *crash_notes; #define KEXEC_CRASH_MEM_ALIGN PAGE_SIZE #endif -#define KEXEC_CORE_NOTE_NAME CRASH_CORE_NOTE_NAME - /* * This structure is used to hold the arguments that are used when loading * kernel binaries. diff --git a/include/linux/vmcore_info.h b/include/linux/vmcore_info.h index 1672801fd98c..37e003ae5262 100644 --- a/include/linux/vmcore_info.h +++ b/include/linux/vmcore_info.h @@ -6,7 +6,6 @@ #include #include -#define CRASH_CORE_NOTE_NAME "CORE" #define CRASH_CORE_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) #define CRASH_CORE_NOTE_NAME_BYTES ALIGN(sizeof(NN_PRSTATUS), 4) #define CRASH_CORE_NOTE_DESC_BYTES ALIGN(sizeof(struct elf_prstatus), 4)