Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1141905imm; Thu, 4 Oct 2018 08:48:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV63NGXus9+2SZQrjMkGG9GpytQ2k/O1MrrKJ+YkESRDmkFaCZqkAFxWkQp7BAcvkOZXYYTty X-Received: by 2002:a62:85cb:: with SMTP id m72-v6mr7312220pfk.173.1538668095661; Thu, 04 Oct 2018 08:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538668095; cv=none; d=google.com; s=arc-20160816; b=k/1/dJqagxm7hfpjRkNPu/ScWXT14SXp6Tcl6AUXF38ZAINC+RVw9hfV8YlGbREcmz dbPN+dIZHkGmoyB1hPZ9FuIrn+k0eLnSYw60jimA9tUar4ny1rYJPNpOx1eBidIzpyms radin1q1NILLaeIKzyfUNlCpjBaOlH3dMgwXMt2Z9hEKO3q0i8/CCRakOV81d9qwv9Dx ap21mfcOOjbeXilXHKISMiV7tg1owD5qk6mAInyE2r6QbVXoGPwl83XntaZA3hpg5mAZ 1yVZr2p/jjeHl+G1xdTKK8P5zjUlOEfgOs30S5hnvrU3aAinDJ5gJcyKQHK1kruTYr4F xJmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=isN00gzYDRPSqD/Xx6NnnwdKGHJc8a7nlF+T4xqACog=; b=jIKTX+gLFk7VCSin1CNEETNJBPiZv/8N2VO0YhiibiR/ehLDBonTiHfjagV4jBed7K JGHLVZwRrA3HCO4ZE4eazkO/puKSD1TRHQ2RYmyqpxp2+BCW/9j9GepCEeMYE5K48DGS gKTCubvqrIlm7sQzs950Hv4j9IEYlxKgZvULNky9tsqsd1dRLZZZzf0v39u54JjHAzUr T4iyD1YRnvB1Q+39lmHdQdXO6BW6aZZqAfSD984UOk87zqoiqxc/u6hNRDNQcliPnA44 lC/3ZbtmFA6hohuuTrNMNZKupfO0O6jFQz6v0z+ryH4+w5HoAu/ZHR2Q/M7IKm4WBLAe EQ6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="S/HHwBvz"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si5227907plo.318.2018.10.04.08.48.00; Thu, 04 Oct 2018 08:48:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="S/HHwBvz"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728021AbeJDWlq (ORCPT + 99 others); Thu, 4 Oct 2018 18:41:46 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41274 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727599AbeJDWlq (ORCPT ); Thu, 4 Oct 2018 18:41:46 -0400 Received: by mail-pg1-f194.google.com with SMTP id 23-v6so3335361pgc.8 for ; Thu, 04 Oct 2018 08:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=isN00gzYDRPSqD/Xx6NnnwdKGHJc8a7nlF+T4xqACog=; b=S/HHwBvzFwgQnr52TnMdt1qozxrdpUb/syfmQuqvyrMJZTkJY+dM9yMq+N/n0J1JFO jW4rwtXTdouPjqqnNPlVrc+8B4jiDZtj0Hyo6KuOHiZ9qewkKq8fwbaI73es5k/0VOhh 9xVZYGjyT4dgISynJ/3xjsHHbFYkjDxHpkxQeHomtNgMuMyA9egbQFxG3ezBXuVhXnN0 Oi/OMuVFReaKOvCBdeP2m6SEQLO1fT5M+/Nk9wRw1Ek+UO1d4ZIK4xHt3fxh3MdDZhW+ 6J4Zf/ijBNcu757L822JuKfjJOzZ18e6qcmVGydm8On1iI6jNyRwy5O9EkIZGwfYF1KC znFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=isN00gzYDRPSqD/Xx6NnnwdKGHJc8a7nlF+T4xqACog=; b=cqkd/FE0VeJOTAUnlv5o25V7S5X5BEQSbKAEBYba6rxL6Z7WWdfnuVusticbFPSguC kV3WPTFMNxMi1+lRxbZSyESqU5gGSGPsHmyIiuxtN3wed0GVMU0X2mcVSb44+iSMxxMz 1ZDTak1NR+LgLWpTz2/NXkRt3K+gN4ArO79vmYSjsqiT2L7qZ1l3SSQgVXOxlwK1cpS/ la2Ulx4ocyugYS8T6FACMjVUrYWL5lVpLTOjJ87iXrN/nV8aK+J8yPrmp3HoLD8KENNL S0gDYgxNIhCap4ijSVQHwfquPi0fRvoZQa3Q0ONMji3wnzohXU9rxzYWK2gTQabwmP91 2FtA== X-Gm-Message-State: ABuFfojWbVyKmfTwQw427ogRVwgwagxu34IW7kX71ndYVMz8MGMA5eHm usWBbv6Brs6USoPgyxMVQpu83qUicAw= X-Received: by 2002:a62:b286:: with SMTP id z6-v6mr7462366pfl.79.1538668074931; Thu, 04 Oct 2018 08:47:54 -0700 (PDT) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id q25-v6sm8542568pfk.154.2018.10.04.08.47.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Oct 2018 08:47:53 -0700 (PDT) From: Eric Dumazet To: linux-kernel Cc: Eric Dumazet , Eric Dumazet , Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH] Input: mousedev - add a schedule point in mousedev_write() Date: Thu, 4 Oct 2018 08:47:49 -0700 Message-Id: <20181004154749.111595-1-edumazet@google.com> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reported-by: syzbot+9436b02171ac0894d33e@syzkaller.appspotmail.com Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org --- drivers/input/mousedev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index e08228061bcdd2f97aaadece31d6c83eb7539ae5..412fa71245afe26a7a8ad75705566f83633ba347 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -707,6 +707,7 @@ static ssize_t mousedev_write(struct file *file, const char __user *buffer, mousedev_generate_response(client, c); spin_unlock_irq(&client->packet_lock); + cond_resched(); } kill_fasync(&client->fasync, SIGIO, POLL_IN); -- 2.19.0.605.g01d371f741-goog