]> git.baikalelectronics.ru Git - kernel.git/commit
ubifs: Rectify space budget for ubifs_symlink() if symlink is encrypted
authorZhihao Cheng <chengzhihao1@huawei.com>
Tue, 11 Oct 2022 03:47:27 +0000 (11:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:19 +0000 (13:55 +0100)
commite0d9e469e6a3a658d2cb080cc17b483862581c25
tree39c0046a170acfcbc43ee7f6a3d45c1100559f57
parent2a563876e88ddf1415f7496ce3c89864f4c73927
ubifs: Rectify space budget for ubifs_symlink() if symlink is encrypted

[ Upstream commit 44254cc72908a4de816e668c1579d9077245fe6d ]

Fix bad space budget when symlink file is encrypted. Bad space budget
may let make_reservation() return with -ENOSPC, which could turn ubifs
to read-only mode in do_writepage() process.

Fetch a reproducer in [Link].

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216490
Fixes: eeebf7b0eadbcb ("ubifs: Add support for encrypted symlinks")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ubifs/dir.c