diff options
author | Jani Nikula <jani.nikula@intel.com> | 2025-03-27 14:47:39 +0200 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2025-04-07 11:00:08 +0300 |
commit | 2e43ae7dd71cd9bb0d1bce1d3306bf77523feb81 (patch) | |
tree | ab30ef8daa76df76628ebea733c6e1904710c371 /scripts/generate_rust_analyzer.py | |
parent | 9d3d9776bd3bd9c32d460dfe6c3363134de578bc (diff) | |
download | linux-2e43ae7dd71cd9bb0d1bce1d3306bf77523feb81.tar.gz linux-2e43ae7dd71cd9bb0d1bce1d3306bf77523feb81.tar.bz2 linux-2e43ae7dd71cd9bb0d1bce1d3306bf77523feb81.zip |
drm/i915/gvt: fix unterminated-string-initialization warning
Initializing const char opregion_signature[16] = OPREGION_SIGNATURE
(which is "IntelGraphicsMem") drops the NUL termination of the
string. This is intentional, but the compiler doesn't know this.
Switch to initializing header->signature directly from the string
litaral, with sizeof destination rather than source. We don't treat the
signature as a string other than for initialization; it's really just a
blob of binary data.
Add a static assert for good measure to cross-check the sizes.
Reported-by: Kees Cook <kees@kernel.org>
Closes: https://lore.kernel.org/r/20250310222355.work.417-kees@kernel.org
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13934
Tested-by: Nicolas Chauvet <kwizart@gmail.com>
Tested-by: Damian Tometzki <damian@riscv-rocks.de>
Cc: stable@vger.kernel.org
Reviewed-by: Zhenyu Wang <zhenyuw.linux@gmail.com>
Link: https://lore.kernel.org/r/20250327124739.2609656-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
(cherry picked from commit 4f8207469094bd04aad952258ceb9ff4c77b6bfa)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions