Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f2fs: fix to skip verifying block address for non-regular inode #2896

Merged
merged 1 commit into from Mar 19, 2019

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented Mar 18, 2019

commit dda9f4b upstream.

generic/184 1s ... [failed, exit status 1]- output mismatch
--- tests/generic/184.out 2015-01-11 16:52:27.643681072 +0800
QA output created by 184 - silence is golden
+rm: cannot remove '/mnt/f2fs/null': Bad address
+mknod: '/mnt/f2fs/null': Bad address
+chmod: cannot access '/mnt/f2fs/null': Bad address
+./tests/generic/184: line 36: /mnt/f2fs/null: Bad address
...

F2FS-fs (zram0): access invalid blkaddr:259
EIP: f2fs_is_valid_blkaddr+0x14b/0x1b0 [f2fs]
f2fs_iget+0x927/0x1010 [f2fs]
f2fs_lookup+0x26e/0x630 [f2fs]
__lookup_slow+0xb3/0x140
lookup_slow+0x31/0x50
walk_component+0x185/0x1f0
path_lookupat+0x51/0x190
filename_lookup+0x7f/0x140
user_path_at_empty+0x36/0x40
vfs_statx+0x61/0xc0
__do_sys_stat64+0x29/0x40
sys_stat64+0x13/0x20
do_fast_syscall_32+0xaa/0x22c
entry_SYSENTER_32+0x53/0x86

In f2fs_iget(), we will check inode's first block address, if it is valid,
we will set FI_FIRST_BLOCK_WRITTEN flag in inode.

But we should only do this for regular inode, otherwise, like special
inode, i_addr[0] is used for storing device info instead of block address,
it will fail checking flow obviously.

So for non-regular inode, let's skip verifying address and setting flag.

Signed-off-by: Chao Yu yuchao0@huawei.com
Signed-off-by: Jaegeuk Kim jaegeuk@kernel.org

commit dda9f4b upstream.

generic/184 1s ... [failed, exit status 1]- output mismatch
    --- tests/generic/184.out	2015-01-11 16:52:27.643681072 +0800
     QA output created by 184 - silence is golden
    +rm: cannot remove '/mnt/f2fs/null': Bad address
    +mknod: '/mnt/f2fs/null': Bad address
    +chmod: cannot access '/mnt/f2fs/null': Bad address
    +./tests/generic/184: line 36: /mnt/f2fs/null: Bad address
    ...

F2FS-fs (zram0): access invalid blkaddr:259
EIP: f2fs_is_valid_blkaddr+0x14b/0x1b0 [f2fs]
 f2fs_iget+0x927/0x1010 [f2fs]
 f2fs_lookup+0x26e/0x630 [f2fs]
 __lookup_slow+0xb3/0x140
 lookup_slow+0x31/0x50
 walk_component+0x185/0x1f0
 path_lookupat+0x51/0x190
 filename_lookup+0x7f/0x140
 user_path_at_empty+0x36/0x40
 vfs_statx+0x61/0xc0
 __do_sys_stat64+0x29/0x40
 sys_stat64+0x13/0x20
 do_fast_syscall_32+0xaa/0x22c
 entry_SYSENTER_32+0x53/0x86

In f2fs_iget(), we will check inode's first block address, if it is valid,
we will set FI_FIRST_BLOCK_WRITTEN flag in inode.

But we should only do this for regular inode, otherwise, like special
inode, i_addr[0] is used for storing device info instead of block address,
it will fail checking flow obviously.

So for non-regular inode, let's skip verifying address and setting flag.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
@pelwell
Copy link
Contributor Author

pelwell commented Mar 18, 2019

See #2894.

@pelwell pelwell merged commit e9829ff into raspberrypi:rpi-4.14.y Mar 19, 2019
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Mar 20, 2019
kernel: Enable MT76 USB wifi modules
See: raspberrypi/linux#2890

kernel: staging: bcm2835-codec: NULL component handle on queue_setup failure
See: raspberrypi/linux#2898

kernel: f2fs: fix to skip verifying block address for non-regular inode
See: raspberrypi/linux#2896

kernel: vcsm: rpi-4.19.y - gcc-v8 fixes
See: raspberrypi/linux#2897

kernel: vc-sm-cma tidy ups, and one for bcm2835_codec
See: raspberrypi/linux#2889

kernel: staging: vc_sm_cma: Remove erroneous misc_deregister
See: raspberrypi/linux#2888

kernel: video: bcm2708_fb: Try allocating on the ARM and passing to VPU
See: raspberrypi/linux#2875

firmware: smservice: Avoid a double free

firmware: arm_loader/display: All the framebuffer allocation to be made on the ARM

firmware: isp_tuners: Fix memory leak in error path

firmware: testc: Fix dps parsing

firmware: camera_subsystem: Fix hardware sync pulses off disable_camera_led

firmware: Replace the remaining direct users of C(mask_gpu_interrupt[0|1])

firmware: arm_display: Kick transposer for the rainbow screen if required
firmware: dispmanx: Do not allow transpose if using Full KMS
See: raspberrypi/linux#2891
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Mar 20, 2019
kernel: Enable MT76 USB wifi modules
See: raspberrypi/linux#2890

kernel: staging: bcm2835-codec: NULL component handle on queue_setup failure
See: raspberrypi/linux#2898

kernel: f2fs: fix to skip verifying block address for non-regular inode
See: raspberrypi/linux#2896

kernel: vcsm: rpi-4.19.y - gcc-v8 fixes
See: raspberrypi/linux#2897

kernel: vc-sm-cma tidy ups, and one for bcm2835_codec
See: raspberrypi/linux#2889

kernel: staging: vc_sm_cma: Remove erroneous misc_deregister
See: raspberrypi/linux#2888

kernel: video: bcm2708_fb: Try allocating on the ARM and passing to VPU
See: raspberrypi/linux#2875

firmware: smservice: Avoid a double free

firmware: arm_loader/display: All the framebuffer allocation to be made on the ARM

firmware: isp_tuners: Fix memory leak in error path

firmware: testc: Fix dps parsing

firmware: camera_subsystem: Fix hardware sync pulses off disable_camera_led

firmware: Replace the remaining direct users of C(mask_gpu_interrupt[0|1])

firmware: arm_display: Kick transposer for the rainbow screen if required
firmware: dispmanx: Do not allow transpose if using Full KMS
See: raspberrypi/linux#2891
@pelwell pelwell deleted the is2894 branch September 15, 2021 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants