Page MenuHomeFreeBSD

Add explicit buffer bounds check and fix some functions
AbandonedPublic

Authored by markj on Jun 13 2025, 6:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 24, 4:58 PM
Unknown Object (File)
Oct 28 2025, 5:22 AM
Unknown Object (File)
Oct 28 2025, 5:22 AM
Unknown Object (File)
Oct 25 2025, 9:32 AM
Unknown Object (File)
Oct 20 2025, 2:41 AM
Unknown Object (File)
Oct 20 2025, 2:41 AM
Unknown Object (File)
Oct 19 2025, 12:18 PM
Unknown Object (File)
Oct 13 2025, 12:09 PM
Subscribers

Details

Summary

This change adds explicit buffer bounds checks to functions that write strings into buffers, replacing unsafe operations such as strcpy with safer alternatives using size checks and std::copy. It also ensures section and segment names do not overflow their target fields and adds error handling for negative offsets. These changes address potential buffer overflow vulnerabilities and make the code robust against out-of-bounds memory access.

Test Plan

Run static analyzers (such as Snyk ,and my hands)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This isn't the right place to submit changes to llvm. This copy of llvm is imported from https://github.com/llvm/llvm-project and changes should be proposed there.

markj abandoned this revision.
markj added a reviewer: uncleruc2075_gmail.com.