ubifs: Authenticate replayed journal
authorSascha Hauer <s.hauer@pengutronix.de>
Fri, 7 Sep 2018 12:36:38 +0000 (14:36 +0200)
committerRichard Weinberger <richard@nod.at>
Tue, 23 Oct 2018 11:48:40 +0000 (13:48 +0200)
commitda8ef65f9573952c717d86f8f501773daf29bd10
treeebe8f65efa5e149eca12d592b6aa1591bfddeb17
parent6f06d96fdf624be3e1d65c6100704a1fd79a30b7
ubifs: Authenticate replayed journal

Make sure that during replay all buds can be authenticated. To do
this we calculate the hash chain until we find an authentication
node and check the HMAC in that node against the current status
of the hash chain.

After a power cut it can happen that some nodes have been written, but
not yet the authentication node for them. These nodes have to be
discarded during replay.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/replay.c