Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp628882pxv; Thu, 15 Jul 2021 11:56:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT3vPWYRqBK7hEa3tvEaMwOJ/Eab0yP1yDdRHpyjBksXIfypLKUUBr2MPAhcc3Nup3X4dJ X-Received: by 2002:a17:907:b0d:: with SMTP id h13mr7199543ejl.279.1626375410804; Thu, 15 Jul 2021 11:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375410; cv=none; d=google.com; s=arc-20160816; b=amTuRp2lzlkgFBxcjw2Uihske3RY+D3FMFvSTTA5WsOPtheH8YW4e0SUwmU8f1lh+9 5vOjpOoaluMAWNshP9A5YO3CR8thT9Mu0TKcLNE+nQ9sktlDrL+fatTd0kzYWlP/pSOt 9JCvZL9jRfRLz0vUo1L9TkOv7ahq89Elleypw6Ez1ktSkrSGOl8cdZWpt3VK3hN7Q8mQ xVq/G5DWDocnIoFmSrx7HrC5GIbXvDs+qT1uTj9CpCC/g23KBY17asJYO9E0YGVnfNgf lKgoqvGtp4jfsAKNj2uw8GVi7UT+zKsCEMNgTFU5wCNoZ75us0ZvYFIyyczyfrZVfSJ/ WHEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OfCvJ6Au15Gf2J6/wMTR/uxUznFwQRDvN2BgBupOeZA=; b=hXzQcRp/k4Nc2q51DCSjMU602G9dHcFRkyP0H6q/rGirUpa7BiVPyX/R7qL32j12aZ /IH8mYmqF+d1Nyw6QzVhcvjW/jKeItnAkGp/RBLBePFBUF7tT+z8FQOezK9v8MvW9hyp TZndaidJEDajaYnF2pMb8V+L3qpUEUy6ffQHiMCdkyGusg1ZQkTGjl0s/NAV2sXcHVDp ushzAAT6OzKyUSHpXIQlgWtitjxbVaVF1Wfnaygz24IfS81GEbGB20V0CIkkw4TUhvLw szo9h3KY62lqLrwMo4IBz7nNiLPkwG7kZzoRcCd+lO0tY8Ujvpnb4I5vBnEE56Sm4fDQ q62w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eDJoYMBV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 18si8383995ejj.476.2021.07.15.11.56.27; Thu, 15 Jul 2021 11:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eDJoYMBV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240624AbhGOS6R (ORCPT + 99 others); Thu, 15 Jul 2021 14:58:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:54386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239587AbhGOSv6 (ORCPT ); Thu, 15 Jul 2021 14:51:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C2D51613E9; Thu, 15 Jul 2021 18:49:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626374943; bh=Ry1aG034I40ds9gCDxFiOmtRE8P3ZjPlXbEhpRWYn94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eDJoYMBVGyqpzIcw/Yo8axz6v/9Fz0xrotygKMM70pif+6uFZZXXh/EsL8fjeju+I nXJvXA20hsvf/C9uYmHOSwIIBE/sMOxc7VNrUV34oMl2VM8y/4UiqdYY3d8koEbaiz fTTOnA1Q3/bQ6EGRggZNqRR0p6pW/KVHscrd+qMU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+ea2f1484cffe5109dc10@syzkaller.appspotmail.com, Pavel Begunkov , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 091/215] io_uring: fix false WARN_ONCE Date: Thu, 15 Jul 2021 20:37:43 +0200 Message-Id: <20210715182615.451998955@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Begunkov [ Upstream commit e6ab8991c5d0b0deae0961dc22c0edd1dee328f5 ] WARNING: CPU: 1 PID: 11749 at fs/io-wq.c:244 io_wqe_wake_worker fs/io-wq.c:244 [inline] WARNING: CPU: 1 PID: 11749 at fs/io-wq.c:244 io_wqe_enqueue+0x7f6/0x910 fs/io-wq.c:751 A WARN_ON_ONCE() in io_wqe_wake_worker() can be triggered by a valid userspace setup. Replace it with pr_warn. Reported-by: syzbot+ea2f1484cffe5109dc10@syzkaller.appspotmail.com Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f7ede342c3342c4c26668f5168e2993e38bbd99c.1623949695.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io-wq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/io-wq.c b/fs/io-wq.c index f72d53848dcb..8bb17b6d4de3 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -299,7 +299,8 @@ static void io_wqe_wake_worker(struct io_wqe *wqe, struct io_wqe_acct *acct) * Most likely an attempt to queue unbounded work on an io_wq that * wasn't setup with any unbounded workers. */ - WARN_ON_ONCE(!acct->max_workers); + if (unlikely(!acct->max_workers)) + pr_warn_once("io-wq is not configured for unbound workers"); rcu_read_lock(); ret = io_wqe_activate_free_worker(wqe); @@ -1085,6 +1086,8 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data) if (WARN_ON_ONCE(!data->free_work || !data->do_work)) return ERR_PTR(-EINVAL); + if (WARN_ON_ONCE(!bounded)) + return ERR_PTR(-EINVAL); wq = kzalloc(sizeof(*wq), GFP_KERNEL); if (!wq) -- 2.30.2