From 4acbf0ab74dd9a9d1b777ef58aaa7b6af67fe22d Mon Sep 17 00:00:00 2001 From: bluhm Date: Thu, 11 May 2023 09:51:33 +0000 Subject: [PATCH] mi_syscall() can add the KTRC_CODE_SYSCALL flag to the syscall code. In ktrsyscall() mask the code, otherwise kdump(1) does not show the correct mib of SYS_sysctl when called by syscall(2). OK guenther@ --- sys/kern/kern_ktrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 16860982808..528547a8ab3 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_ktrace.c,v 1.111 2023/02/16 08:50:57 claudio Exp $ */ +/* $OpenBSD: kern_ktrace.c,v 1.112 2023/05/11 09:51:33 bluhm Exp $ */ /* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */ /* @@ -160,7 +160,7 @@ ktrsyscall(struct proc *p, register_t code, size_t argsize, register_t args[]) u_int nargs = 0; int i; - if (code == SYS_sysctl) { + if ((code & KTRC_CODE_MASK) == SYS_sysctl) { /* * The sysctl encoding stores the mib[] * array because it is interesting. -- 2.20.1