Unverified Commit c0f9297f authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14447 Fix CVE-2024-56744

Merge Pull Request from: @ci-robot 
 
PR sync from: Hongbo Li <lihongbo22@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/TEQTHRKD5CQPEB6E4ENLUWZCCASNCBG2/ 
Fix CVE-2024-56744.

Chao Yu (1):
  f2fs: fix to avoid potential deadlock in f2fs_record_stop_reason()


-- 
2.34.1
 
https://gitee.com/src-openeuler/kernel/issues/IBEGGH 
 
Link:https://gitee.com/openeuler/kernel/pulls/14447

 

Reviewed-by: default avatarZhang Jianhua <chris.zjh@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents f739aaec ab1784b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
	f2fs_build_fault_attr(sbi, 0, 0);
	if (!end_io)
		f2fs_flush_merged_writes(sbi);
	f2fs_handle_critical_error(sbi, reason, end_io);
	f2fs_handle_critical_error(sbi, reason);
}

/*
+1 −2
Original line number Diff line number Diff line
@@ -3589,8 +3589,7 @@ int f2fs_quota_sync(struct super_block *sb, int type);
loff_t max_file_blocks(struct inode *inode);
void f2fs_quota_off_umount(struct super_block *sb);
void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag);
void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason,
							bool irq_context);
void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason);
void f2fs_handle_error(struct f2fs_sb_info *sbi, unsigned char error);
void f2fs_handle_error_async(struct f2fs_sb_info *sbi, unsigned char error);
int f2fs_commit_super(struct f2fs_sb_info *sbi, bool recover);
+7 −6
Original line number Diff line number Diff line
@@ -4093,8 +4093,7 @@ static bool system_going_down(void)
		|| system_state == SYSTEM_RESTART;
}

void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason,
							bool irq_context)
void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason)
{
	struct super_block *sb = sbi->sb;
	bool shutdown = reason == STOP_CP_REASON_SHUTDOWN;
@@ -4106,10 +4105,12 @@ void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason,
	if (!f2fs_hw_is_readonly(sbi)) {
		save_stop_reason(sbi, reason);

		if (irq_context && !shutdown)
		/*
		 * always create an asynchronous task to record stop_reason
		 * in order to avoid potential deadlock when running into
		 * f2fs_record_stop_reason() synchronously.
		 */
		schedule_work(&sbi->s_error_work);
		else
			f2fs_record_stop_reason(sbi);
	}

	/*