+
+#ifdef KERNEL
+ /* scrub kernel pointers */
+ if (doprnt_hide_pointers &&
+ ctype == OS_LOG_BUFFER_VALUE_TYPE_SCALAR &&
+ arg_len >= sizeof(void *)) {
+ unsigned long long value = 0;
+ memcpy(&value, arg, arg_len);
+
+#if __has_feature(ptrauth_calls)
+ /**
+ * Strip out the pointer authentication code before
+ * checking whether the pointer is a kernel address.
+ */
+ value = (unsigned long long)VM_KERNEL_STRIP_PTR(value);
+#endif /* __has_feature(ptrauth_calls) */
+
+ if (value >= VM_MIN_KERNEL_AND_KEXT_ADDRESS && value <= VM_MAX_KERNEL_ADDRESS) {
+ is_private = true;
+ bzero(arg, arg_len);
+ }
+ }
+#endif
+