]> git.baikalelectronics.ru Git - kernel.git/commit
ubifs: Fail commit if TNC is obviously inconsistent
authorRichard Weinberger <richard@nod.at>
Wed, 7 Jun 2017 21:33:35 +0000 (23:33 +0200)
committerRichard Weinberger <richard@nod.at>
Fri, 14 Jul 2017 20:49:07 +0000 (22:49 +0200)
commitf33a073f1d078b32d258f71dd734edf4d63a8c4d
tree6d6eb0d66d61ef13a983aa0c1a3b26140fa0a4e9
parent3abaa0ddd16f0d468b1b1b0dee3fdb2126f2a6f4
ubifs: Fail commit if TNC is obviously inconsistent

A reference to LEB 0 or with length 0 in the TNC
is never correct and could be caused by a memory corruption.
Don't write such a bad index node to the MTD.
Instead fail the commit which will turn UBIFS into read-only mode.

This is less painful than having the bad reference on the MTD
from where UBFIS has no chance to recover.

Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/tnc_commit.c