summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/roff.c
diff options
context:
space:
mode:
authoranton <anton@openbsd.org>2018-12-12 07:29:38 +0000
committeranton <anton@openbsd.org>2018-12-12 07:29:38 +0000
commit4b7fdf2943a3ff6737b066ebf7dee324310fefb5 (patch)
tree044d9340a1d5211daf07f68ae2eb07481e2b1baa /usr.bin/mandoc/roff.c
parentallow ethernet interfaces to provide a custom if_output routine. (diff)
downloadwireguard-openbsd-4b7fdf2943a3ff6737b066ebf7dee324310fefb5.tar.xz
wireguard-openbsd-4b7fdf2943a3ff6737b066ebf7dee324310fefb5.zip
Make kcov MP-safe. Calling the injected tracing function
__sanitizer_cov_trace_pc() early in the boot process caused a subtle crash while booting the secondary CPU(s). On amd64, accessing curcpu during this period is not safe since its GSBASE register is yet not written. After the CPU has been booted curproc can also be NULL for a brief period of time before the idle thread tied to the same CPU has started. The two problems can simply be avoided by postponing access to curcpu and curproc until /dev/kcov has been opened at least once. The end goal here is to allow fuzzing of MP kernels, which already is in full swing. This work has gone through many iterations before settling on the least intrusive change; many thanks for visa@ for reviewing and providing valuable input. Issue originally reported by Greg Steuck on tech@ who also took the time to test all iterations and providing me access to a virtualised OpenBSD machine for easier testing. ok mpi@ visa@
Diffstat (limited to 'usr.bin/mandoc/roff.c')
0 files changed, 0 insertions, 0 deletions