NetBSD-Bugs archive

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

kern/58225: netbsd9/amd64 requires COMPAT_16 for 32bit support



>Number:         58225
>Category:       kern
>Synopsis:       netbsd9/amd64 requires COMPAT_16 for 32bit support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 05 08:00:00 +0000 2024
>Originator:     Michael van Elst
>Release:        NetBSD 10.99.10
>Organization:
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."
>Environment:
	
	
System: NetBSD tazz 10.99.10 NetBSD 10.99.10 (TAZZ) #401: Sun May 5 05:55:10 UTC 2024 mlelstv@slowpoke:/scratch2/obj.amd64/scratch/netbsd-current/src/sys/arch/amd64/compile/TAZZ amd64
Architecture: x86_64
Machine: amd64
>Description:

You can run 32bit NetBSD binaries on amd64 by using a kernel that is built
with COMPAT_NETBSD32 (like GENERIC). But for binaries from netbsd-9 or older,
this relies on the compat_netbsd32_16 module to be present to handle the
old signal context.

When you run a kernel without the older COMPAT options, you don't expect older
compat modules to be loaded. If you use a !INSECURE kernel, autoloading the
modules will also fail, leading to strange failures (e.g.  python3.1.2 failing
to build).

Modules loaded because of compat_netbsd32_16 requirement.

compat_100               exec     filesys  a        2       - -
compat_16                exec     filesys  a        1       - compat_20
compat_20                exec     filesys  a        2       - compat_30
compat_30                exec     filesys  a        2       - compat_util,compat_40
compat_40                exec     filesys  a        2       - compat_50
compat_50                exec     filesys  a        2       - compat_60
compat_60                exec     filesys  a        2       - compat_70
compat_70                exec     filesys  a        1       - compat_80
compat_80                exec     filesys  a        2       - compat_90
compat_90                exec     filesys  a        2       - compat_100
compat_netbsd32          exec     builtin  -        7       - ksem,compat_util,exec_elf32
compat_netbsd32_100      exec     filesys  a        1       - compat_netbsd32,compat_100
compat_netbsd32_16       exec     filesys  -        0       - compat_netbsd32_20,compat_16
compat_netbsd32_20       exec     filesys  a        1       - compat_netbsd32_30,compat_20
compat_netbsd32_30       exec     filesys  a        1       - compat_netbsd32_40,compat_30
compat_netbsd32_40       exec     filesys  a        1       - compat_netbsd32_50,compat_40
compat_netbsd32_50       exec     filesys  a        1       - compat_netbsd32_60,compat_50
compat_netbsd32_60       exec     filesys  a        1       - compat_netbsd32_80,compat_60
compat_netbsd32_80       exec     filesys  a        1       - compat_netbsd32_90,compat_80
compat_netbsd32_90       exec     filesys  a        1       - compat_netbsd32_100,compat_90

Modules built in because of COMPAT_NETBSD32:

compat_netbsd32_coredump misc     builtin  -        0       - compat_netbsd32,compat_netbsd32_ptrace,coredump
compat_netbsd32_mqueue   exec     builtin  -        0       - mqueue,compat_netbsd32
compat_netbsd32_nfssrv   exec     builtin  -        0       - nfsserver,compat_netbsd32
compat_netbsd32_ptrace   exec     builtin  -        1       - compat_netbsd32,ptrace_common
compat_netbsd32_quota    exec     builtin  -        0       - compat_netbsd32
compat_netbsd32_sysvipc  exec     builtin  -        0       - compat_netbsd32,sysv_ipc
compat_util              misc     builtin  -        2       - -


Option COMPAT_90 should be sufficient to build a kernel that supports netbsd-9
binaries, including 32bit ones. It shouldn't silently include alsmost all
old compat code.

>How-To-Repeat:

Run netbsd-9/i386 binaries on a amd64 system (-10 or -current) without COMPAT_16.

>Fix:
	

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index