aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2026-08-20 10:37:44 +0000
committerBrooks Davis <brooks@FreeBSD.org>2026-08-20 10:38:19 +0000
commit2f024a7cfddd5ce92df8437d89ba5bc3d55dacaf (patch)
treea1add229633783ed1de98d1b0d1cd9af680a12ba /lib/CodeGen
parentd58ca841529c29fec4df90fc0cb93cc427f4f65d (diff)
exterr: relax format restrictions
Rather than passing the format string to printf and forcing the arguments to be (u)intmax_t, partially parse format strings and cast p1 and p2 to the correct type before running the individual format though printf. This restructure has a couple motivatations: - We can skip formats that make no sense (floating point, %n, etc.). - It is possible to special case the printing of pointers in the CHERI case. The first case is motivated by a suggestion from the audiance at one of Kirk's BSDCan talks on exterr to allow userspace to set exterr status. Allowing arbitrary format strings including %n creates a write-what-where gadget so we need to not do that. The second case is motivated by our experinces with CHERI and debugging mmap issues using a different textual error reporting framework. With CHERI, pointers are more than integer addresses and it's useful to include more details. Doing so will follow in a future commit. When the new code encounters an inappropriate format it includes a diagnostic and in most cases prints the format untouched. Reviewed by: kib Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D58058
Diffstat (limited to 'lib/CodeGen')
0 files changed, 0 insertions, 0 deletions