diff options
author | Andrew Lutomirski <luto@kernel.org> | 2017-01-10 23:24:46 (GMT) |
---|---|---|
committer | Xie Xiaobo <xiaobo.xie@nxp.com> | 2017-09-25 07:25:35 (GMT) |
commit | 349c6bf47968fcb0fde0379d1b683f5ac75e3cfb (patch) | |
tree | 57a18702eff2e6a162b105ace5614615dc1c124f /fs/nsfs.c | |
parent | 2a1064d1c74e3a394f6fbbb6096c2f5e434c46e4 (diff) | |
download | linux-349c6bf47968fcb0fde0379d1b683f5ac75e3cfb.tar.xz |
crypto: testmgr - Allocate only the required output size for hash tests
There are some hashes (e.g. sha224) that have some internal trickery
to make sure that only the correct number of output bytes are
generated. If something goes wrong, they could potentially overrun
the output buffer.
Make the test more robust by allocating only enough space for the
correct output size so that memory debugging will catch the error if
the output is overrun.
Tested by intentionally breaking sha224 to output all 256
internally-generated bits while running on KASAN.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'fs/nsfs.c')
0 files changed, 0 insertions, 0 deletions