From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33A3AC43387 for ; Fri, 18 Jan 2019 12:28:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE4592087E for ; Fri, 18 Jan 2019 12:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547814523; bh=LD7PiQMnzQZkadWMN9zbynaPcX4XVxzhkWOlJpwcXNc=; h=Subject:To:From:Date:List-ID:From; b=n3ApGlRSBB6dMr+BefBakFHRQSbLZxc3TXa+nD0EwiowipgGEZh0bKDkE4epuZRSl dxCpySlqP/ETkw8/OxKde9MUXFmuDaAb+/jT0YtlL2lFNNDI2xI20tX9t8riu+ozDq zxaJQU/dMD5PTT9uALzYJbJ1SkprkaI6qOzCTDd8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727448AbfARM2m (ORCPT ); Fri, 18 Jan 2019 07:28:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:50942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727398AbfARM2m (ORCPT ); Fri, 18 Jan 2019 07:28:42 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 444F520823; Fri, 18 Jan 2019 12:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547814521; bh=LD7PiQMnzQZkadWMN9zbynaPcX4XVxzhkWOlJpwcXNc=; h=Subject:To:From:Date:From; b=uAO9zSF5akOeWO3bNw3tavV2PBpkIEg/dVLmTvG0XAvs+kQ5HFlsNTqBOzrL7XjSM i3LdSRh1334geQ4gMUuaSrSNbm3wSaNvUOkNksZDx4/5uWsiJFTacRpgHVPZlEIeBP BYd3y8HtAwy4LV3ogtQ54EXhwlV/6HzjUH3Ydo/M= Subject: patch "tty/n_hdlc: fix __might_sleep warning" added to tty-linus To: paulkf@microgate.com, alan@lxorguk.ukuu.org.uk, arnd@arndb.de, gregkh@linuxfoundation.org, penguin-kernel@I-love.SAKURA.ne.jp, stable@vger.kernel.org, syzbot+c244af085a0159d22879@syzkaller.appspotmail.com From: Date: Fri, 18 Jan 2019 13:28:39 +0100 Message-ID: <154781451912150@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled tty/n_hdlc: fix __might_sleep warning to my tty git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git in the tty-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From fc01d8c61ce02c034e67378cd3e645734bc18c8c Mon Sep 17 00:00:00 2001 From: Paul Fulghum Date: Tue, 1 Jan 2019 12:28:53 -0800 Subject: tty/n_hdlc: fix __might_sleep warning Fix __might_sleep warning[1] 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: Tetsuo Handa Cc: Alan Cox Cc: stable Acked-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/tty/n_hdlc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c index 4164414d4c64..8bdf42bc8fc8 100644 --- a/drivers/tty/n_hdlc.c +++ b/drivers/tty/n_hdlc.c @@ -597,6 +597,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, /* 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 -- 2.20.1