[PATCH v2 3/3] lockdown: Use snprintf in lockdown_read
dan.j.williams at intel.com
dan.j.williams at intel.com
Tue Aug 5 22:30:07 UTC 2025
Nikolay Borisov wrote:
> Since individual features are now locked down separately ensure that if
> the printing code is change to list them a buffer overrun won't be
> introduced. As per Serge's recommendation switch from using sprintf to
> using snprintf and return EINVAL in case longer than 80 char string hasi
> to be printed.
I would have expected this safety to come before patch1, but it also
feels like the maximum buffer size could be calculated at compile time
to make the maximum output always fit.
More information about the Linux-security-module-archive
mailing list