
From: wuyifeng10 <wuyifeng10@huawei.com> euleros inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IC7KJ2 CVE: NA -------------------------------- When a kill signal recived by fusepath client, the server will abort, we need ignore the client action. Fixes: 1fc14d09b9f0 ("ipc: add fast_ipc module to enable fast process switching") Signed-off-by: wuyifeng10 <wuyifeng10@huawei.com> --- fs/fuse/dev.c | 4 +++- ipc/fast_ipc.c | 15 +++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index c8df2357a5e7..c16aa1858514 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -2873,7 +2873,9 @@ static long fuse_ipc_ret_call(struct file *file, struct fuse_conn *fc, if (num_written < 0) { pr_err("[cpu/%d] [%s/%d]fuse_ipc_write failed %ld\n", smp_processor_id(), tsk->comm, tsk->pid, num_written); - return num_written; + /* no return, we report the error msg to client in + * fuse_ipc_write and continue handle the next request + */ } ret = fast_ipc_ret_call(ipc_info->bind_info, tsk); diff --git a/ipc/fast_ipc.c b/ipc/fast_ipc.c index 0bf761e117db..bb92b623fcbe 100644 --- a/ipc/fast_ipc.c +++ b/ipc/fast_ipc.c @@ -10,6 +10,7 @@ #include <linux/types.h> #include <linux/slab.h> #include <linux/sched.h> +#include <linux/delay.h> #include <linux/printk.h> #include <linux/preempt.h> #include <linux/sched/signal.h> @@ -185,11 +186,14 @@ ssize_t fast_ipc_do_call(struct fast_ipc_bind_info *bind_info, tsk->comm, tsk->pid); if (signal_pending(current)) { ret = -EINTR; - pr_err("[cpu/%d][%s/%d] client has signal pending break\n", + pr_err("[cpu/%d][%s/%d] client has signal, wait server finish\n", smp_processor_id(), tsk->comm, tsk->pid); - break; + msleep(10); + set_current_state(TASK_RUNNING); + /* for next loop, server change the is_calling flags */ + if (!bind_info->is_calling) + pr_err("server finish\n"); } - set_current_state(TASK_INTERRUPTIBLE); } set_current_state(TASK_RUNNING); @@ -216,12 +220,15 @@ long fast_ipc_ret_call(struct fast_ipc_bind_info *bind_info, { struct task_struct *client_task; - if (!bind_info->is_calling) + if (!bind_info->is_calling) { + pr_err("confusing bug is_no_calling\n"); return 0; + } bind_info_lock(bind_info); client_task = bind_info->client_task; if (!client_task) { + pr_err("confusing bug no_client\n"); bind_info_unlock(bind_info); return -ESRCH; } -- 2.33.0