]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
UBIFS: do not write rubbish into truncation scanning node
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sun, 8 Aug 2010 09:32:00 +0000 (12:32 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 30 Aug 2010 07:19:08 +0000 (10:19 +0300)
In the scanning code, in 'ubifs_add_snod()', we write rubbish into
'snod->key', because we assume that on-flash truncation nodes have a key, but
they do not. If the other parts of UBIFS then mistakenly try to look-up
the truncation node key (they should not do this, but may do because of a bug),
we can succeed and corrupt TNC. It looks like we did have such a situation in
'sort_nodes()' in gc.c.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
fs/ubifs/scan.c

index 96c525384191d91af6ce99c700295dc78cb744cf..a0a305ca61aff805593183f7429ae868a5574e63 100644 (file)
@@ -212,7 +212,6 @@ int ubifs_add_snod(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
        case UBIFS_DENT_NODE:
        case UBIFS_XENT_NODE:
        case UBIFS_DATA_NODE:
-       case UBIFS_TRUN_NODE:
                /*
                 * The key is in the same place in all keyed
                 * nodes.