Hello again,

On 2020/11/02 3:51, Paul Goyette wrote:
Module Name:    src
Committed By:   pgoyette
Date:           Sun Nov  1 18:51:03 UTC 2020

Modified Files:
        src/sys/compat/netbsd32: netbsd32.h netbsd32_core.c
        src/sys/kern: compat_stub.c files.kern kern_core.c kern_sig.c
        src/sys/modules: Makefile
        src/sys/modules/compat_netbsd32: Makefile
        src/sys/modules/coredump: Makefile
        src/sys/sys: compat_stub.h param.h signalvar.h
Added Files:
        src/sys/modules/compat_netbsd32_coredump: Makefile

Log Message:
Separate the compat_netbsd32_coredump from the compat_netbsd32 and
coredump modules, into its own module.

Welcome to 7.99.75 !!!

To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/netbsd32/netbsd32_core.c
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/files.kern
cvs rdiff -u -r1.33 -r1.34 src/sys/kern/kern_core.c
cvs rdiff -u -r1.394 -r1.395 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.88 -r1.89 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.247 -r1.248 src/sys/modules/Makefile
cvs rdiff -u -r1.35 -r1.36 src/sys/modules/compat_netbsd32/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/compat_netbsd32_coredump/Makefile
cvs rdiff -u -r1.7 -r1.8 src/sys/modules/coredump/Makefile
cvs rdiff -u -r1.24 -r1.25 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.677 -r1.678 src/sys/sys/param.h
cvs rdiff -u -r1.102 -r1.103 src/sys/sys/signalvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

This commit breaks arm, i.e., ILP32 arch with COMPAT_NETBSD32. For arm,
coredump_elf32_hook is already hooked in the main kernel. Therefore,
compat_netbsd32_coredump_modcmd(MODULE_CMD_INIT) causes KASSERT failure:

        panic: kernel diagnostic assertion "!*hooked" failed: file 
"../../../../kern/kern_module_hook.c", line 70

Does the attached patch seem reasonable to you?

Index: sys/compat/netbsd32/netbsd32_core.c
RCS file: /home/netbsd/src/sys/compat/netbsd32/netbsd32_core.c,v
retrieving revision 1.16
diff -p -u -r1.16 netbsd32_core.c
--- sys/compat/netbsd32/netbsd32_core.c 1 Nov 2020 18:51:02 -0000       1.16
+++ sys/compat/netbsd32/netbsd32_core.c 4 Nov 2020 06:52:52 -0000
@@ -68,11 +68,15 @@ compat_netbsd32_coredump_modcmd(modcmd_t
        switch (cmd) {
        case MODULE_CMD_INIT:
                MODULE_HOOK_SET(coredump_netbsd32_hook, real_coredump_netbsd32);
+#ifdef _LP64
                MODULE_HOOK_SET(coredump_elf32_hook, real_coredump_elf32);
                return 0;
        case MODULE_CMD_FINI:
+#ifdef _LP64
                return 0;
                return ENOTTY;

Reply via email to