diff options
| author | Florian Schmaus <florian.schmaus@codasip.com> | 2025-10-17 11:28:14 +0200 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2025-10-20 13:08:05 -0600 |
| commit | 2551a1eedc09f5a86f94b038dc1bb16855c256f1 (patch) | |
| tree | fa67b05a40179ada731665aa0effa0df87af4fc4 /tools/docs/parse-headers.py | |
| parent | 3a8660878839faadb4f1a6dd72c3179c1df56787 (diff) | |
kunit: test_dev_action: Correctly cast 'priv' pointer to long*
The previous implementation incorrectly assumed the original type of
'priv' was void**, leading to an unnecessary and misleading
cast. Correct the cast of the 'priv' pointer in test_dev_action() to
its actual type, long*, removing an unnecessary cast.
As an additional benefit, this fixes an out-of-bounds CHERI fault on
hardware with architectural capabilities. The original implementation
tried to store a capability-sized pointer using the priv
pointer. However, the priv pointer's capability only granted access to
the memory region of its original long type, leading to a bounds
violation since the size of a long is smaller than the size of a
capability. This change ensures that the pointer usage respects the
capabilities' bounds.
Link: https://lore.kernel.org/r/20251017092814.80022-1-florian.schmaus@codasip.com
Fixes: d03c720e03bd ("kunit: Add APIs for managing devices")
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Florian Schmaus <florian.schmaus@codasip.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/docs/parse-headers.py')
0 files changed, 0 insertions, 0 deletions
