diff options
author | ZhaoLong Wang <wangzhaolong1@huawei.com> | 2022-07-09 11:40:32 +0300 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2022-09-21 12:32:38 +0300 |
commit | 713346ca1db2bebd4c7c4d5ea364ed03d504f5ed (patch) | |
tree | 9c661e9a380866cee9ce1d1b2cf293f2f1041eb5 /fs/libfs.c | |
parent | 019ac05e4c97f51913318d9b0e2ffd34db917d3c (diff) | |
download | linux-713346ca1db2bebd4c7c4d5ea364ed03d504f5ed.tar.xz |
ubifs: Fix UBIFS ro fail due to truncate in the encrypted directory
The ubifs_compress() function does not compress the data When the
data length is short than 128 bytes or the compressed data length
is not ideal.It cause that the compressed length of the truncated
data in the truncate_data_node() function may be greater than the
length of the raw data read from the flash.
The above two lengths are transferred to the ubifs_encrypt()
function as parameters. This may lead to assertion fails and then
the file system becomes read-only.
This patch use the actual length of the data in the memory as the
input parameter for assert comparison, which avoids the problem.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216213
Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/libfs.c')
0 files changed, 0 insertions, 0 deletions