NetBSD-Bugs archive

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

port-mips/56801: mount_udf's mount structure is malformed on 64 bit kernel with 32 bit userland



>Number:         56801
>Category:       port-mips
>Synopsis:       mount_udf's mount structure is malformed on 64 bit kernel with 32 bit userland
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-mips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 23 15:30:00 +0000 2022
>Originator:     Reinoud Zandijk
>Release:        NetBSD 9.99.96
>Organization:
NetBSD
	
>Environment:
	
	
System: NetBSD mipssim64.13thmonkey.org 9.99.96 NetBSD 9.99.96 (MIPSSIM64) #0: Sat Apr 23 16:53:36 CEST 2022  reinoud%gorilla.13thmonkey.org@localhost:/tmp/obj/sys/arch/evbmips/compile/MIPSSIM64 evbmips
Architecture: mips
Machine: evbmips

mipssim64# file /netbsd
/netbsd: ELF 64-bit MSB executable, MIPS, MIPS-III version 1 (SYSV), statically linked, for NetBSD 9.99.96, not stripped
mipssim64# file /sbin/mount_udf
/sbin/mount_udf: ELF 32-bit MSB pie executable, MIPS, N32 MIPS-III version 1 (SYSV), dynamically linked, interpreter /libexec/l
d.elf_so, for NetBSD 9.1, not stripped
mipssim64# ls -al /sbin/mount_udf
-r-xr-xr-x  1 root  wheel  14200 Oct 18  2020 /sbin/mount_udf
>Description:
When trying to mount an file image on the machine (in Qemu) using vnd it
reports an error. Peeking in with kgdb, it seems that the mount structure is
reported too short. The kernel reports a size of 80 and the userland a size of
72.

When printed in the mount_udf.c, the mount structure is userland is correct.
In the kernel its received/interpreted as the following struct which is
definatively wrong:

(gdb) print *args
$9 = {version = 1, fspec = 0x0, sessionnr = 0, udfmflags = 32767, gmtoff = 39, anon_uid = 32767, anon_gid = 39, 
  nobody_uid = 0, nobody_gid = 0, sector_size = 0, reserved = '\000' <repeats 31 times>, "H"}

>How-To-Repeat:
Start a 64 bit kernel in Qemu with a 32 bit userland and try to mount a disc
with mount_udf. It fails due to different lengths (in udf_mount in
udf_vfsops.c:315).

	
>Fix:
Most likely the structure is not converted correctly or not converted at all.
	

>Unformatted:
 	
 	



Home | Main Index | Thread Index | Old Index