[PATCH v2 1/2] arm64: add tag_mask machdep option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Raw ramdumps without vmcoreinfo does not work currently
with pointer authentication enabled. The arm capability
array can be queried but that creates a dependency on
the bits identifying the capabilities. Add a machdep
option instead to mask the tags when PAC is enabled.

Signed-off-by: Vinayak Menon <vinayakm.list@xxxxxxxxx>
---
 arm64.c | 20 +++++++++++++++-----
 crash.8 |  1 +
 defs.h  |  1 +
 help.c  |  1 +
 4 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/arm64.c b/arm64.c
index 37aed07..5b59972 100644
--- a/arm64.c
+++ b/arm64.c
@@ -763,6 +763,8 @@ arm64_parse_machdep_arg_l(char *argstring, char *param, ulong *value)
 			*value = dtol(p, flags, &err);
 		} else if (STRNEQ(argstring, "vabits_actual")) {
 			*value = dtol(p, flags, &err);
+		} else if (STRNEQ(argstring, "tag_mask")) {
+			*value = htol(p, flags, &err);
 		} else if (megabytes) {
 			*value = dtol(p, flags, &err);
 			if (!err)
@@ -796,7 +798,6 @@ arm64_parse_cmdline_args(void)
 	for (index = 0; index < MAX_MACHDEP_ARGS; index++) {
 		if (!machdep->cmdline_args[index])
 			break;
-
 		if (!strstr(machdep->cmdline_args[index], "=")) {
 			error(WARNING, "ignoring --machdep option: %x\n",
 				machdep->cmdline_args[index]);
@@ -838,6 +839,12 @@ arm64_parse_cmdline_args(void)
 					"setting vabits_actual to: %ld\n\n",
 					machdep->machspec->VA_BITS_ACTUAL);
 				continue;
+			} else if (arm64_parse_machdep_arg_l(arglist[i], "tag_mask",
+			        &machdep->machspec->tag_mask)) {
+				error(NOTE,
+					"setting tag_mask to: %lx\n\n",
+					machdep->machspec->tag_mask);
+				continue;
 			}
 
 			error(WARNING, "ignoring --machdep option: %s\n",
@@ -4124,16 +4131,19 @@ arm64_swp_offset(ulong pte)
 
 static void arm64_calc_KERNELPACMASK(void)
 {
-	ulong value;
+	ulong value = 0;
 	char *string;
 
 	if ((string = pc->read_vmcoreinfo("NUMBER(KERNELPACMASK)"))) {
 		value = htol(string, QUIET, NULL);
 		free(string);
-		machdep->machspec->CONFIG_ARM64_KERNELPACMASK = value;
-		if (CRASHDEBUG(1))
-			fprintf(fp, "CONFIG_ARM64_KERNELPACMASK: %lx\n", value);
+	} else if (machdep->machspec->tag_mask) {
+		value = machdep->machspec->tag_mask;
 	}
+
+	machdep->machspec->CONFIG_ARM64_KERNELPACMASK = value;
+	if (CRASHDEBUG(1))
+		fprintf(fp, "CONFIG_ARM64_KERNELPACMASK: %lx\n", value);
 }
 
 #endif  /* ARM64 */
diff --git a/crash.8 b/crash.8
index 5020ce1..de32bdb 100644
--- a/crash.8
+++ b/crash.8
@@ -289,6 +289,7 @@ ARM64:
   kimage_voffset=<kimage_voffset-value>
   max_physmem_bits=<value>
   vabits_actual=<value>
+  tag_mask=<value>
 X86:
   page_offset=<CONFIG_PAGE_OFFSET-value>
 .fi
diff --git a/defs.h b/defs.h
index 35b983a..d406f5f 100644
--- a/defs.h
+++ b/defs.h
@@ -3331,6 +3331,7 @@ struct machine_specific {
 	ulong VA_START;
 	ulong CONFIG_ARM64_KERNELPACMASK;
 	ulong physvirt_offset;
+	ulong tag_mask;
 };
 
 struct arm64_stackframe {
diff --git a/help.c b/help.c
index 531f50a..7f619d5 100644
--- a/help.c
+++ b/help.c
@@ -182,6 +182,7 @@ char *program_usage_info[] = {
     "      kimage_voffset=<kimage_voffset-value>",
     "      max_physmem_bits=<value>",
     "      vabits_actual=<value>",
+    "      tag_mask=<value>",
     "    X86:",
     "      page_offset=<CONFIG_PAGE_OFFSET-value>",
     "",

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux