]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ubifs: replay: Fix high stack usage, again
authorArnd Bergmann <arnd@arndb.de>
Thu, 14 Jan 2021 21:30:11 +0000 (22:30 +0100)
committerRichard Weinberger <richard@nod.at>
Fri, 12 Feb 2021 20:53:22 +0000 (21:53 +0100)
An earlier commit moved out some functions to not be inlined by gcc, but
after some other rework to remove one of those, clang started inlining
the other one and ran into the same problem as gcc did before:

fs/ubifs/replay.c:1174:5: error: stack frame size of 1152 bytes in function 'ubifs_replay_journal' [-Werror,-Wframe-larger-than=]

Mark the function as noinline_for_stack to ensure it doesn't happen
again.

Fixes: f80df3851246 ("ubifs: use crypto_shash_tfm_digest()")
Fixes: eb66eff6636d ("ubifs: replay: Fix high stack usage")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/replay.c

index 79801c9a5b8742432dbf9ed08c0353d1375bdeb5..0f8a6a16421b4a7db2ec84bd979f94cf75923eae 100644 (file)
@@ -559,7 +559,9 @@ static int is_last_bud(struct ubifs_info *c, struct ubifs_bud *bud)
 }
 
 /* authenticate_sleb_hash is split out for stack usage */
-static int authenticate_sleb_hash(struct ubifs_info *c, struct shash_desc *log_hash, u8 *hash)
+static int noinline_for_stack
+authenticate_sleb_hash(struct ubifs_info *c,
+                      struct shash_desc *log_hash, u8 *hash)
 {
        SHASH_DESC_ON_STACK(hash_desc, c->hash_tfm);