CSan issues in sys_execve()

Alexander Nasonov <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <Z1ckth1TxoOpE1Jb@nebeda>
I already reported one CSan issue on NetBSD 10, here is the second one.

At first, I compiled the kernel with a different sanitizer (KASAN)
and I noticed that it reports a problem in elf64_copyargs if I run

./build.sh -j 40 release (plus other flags)

I since switched to KCSAN and it also reports potential issues but more
frequently, it triggers even if I run ./build.sh -j 16 cleandir:

CSan: Racy Access [Cpu0 Write Addr=0xffffbaa110270000 Size=262144 PC=0xffffffff80d2ce10<execve_loadvm>] [Cpu2 Read Addr=0xffffbaa110230071 Size=262144 PC=0xffffffff80d2e09c<copyargs>]
#0 0xffffffff80d6ea6d in kcsan_copyinstr <netbsd>
#1 0xffffffff80d2ce10 in execve_loadvm <netbsd>
#2 0xffffffff80d2c701 in sys_execve <netbsd>
#3 0xffffffff8059a193 in syscall <netbsd>
CSan: Racy Access [Cpu0 Read Addr=0xffffbaa110230011 Size=262144 PC=0xffffffff80d2e09c<copyargs>] [Cpu1 Write Addr=0xffffbaa11027000f Size=262129 PC=0xffffffff80d2d0f0<execve_loadvm>]
#0 0xffffffff80d6eab7 in kcsan_copyoutstr <netbsd>
#1 0xffffffff80d2e09c in copyargs <netbsd>
#2 0xffffffff80d18708 in elf64_copyargs <netbsd>
#3 0xffffffff80d2d8cf in execve_runproc <netbsd>
#4 0xffffffff80d2c71c in sys_execve <netbsd>
#5 0xffffffff8059a193 in syscall <netbsd>

--
Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.