Page MenuHomeFreeBSD

awk: Fix subobject out-of-bounds access
ClosedPublic

Authored by arichardson on Sep 21 2020, 2:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 16, 9:53 AM
Unknown Object (File)
Thu, Nov 6, 2:43 AM
Unknown Object (File)
Thu, Oct 30, 4:11 AM
Unknown Object (File)
Thu, Oct 30, 1:27 AM
Unknown Object (File)
Oct 16 2025, 5:17 AM
Unknown Object (File)
Oct 16 2025, 5:16 AM
Unknown Object (File)
Oct 15 2025, 6:08 PM
Unknown Object (File)
Oct 15 2025, 6:08 PM
Subscribers
None

Details

Summary

When matching a regex with ^, it would attempt to access
gototab[NSTATES][NCHARS+2], and therefore access the state for the \002
character instead. This change is required to run awk under CHERI (with
sub-object bounds) and when running with UBSAN instrumentation.

This was committed upstream as https://github.com/onetrueawk/awk/commit/cbf924342b63a095a4c6842280c3085b1b63ae45

Found by: CHERI (with subobject bounds enabled)
Obtained from: CheriBSD

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable