From: yangerkun yangerkun@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I46HJ6 CVE: NA ---------------------------
This reverts commit 0875a4c4a55932660b602c1c266aed88b6b83231.
After this patch, we will first call ext4_es_unregister_shrinker and destroy some percpu counter which will try to access will latter call trace:
[ 45.808127] Internal error: Oops: 96000004 [#1] SMP [ 45.812986] Modules linked in: realtek hclge hns3 megaraid_sas hisi_sas_v3_hw hibmc_drm hisi_sas_main host_edma_drv hnae3 [ 45.823896] Process mount (pid: 1187, stack limit = 0x00000000e0bd7181) [ 45.830481] CPU: 9 PID: 1187 Comm: mount Not tainted 4.19.90_4.19.90-2108.7.0+ #2 [ 45.837929] Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V3.26.01 06/14/2019 [ 45.846587] pstate: 10400009 (nzcV daif +PAN -UAO) [ 45.851359] pc : percpu_counter_add_batch+0x5c/0x358 [ 45.856303] lr : ext4_es_free_extent+0xd4/0x4a8 [ 45.860812] sp : ffff80262a60f170 [ 45.864112] x29: ffff80262a60f170 x28: dfff200000000000 [ 45.869399] x27: ffff8026403e65cc x26: 0000000000000000 [ 45.874686] x25: ffff80266c429e20 x24: 0000000000000100 [ 45.879973] x23: 1ffff004cd8853c4 x22: ffffffffffffffff [ 45.885260] x21: 0000000000000000 x20: 00006026b7a31000 [ 45.890547] x19: ffff80266c429e00 x18: 0000000000000000 [ 45.895833] x17: 0000000000000000 x16: 0000000000000000 [ 45.901120] x15: 1fffe4000504bd02 x14: ffff200023ba1adc [ 45.906406] x13: ffff200024332530 x12: ffff20002433240c [ 45.911693] x11: ffff2000243304f4 x10: ffff200024328f6c [ 45.916980] x9 : 1ffff004c807ccb9 x8 : ffff200023b75950 [ 45.922266] x7 : ffff200023ba1fe0 x6 : 0000000000000004 [ 45.927553] x5 : 0000000000000000 x4 : 0000000000000000 [ 45.932839] x3 : 00000c04d6f46200 x2 : dfff200000000000 [ 45.938126] x1 : 0000000000000003 x0 : 00006026b7a31000 [ 45.943413] Call trace: [ 45.945851] percpu_counter_add_batch+0x5c/0x358 [ 45.950446] ext4_es_free_extent+0xd4/0x4a8 [ 45.954610] __es_remove_extent+0x37c/0x598 [ 45.958773] ext4_es_remove_extent+0x6c/0x270 [ 45.963110] ext4_clear_inode+0x50/0x188 [ 45.967016] ext4_evict_inode+0x314/0x1450 [ 45.971094] evict+0x238/0x5a0 [ 45.974136] iput+0x2bc/0x6b8 [ 45.977090] jbd2_journal_destroy+0x408/0x800 [ 45.981428] ext4_fill_super+0x5a04/0x8cc0 [ 45.985505] mount_bdev+0x268/0x328 [ 45.988978] ext4_mount+0x44/0x58 [ 45.992277] mount_fs+0x68/0x390 [ 45.995492] vfs_kern_mount.part.2+0x54/0x388 [ 45.999830] do_mount+0xa5c/0x20d0 [ 46.003216] ksys_mount+0x9c/0x118 [ 46.006603] __arm64_sys_mount+0xa8/0x108 [ 46.010595] el0_svc_common+0x10c/0x4a0 [ 46.014415] el0_svc_handler+0x170/0x248 [ 46.018320] el0_svc+0x10/0x218 [ 46.021448] Code: f2fbffe2 d343fc03 92400801 11000c21 (38e26862) [ 46.027513] ---[ end trace 316fdb8833588599 ]--- [ 46.037646] Kernel panic - not syncing: Fatal exception [ 46.042848] SMP: stopping secondary CPUs [ 46.046779] Kernel Offset: 0x1baf0000 from 0xffff200008000000 [ 46.052500] CPU features: 0x12,a2a00a38 [ 46.056318] Memory Limit: none [ 46.064887] Rebooting in 1 seconds.. [ 47.068489] SMP: stopping secondary CPUs [ 48.158471] SMP: failed to stop secondary CPUs 0-127
We first revert this patch. And the problem which this patch try to fix will fixed soon.
Signed-off-by: yangerkun yangerkun@huawei.com Reviewed-by: Zhang Yi yi.zhang@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- fs/ext4/super.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 0783f85a1c6cc..d793e597c0623 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4831,15 +4831,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ext4_xattr_destroy_cache(sbi->s_ea_block_cache); sbi->s_ea_block_cache = NULL; } -failed_mount3a: - ext4_es_unregister_shrinker(sbi); -failed_mount3: - flush_work(&sbi->s_error_work); - if (sbi->s_journal) { jbd2_journal_destroy(sbi->s_journal); sbi->s_journal = NULL; } +failed_mount3a: + ext4_es_unregister_shrinker(sbi); +failed_mount3: + flush_work(&sbi->s_error_work); del_timer_sync(&sbi->s_err_report); ext4_stop_mmpd(sbi); failed_mount2: