Skip to content

Commit f74c371

Browse files
edumazetdtor
authored andcommitted
Input: mousedev - add a schedule point in mousedev_write()
syzbot was able to trigger rcu stalls by calling write() with large number of bytes. Add a cond_resched() in the loop to avoid this. Link: https://lkml.org/lkml/2018/8/23/1106 Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: syzbot+9436b02171ac0894d33e@syzkaller.appspotmail.com Reviewed-by: Paul E. McKenney <paulmck@linux.ibm.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 684bec1 commit f74c371

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/input/mousedev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ static ssize_t mousedev_write(struct file *file, const char __user *buffer,
707707
mousedev_generate_response(client, c);
708708

709709
spin_unlock_irq(&client->packet_lock);
710+
cond_resched();
710711
}
711712

712713
kill_fasync(&client->fasync, SIGIO, POLL_IN);

0 commit comments

Comments
 (0)