In of_modalias(), if the buffer happens to be too small even for the 1st snprintf() call, the len parameter will become negative and str parameter
(if not NULL initially) will point beyond the buffer's end. Add the buffer overflow check after the 1st snprintf() call and fix such check after the strlen() call (accounting for the terminating NUL char).
Fixes: bc575064d688 ("of/device: use of_property_for_each_string to parse compatible strings")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/bbfc6be0-c687-62b6-d015-5141b93f313e@omp.ru Signed-off-by: Rob Herring <robh@kernel.org>
Source: linux
Version: 6.1.133-1
Severity: normal
X-Debbugs-Cc: henrich@debian.org
Dear Maintainers,
I've investigated CVE-2024-38541 since I'm running Debian 12 instances
on AWS and Amazon Inspector alerts it is critical vuln.
It seems that it is easily applied to 6.1 branch with some modification
as attached patch. I've already sent it to original author and reviewer
but not get any reply, so I'm maybe wrong...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 480 |
Nodes: | 16 (2 / 14) |
Uptime: | 02:37:32 |
Calls: | 9,535 |
Calls today: | 3 |
Files: | 13,651 |
Messages: | 6,138,416 |
Posted today: | 1 |