diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2025-11-27 15:01:57 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-02-16 10:18:43 +0100 |
| commit | c77b33b58512708bd5603f48465f018c8b748847 (patch) | |
| tree | 8e43f95cd6d38df5c8bb5fa3d5b1913e162e48ac /include/net/aligned_data.h | |
| parent | 52b6e7417ff762d042d4a05dc6d418b153f8ab4a (diff) | |
crypto: iaa - Fix out-of-bounds index in find_empty_iaa_compression_mode
commit 48329301969f6d21b2ef35f678e40f72b59eac94 upstream.
The local variable 'i' is initialized with -EINVAL, but the for loop
immediately overwrites it and -EINVAL is never returned.
If no empty compression mode can be found, the function would return the
out-of-bounds index IAA_COMP_MODES_MAX, which would cause an invalid
array access in add_iaa_compression_mode().
Fix both issues by returning either a valid index or -EINVAL.
Cc: stable@vger.kernel.org
Fixes: b190447e0fa3 ("crypto: iaa - Add compression mode management along with fixed mode")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/net/aligned_data.h')
0 files changed, 0 insertions, 0 deletions
