aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/lpt_commit.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-09-07 08:36:39 -0400
committerRichard Weinberger <richard@nod.at>2018-10-23 07:48:47 -0400
commita1dc58140f7e63e3b23050eb43b4e5581cb28c88 (patch)
treeff4e138d447d33dfe7a7a0bdf2ac67fe3c62a141 /fs/ubifs/lpt_commit.c
parentda8ef65f9573952c717d86f8f501773daf29bd10 (diff)
ubifs: authentication: Authenticate LPT
The LPT needs to be authenticated aswell. Since the LPT is only written during commit it is enough to authenticate the whole LPT with a single hash which is stored in the master node. Only the leaf nodes (pnodes) are hashed which makes the implementation much simpler than it would be to hash the complete LPT. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/lpt_commit.c')
-rw-r--r--fs/ubifs/lpt_commit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c
index 62d6a87d4f5d..1f88caffdf2a 100644
--- a/fs/ubifs/lpt_commit.c
+++ b/fs/ubifs/lpt_commit.c
@@ -1247,6 +1247,10 @@ int ubifs_lpt_start_commit(struct ubifs_info *c)
1247 if (err) 1247 if (err)
1248 goto out; 1248 goto out;
1249 1249
1250 err = ubifs_lpt_calc_hash(c, c->mst_node->hash_lpt);
1251 if (err)
1252 goto out;
1253
1250 /* Copy the LPT's own lprops for end commit to write */ 1254 /* Copy the LPT's own lprops for end commit to write */
1251 memcpy(c->ltab_cmt, c->ltab, 1255 memcpy(c->ltab_cmt, c->ltab,
1252 sizeof(struct ubifs_lpt_lprops) * c->lpt_lebs); 1256 sizeof(struct ubifs_lpt_lprops) * c->lpt_lebs);