On Tue, 8 Sept 2026 at 20:09, Brian Cain <[email protected]> wrote: > > > On 9/8/2026 12:40 PM, Peter Maydell wrote: > > On Sun, 6 Sept 2026 at 23:25, Brian Cain <[email protected]> > > wrote: > >> HEX_SYS_OPEN copied guest bytes into a fixed-size buffer until it found a > >> NUL. > >> A missing terminator could overrun that buffer, so use lock_user_string() > >> instead. > > Do you have a link to the specification for these hexagon semihosting > > calls? Looking at this patch I'm wondering if maybe I steered you > > a bit wrong with suggesting lock_user_string(): > > > Here's the link - > https://docs.qualcomm.com/doc/80-N2040-101/topic/semihosting-specification.html
Thanks. It looks like it's rather inconsistent about how to pass filename strings, so for instance: * SYS_OPEN requires that the string is NUL terminated and also that the caller passes its length * SYS_REMOVE requires string + length but doesn't say it has to be NUL terminated * SYS_ACCESS requires a NUL terminated string and the caller does not pass the length Where the ABI gives us a length I guess we might as well use it plus lock_user() (that's more efficient as we don't need to do the "scan to find the NUL byte" part first). Patches 2 and 3 in this series are probably OK as those calls don't give us a length. I'll review those later, hopefully. -- PMM
