Commit 625426633d7786f26a33123a9d12bec476bcc3cd
Committed by
Herbert Xu
1 parent
e3b4f515c4
Exists in
master
and in
38 other branches
crypto: gf128mul - fix call to memset()
In gf128mul_lle() and gf128mul_bbe() r isn't completely initialized with zero because the size argument passed to memset() is the size of the pointer, not the structure it points to. Luckily there are no in-kernel users of those functions so the ABI change implied by this fix should break no existing code. Based on a patch by the PaX Team. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: PaX Team <pageexec@freemail.hu> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
crypto/gf128mul.c
... | ... | @@ -182,7 +182,7 @@ |
182 | 182 | for (i = 0; i < 7; ++i) |
183 | 183 | gf128mul_x_lle(&p[i + 1], &p[i]); |
184 | 184 | |
185 | - memset(r, 0, sizeof(r)); | |
185 | + memset(r, 0, sizeof(*r)); | |
186 | 186 | for (i = 0;;) { |
187 | 187 | u8 ch = ((u8 *)b)[15 - i]; |
188 | 188 | |
... | ... | @@ -220,7 +220,7 @@ |
220 | 220 | for (i = 0; i < 7; ++i) |
221 | 221 | gf128mul_x_bbe(&p[i + 1], &p[i]); |
222 | 222 | |
223 | - memset(r, 0, sizeof(r)); | |
223 | + memset(r, 0, sizeof(*r)); | |
224 | 224 | for (i = 0;;) { |
225 | 225 | u8 ch = ((u8 *)b)[i]; |
226 | 226 |