CTSRD-CHERI / cheribsd

FreeBSD adapted for CHERI-RISC-V and Arm Morello.
http://cheribsd.org
Other
166 stars 60 forks source link

With c18n, git crashes with a tag violation when Ctrl-C is used #2062

Closed rwatson closed 7 months ago

rwatson commented 7 months ago

This is with the c18n-ubiq branch, and c18n enabled by default.

When I use git log on a large repo (e.g., CheriBSD), and hit Ctrl-C, I frequently get a crash:

commit 0209c8e659cd4abe4b99359312135137a228a164
Author: Mark Johnston <markjdb@gmail.com>
Date:   Fri Mar 8 23:26:27 2024 -0500

    caprevoke: Add a sysctl to set the default sync/async revocation policy

    Akin to other revocation policy sysctls, this one sets a flag which is
^C
In-address space security exception (core dumped)

This doesn’t appear to happen with c18n disabled. No debugging symbols, and limited GDB support for c18n, so not much to go on currently:

# gdb `which git` git.core 
GNU gdb (GDB) 12.1 [GDB v12.1.d20231213 for FreeBSD]
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-freebsd14.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/bin/git...
(No debugging symbols found in /usr/local/bin/git)
[New LWP 100220]
Core was generated by `git log'.
Program terminated with signal SIGPROT, CHERI protection violation.
Capability tag fault.
#0  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000040651f04 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
dpgao commented 7 months ago

Fixed in #2066.