mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
ubifs: Fix build errors as symbol undefined
[ Upstream commitaa6d148e6d
] With CONFIG_UBIFS_FS_AUTHENTICATION not set, the compiler can assume that ubifs_node_check_hash() is never true and drops the call to ubifs_bad_hash(). Is CONFIG_CC_OPTIMIZE_FOR_SIZE enabled this optimization does not happen anymore. So When CONFIG_UBIFS_FS and CONFIG_CC_OPTIMIZE_FOR_SIZE is enabled but CONFIG_UBIFS_FS_AUTHENTICATION is not set, the build errors is as followd: ERROR: modpost: "ubifs_bad_hash" [fs/ubifs/ubifs.ko] undefined! Fix it by add no-op ubifs_bad_hash() for the CONFIG_UBIFS_FS_AUTHENTICATION=n case. Fixes:16a26b20d2
("ubifs: authentication: Add hashes to index nodes") Signed-off-by: Li Hua <hucool.lihua@huawei.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
61aeba0e4b
commit
7508453ede
1 changed files with 5 additions and 0 deletions
|
@ -1623,8 +1623,13 @@ static inline int ubifs_check_hmac(const struct ubifs_info *c,
|
|||
return crypto_memneq(expected, got, c->hmac_desc_len);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_UBIFS_FS_AUTHENTICATION
|
||||
void ubifs_bad_hash(const struct ubifs_info *c, const void *node,
|
||||
const u8 *hash, int lnum, int offs);
|
||||
#else
|
||||
static inline void ubifs_bad_hash(const struct ubifs_info *c, const void *node,
|
||||
const u8 *hash, int lnum, int offs) {};
|
||||
#endif
|
||||
|
||||
int __ubifs_node_check_hash(const struct ubifs_info *c, const void *buf,
|
||||
const u8 *expected);
|
||||
|
|
Loading…
Reference in a new issue