Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1820704imu; Thu, 10 Jan 2019 03:40:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN7+wQkJaMkeWr1jQSYupc0dauGvHJJJf4toQtqd/urYc7juZN9KBNsqhFkHf4DnVdkF02tH X-Received: by 2002:a63:9c1a:: with SMTP id f26mr9125062pge.381.1547120450063; Thu, 10 Jan 2019 03:40:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547120450; cv=none; d=google.com; s=arc-20160816; b=yYMtmDFDHZlTww339p7ORsd4wgk1a5yOhWtZG1SNKwhod+7BZS1cO7HmN+Ry9VDgVJ AmMUlOVWOCIKxeuhnsCh7/3tpsHiwzoHyOX7mO10ZrauIV3OU+3i0BfRsCrDQxMF8H1m Z7s0UgSJUC8NDJGpOnnntrtKsy7inS3kSup3Kt4gC72Sa+DYtSmt1m1LRSn7Umxr3+Bq eWiF+bCBoflQh3z2myFTx9iFtWvNfmw6Kigttam5+Oiyn+g0m84wv3z3E4bwroGSdfQC Qf0I5Pj94ScKADiUN+kX0LXzqdfqu/Y52wVmf1P5Ctd1XWEgyE+lkqZnXK80x0E553h8 jSxw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=QoW90IcU2z5BT7/wrzgekEVyM1mFmfbSu6sXloxGQx4=; b=EuQ8jdssfK3vOWLpJqJ6XuveEXNmxnQn5yB9dWXe9cuoZGIazTEOIWLQL0PVJMMjmo O/Sg3sOViuatTHppDDvbr07oUsjrGELlNri7LO3rmrDzwxhmfQ/IQsxxmEE3UXVRJ0W7 NsMoeLAZk1cu7wthBMxDIO/og8NzPlor0Okq/uhvFlLaE/aCgLzGsjtiUxi/gNjPsOH1 KRUbGYA78pNXZUxHhwTfjxBR9ZBnjsS6btG/MEXWtRRfZndVU2ANpWMkQzhEoAo4iGIE qUljwOIZZGKojbh1/OCVzg5qyO3XNsJhroxr7fP2lseof5NOg1xjumrbruZHHGf4oQf2 OxYA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k35si17825026pgm.225.2019.01.10.03.40.34; Thu, 10 Jan 2019 03:40:50 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728531AbfAJLih (ORCPT + 99 others); Thu, 10 Jan 2019 06:38:37 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:36154 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727938AbfAJLih (ORCPT ); Thu, 10 Jan 2019 06:38:37 -0500 Received: from fsav107.sakura.ne.jp (fsav107.sakura.ne.jp [27.133.134.234]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id x0ABcaIM098348; Thu, 10 Jan 2019 20:38:36 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav107.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav107.sakura.ne.jp); Thu, 10 Jan 2019 20:38:36 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav107.sakura.ne.jp) Received: from [192.168.1.8] (softbank126126163036.bbtec.net [126.126.163.36]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id x0ABcZD5098308 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NO); Thu, 10 Jan 2019 20:38:35 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] tty/n_hdlc: fix __might_sleep warning To: Greg Kroah-Hartman , jslaby@suse.com Cc: Paul Fulghum , "linux-kernel@vger.kernel.org Mailing List" , Arnd Bergmann , Alan Cox , syzbot , syzkaller-bugs@googlegroups.com References: <000000000000449587057e1e6f8b@google.com> <49b3b189-a51f-6a97-0e1f-bc3f2c305299@I-love.SAKURA.ne.jp> <62FAC6A3-AC41-44CD-8ABC-79F404BF8CB1@microgate.com> From: Tetsuo Handa Message-ID: Date: Thu, 10 Jan 2019 20:38:33 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Greg. We attempted a cleanup but we failed. Thus, will you apply this patch for now? On 2019/01/02 5:28, Paul Fulghum wrote: > Fix __might_sleep warning in tty/n_hdlc.c read due to copy_to_user call while current is TASK_INTERRUPTIBLE. > This is a false positive since the code path does not depend on current state remaining TASK_INTERRUPTIBLE. > The loop breaks out and sets TASK_RUNNING after calling copy_to_user. > This patch supresses the warning by setting TASK_RUNNING before calling copy_to_user. > > [1] https://syzkaller.appspot.com/bug?id=17d5de7f1fcab794cb8c40032f893f52de899324 > > Signed-off-by: Paul Fulghum > Reported-by: syzbot > Cc: Greg Kroah-Hartman > Cc: Tetsuo Handa > Cc: Arnd Bergmann > Cc: Alan Cox > — > --- a/drivers/tty/n_hdlc.c 2018-12-23 15:55:59.000000000 -0800 > +++ b/drivers/tty/n_hdlc.c 2019-01-01 11:44:47.148153954 -0800 > @@ -597,6 +597,7 @@ static ssize_t n_hdlc_tty_read(struct tt > /* too large for caller's buffer */ > ret = -EOVERFLOW; > } else { > + __set_current_state(TASK_RUNNING); > if (copy_to_user(buf, rbuf->buf, rbuf->count)) > ret = -EFAULT; > else