erasure_code: check for size in gf_Xvect_mad_avx512_gfni

Length of data was not checked in implementation with AVX512+GFNI,
at the start of the gf_Xvect_mad_avx512_gfni functions, resulting
in buffer overflow if length was less than 64 bytes.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
Pablo de Lara 2023-12-15 15:18:33 +00:00 committed by Tomasz Kantecki
parent c06db0c60a
commit abd80d3c5a
6 changed files with 12 additions and 0 deletions

View File

@ -158,6 +158,8 @@ func(gf_2vect_mad_avx512_gfni)
mov dest2, [dest1 + 8] ; reuse mul_array
mov dest1, [dest1]
cmp len, 64
jl .len_lt_64
.loop64:
ENCODE_64B_2

View File

@ -173,6 +173,8 @@ func(gf_3vect_mad_avx512_gfni)
mov dest3, [dest1 + 2*8] ; reuse vec
mov dest1, [dest1]
cmp len, 64
jl .len_lt_64
.loop64:
ENCODE_64B_3

View File

@ -192,6 +192,8 @@ func(gf_4vect_mad_avx512_gfni)
mov dest4, [dest1 + 3*8] ; reuse vec_i
mov dest1, [dest1]
cmp len, 64
jl .len_lt_64
.loop64:
ENCODE_64B_4

View File

@ -209,6 +209,8 @@ func(gf_5vect_mad_avx512_gfni)
mov dest5, [dest1 + 4*8] ; reuse vec_i
mov dest1, [dest1]
cmp len, 64
jl .len_lt_64
.loop64:
ENCODE_64B_5

View File

@ -228,6 +228,8 @@ func(gf_6vect_mad_avx512_gfni)
mov dest6, [dest1 + 5*8] ; reuse vec_i
mov dest1, [dest1]
cmp len, 64
jl .len_lt_64
.loop64:
ENCODE_64B_6

View File

@ -144,6 +144,8 @@ func(gf_vect_mad_avx512_gfni)
vbroadcastf32x2 xgft1, [vec_i + mul_array]
cmp len, 64
jl .len_lt_64
.loop64:
ENCODE_64B