Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
description of repo status
Open Source
>
Other
>
Operation System
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
459
Star
1.7K
Fork
1.9K
GVP
openEuler
/
kernel
Closed
Code
Issues
1271
Pull Requests
991
Wiki
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
DevLens
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
【OLK5.10】【bugfix】UBIFS-whiteout-dir-checksize失败
Done
#I4U4SQ
Task
LiBaokun
Opened this issue
2022-02-17 15:53
在 rename whiteout 场景下,将 dir_s 重命名为 dir_d 假设有a文件 a_dent 和 a_ino 以及 whiteout_i, 会先在 dir_d 下新建一个 b_dent,然后将 a_ino 指向 b_dent 此时因为 whiteout_i 指向 a_dent, a_dent 不会被删除。 同时 dir_s_size 减去 a_dent_size, dir_d_size 加上 b_dent_size 此时卸载后重新挂载,触发 dbg_check_filesystem 检查 ``` dbg_check_filesystem dbg_walk_index check_leaf/leaf_cb fscki1->calc_sz += CALC_DENT_SIZE(nlen); check_inodes fscki->calc_sz != fscki->size 检查 size 异常 报错 ``` 【验证复现栈】 ``` ./ubifs_whiteout_reproducer.sh [79433.531487] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.533169] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.534604] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.536183] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.537667] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.539952] flash size: 128 MiB [79433.540468] page size: 2048 bytes [79433.541132] OOB area size: 64 bytes [79433.541773] sector size: 128 KiB [79433.542453] pages number: 65536 [79433.543102] pages per sector: 64 [79433.543774] bus width: 8 [79433.544309] bits in sector size: 17 [79433.544982] bits in page size: 11 [79433.547237] bits in OOB size: 6 [79433.547811] flash size with OOB: 135168 KiB [79433.548564] page address bytes: 4 [79433.549120] sector address bytes: 2 [79433.549699] options: 0x8 [79434.491795] gcov: discarding saved data for /home/lbk/hulk/fs/ubifs/debug.gcda (incompatible version) [79434.651834] >>> raw: 160 add: 64 [79434.652724] >>> raw: 224 add: 64 [79434.653594] UBIFS error (ubi0:0 pid 2958): dbg_check_filesystem [ubifs]: directory inode 1 size is 224, but calculated size is 288 [79434.655611] magic 0x6101831 [79434.656228] crc 0x4f8bfb97 [79434.656951] node_type 0 (inode node) [79434.657653] group_type 2 (last of node group) [79434.658503] sqnum 17 [79434.659035] len 160 [79434.659596] key (1, inode) [79434.660192] creat_sqnum 1 [79434.660696] size 224 [79434.661231] nlink 2 [79434.661743] atime 1642835107.0 [79434.662379] mtime 1642835107.0 [79434.663058] ctime 1642835107.0 [79434.663726] uid 0 [79434.664231] gid 0 [79434.664738] mode 16877 [79434.665288] flags 0x1 [79434.665875] xattr_cnt 0 [79434.666365] xattr_size 0 [79434.666898] xattr_names 0 [79434.667437] compr_type 0x0 [79434.667973] data len 0 [79434.668488] UBIFS error (ubi0:0 pid 2958): dbg_check_filesystem [ubifs]: file-system check failed with error -22 [79434.670168] CPU: 5 PID: 2958 Comm: mount Not tainted 5.10.0-11643-g46d62946fc12-dirty #2 [79434.671524] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [79434.673343] Call Trace: [79434.673754] ? dump_stack+0xa6/0xd5 [79434.674356] ? dbg_check_filesystem+0x345/0x500 [ubifs] [79434.675203] ? ubifs_mount+0x1ac5/0x2bf0 [ubifs] [79434.676006] ? legacy_get_tree+0x2c/0x80 [79434.676764] ? vfs_get_tree+0x26/0x110 [79434.677476] ? path_mount+0x88b/0xf80 [79434.678067] ? do_mount+0x8d/0xc0 [79434.678644] ? __se_sys_mount+0x1af/0x250 [79434.679299] ? __x64_sys_mount+0x29/0x40 [79434.679998] ? do_syscall_64+0x4d/0x70 [79434.680648] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 ```
在 rename whiteout 场景下,将 dir_s 重命名为 dir_d 假设有a文件 a_dent 和 a_ino 以及 whiteout_i, 会先在 dir_d 下新建一个 b_dent,然后将 a_ino 指向 b_dent 此时因为 whiteout_i 指向 a_dent, a_dent 不会被删除。 同时 dir_s_size 减去 a_dent_size, dir_d_size 加上 b_dent_size 此时卸载后重新挂载,触发 dbg_check_filesystem 检查 ``` dbg_check_filesystem dbg_walk_index check_leaf/leaf_cb fscki1->calc_sz += CALC_DENT_SIZE(nlen); check_inodes fscki->calc_sz != fscki->size 检查 size 异常 报错 ``` 【验证复现栈】 ``` ./ubifs_whiteout_reproducer.sh [79433.531487] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.533169] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.534604] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.536183] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.537667] [nandsim] warning: read_byte: unexpected data output cycle, state is STATE_READY return 0x0 [79433.539952] flash size: 128 MiB [79433.540468] page size: 2048 bytes [79433.541132] OOB area size: 64 bytes [79433.541773] sector size: 128 KiB [79433.542453] pages number: 65536 [79433.543102] pages per sector: 64 [79433.543774] bus width: 8 [79433.544309] bits in sector size: 17 [79433.544982] bits in page size: 11 [79433.547237] bits in OOB size: 6 [79433.547811] flash size with OOB: 135168 KiB [79433.548564] page address bytes: 4 [79433.549120] sector address bytes: 2 [79433.549699] options: 0x8 [79434.491795] gcov: discarding saved data for /home/lbk/hulk/fs/ubifs/debug.gcda (incompatible version) [79434.651834] >>> raw: 160 add: 64 [79434.652724] >>> raw: 224 add: 64 [79434.653594] UBIFS error (ubi0:0 pid 2958): dbg_check_filesystem [ubifs]: directory inode 1 size is 224, but calculated size is 288 [79434.655611] magic 0x6101831 [79434.656228] crc 0x4f8bfb97 [79434.656951] node_type 0 (inode node) [79434.657653] group_type 2 (last of node group) [79434.658503] sqnum 17 [79434.659035] len 160 [79434.659596] key (1, inode) [79434.660192] creat_sqnum 1 [79434.660696] size 224 [79434.661231] nlink 2 [79434.661743] atime 1642835107.0 [79434.662379] mtime 1642835107.0 [79434.663058] ctime 1642835107.0 [79434.663726] uid 0 [79434.664231] gid 0 [79434.664738] mode 16877 [79434.665288] flags 0x1 [79434.665875] xattr_cnt 0 [79434.666365] xattr_size 0 [79434.666898] xattr_names 0 [79434.667437] compr_type 0x0 [79434.667973] data len 0 [79434.668488] UBIFS error (ubi0:0 pid 2958): dbg_check_filesystem [ubifs]: file-system check failed with error -22 [79434.670168] CPU: 5 PID: 2958 Comm: mount Not tainted 5.10.0-11643-g46d62946fc12-dirty #2 [79434.671524] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [79434.673343] Call Trace: [79434.673754] ? dump_stack+0xa6/0xd5 [79434.674356] ? dbg_check_filesystem+0x345/0x500 [ubifs] [79434.675203] ? ubifs_mount+0x1ac5/0x2bf0 [ubifs] [79434.676006] ? legacy_get_tree+0x2c/0x80 [79434.676764] ? vfs_get_tree+0x26/0x110 [79434.677476] ? path_mount+0x88b/0xf80 [79434.678067] ? do_mount+0x8d/0xc0 [79434.678644] ? __se_sys_mount+0x1af/0x250 [79434.679299] ? __x64_sys_mount+0x29/0x40 [79434.679998] ? do_syscall_64+0x4d/0x70 [79434.680648] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 ```
Comments (
2
)
Sign in
to comment
Status
Done
Backlog
Doing
Done
Declined
Assignees
Not set
Labels
sig/Kernel
Not set
Projects
Unprojected
Unprojected
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (
-
)
Tags (
-
)
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
Duration
(hours)
参与者(2)
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register