]> git.baikalelectronics.ru Git - kernel.git/commit
ubifs: fix wrong use of crypto_shash_descsize()
authorEric Biggers <ebiggers@google.com>
Sat, 2 May 2020 05:59:45 +0000 (22:59 -0700)
committerRichard Weinberger <richard@nod.at>
Sun, 17 May 2020 21:38:21 +0000 (23:38 +0200)
commit059a2e15aace06d0cddd849102e1c05c5aa5a4d0
tree3b583262ab16a8e771d2f6aaa724547242515e5a
parent7e5123f859ccdb80df529baae7d61b09c95a250b
ubifs: fix wrong use of crypto_shash_descsize()

crypto_shash_descsize() returns the size of the shash_desc context
needed to compute the hash, not the size of the hash itself.

crypto_shash_digestsize() would be correct, or alternatively using
c->hash_len and c->hmac_desc_len which already store the correct values.
But actually it's simpler to just use stack arrays, so do that instead.

Fixes: dfd8145e8a65 ("ubifs: Add helper functions for authentication support")
Fixes: e3bc325e356e ("ubifs: Authenticate replayed journal")
Cc: <stable@vger.kernel.org> # v4.20+
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/auth.c
fs/ubifs/replay.c