Read syscall cannot response to sigals when data_to_read remains at 0
and the while loop cannot break. Check signal_pending in the loop.
Reported-by: Zhen Ni <zhen.ni@easystack.cn>
Message-Id: <
20230517085412.367022-1-zhen.ni@easystack.cn>
Signed-off-by: Corey Minyard <minyard@acm.org>
init_waitqueue_entry(&wait, current);
add_wait_queue(&read_q, &wait);
- while (!data_to_read) {
+ while (!data_to_read && !signal_pending(current)) {
set_current_state(TASK_INTERRUPTIBLE);
spin_unlock_irq(&ipmi_read_lock);
schedule();