summaryrefslogtreecommitdiff
path: root/doc/develop/bootstd/extlinux.rst
diff options
context:
space:
mode:
authorNaveen Kumar Chaudhary <[email protected]>2026-07-10 20:52:59 +0530
committerTom Rini <[email protected]>2026-07-23 15:15:59 -0600
commit0ccd0a939d7d20c5a754a88c52450533932851a1 (patch)
treeb350e1ec40c811e636ae8ad12e4adf6732f01e1d /doc/develop/bootstd/extlinux.rst
parent3c82b041f73fe804d9d464508ceb625a856a38a6 (diff)
cmd: pstore: bound path formatting with snprintf to avoid stack overflow
pstore_save() writes four different filenames into a fixed 256-byte stack buffer 'path' using sprintf() with "%s" fed from argv[3] (the user-supplied mount directory). The U-Boot command line buffer (CONFIG_SYS_CBSIZE) is typically 1024 or 2048 bytes, so a directory path in argv[3] can easily exceed 240 characters and overflow 'path', corrupting the surrounding stack frame including the return address. Replace the four sprintf(path, ...) call sites with snprintf() using sizeof(path) as the bound. The neighbouring sprintf() calls into the 'addr' and 'length' buffers are left as-is; they write fixed-width numeric conversions whose maximum length is bounded by the size of ulong/u32 in hex and cannot overflow those buffers. Signed-off-by: Naveen Kumar Chaudhary <[email protected]>
Diffstat (limited to 'doc/develop/bootstd/extlinux.rst')
0 files changed, 0 insertions, 0 deletions