mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
firmware: exynos-acpm: Count acpm_xfer buffers with __counted_by_ptr
Use __counted_by_ptr() attribute on the acpm_xfer buffers so UBSAN will validate runtime that we do not pass over the buffer size, thus making code safer. Usage of __counted_by_ptr() (or actually __counted_by()) requires that counter is initialized before counted array. Tested-by: Tudor Ambarus <tudor.ambarus@linaro.org> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260219-firmare-acpm-counted-v2-3-e1f7389237d3@oss.qualcomm.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
This commit is contained in:
committed by
Krzysztof Kozlowski
parent
00808ae2e6
commit
951b8eee05
@@ -25,12 +25,12 @@ static void acpm_dvfs_set_xfer(struct acpm_xfer *xfer, u32 *cmd, size_t cmdlen,
|
||||
unsigned int acpm_chan_id, bool response)
|
||||
{
|
||||
xfer->acpm_chan_id = acpm_chan_id;
|
||||
xfer->txd = cmd;
|
||||
xfer->txcnt = cmdlen;
|
||||
xfer->txd = cmd;
|
||||
|
||||
if (response) {
|
||||
xfer->rxd = cmd;
|
||||
xfer->rxcnt = cmdlen;
|
||||
xfer->rxd = cmd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user