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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,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 36DCAC433E1 for ; Mon, 17 Aug 2020 10:37:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10432206FA for ; Mon, 17 Aug 2020 10:37:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597660669; bh=dQC/u6vdS4r5uG68W55qZk3j77ZandkQOc6SnhLVQ84=; h=Subject:To:Cc:From:Date:List-ID:From; b=gQHen4wY1SHwBVBBnOYLZOo32T00sRzvRtpKFI45ijSS/IZtItSKwWrR3NLhDg/V/ J4KtH0JrCkEwzJQWgYl8TY2uOIjUr155EssYaPJlTHlOtZYuMEidj3N2Wd4DyhYOWa z+0pwaJhLAwvEH/JDq5lOG1WpT4qrbLUtwFvvKr0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726746AbgHQKhs (ORCPT ); Mon, 17 Aug 2020 06:37:48 -0400 Received: from forward5-smtp.messagingengine.com ([66.111.4.239]:57399 "EHLO forward5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726830AbgHQKhs (ORCPT ); Mon, 17 Aug 2020 06:37:48 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.nyi.internal (Postfix) with ESMTP id C1FD41941B38; Mon, 17 Aug 2020 06:37:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 17 Aug 2020 06:37:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=R5WpgV KjcIpmD3qZNJdFbhCKL3Gtl0z0OhdWvGpuQUE=; b=LXr2YPnjrQu0REGBghM/Lo ooEW+9d7ABcyt5JvsQ+kxXFfvJvV10vx8GPEBtBlPBrT4onQS6i3vHSSO0fFLA/4 heVuC2rtgfSA0B9BCY8CX157govTrLcfUbdelE08suJF5gRQL+1RIUpZeiOU5ZB7 F7mYJAygC1R7vcGnnn9KeNxg7f7o8YngBp5gsPFDofmIjADk7SU0clup9KXPNtk7 CyKile62ufV1dYaswWit7yl9LiK0iVJXwOJ4ICiVRqXrHUBA2Aiu2Jrj80IwdQuX L0WipsZU0abDRweivVoG6zQ7POqvPGi2BwOu0ZZigartz88gmpux0r7DRVWjAntQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddtfedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhepuffvhfffkfggtgfgsehtkeertddttdflnecuhfhrohhmpeeoghhrvghgkhhh sehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgqeenucggtffrrghtthgvrhhnpeefge eugeegkefffeegkeevgeegffegleejkeejkeelueffgeehfeeiudffkeeuhfenucffohhm rghinheprghpphhsphhothdrtghomhdpkhgvrhhnvghlrdhorhhgnecukfhppeekfedrke eirdekledruddtjeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhl fhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 6032430600A6; Mon, 17 Aug 2020 06:37:46 -0400 (EDT) Subject: FAILED: patch "[PATCH] driver core: Fix probe_count imbalance in really_probe()" failed to apply to 5.4-stable tree To: penguin-kernel@I-love.SAKURA.ne.jp, geert+renesas@glider.be, gregkh@linuxfoundation.org, stable@kernel.org, syzbot+805f5f6ae37411f15b64@syzkaller.appspotmail.com Cc: From: Date: Mon, 17 Aug 2020 12:38:03 +0200 Message-ID: <15976606839978@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 The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From b292b50b0efcc7095d8bf15505fba6909bb35dce Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Mon, 13 Jul 2020 11:12:54 +0900 Subject: [PATCH] driver core: Fix probe_count imbalance in really_probe() syzbot is reporting hung task in wait_for_device_probe() [1]. At least, we always need to decrement probe_count if we incremented probe_count in really_probe(). However, since I can't find "Resources present before probing" message in the console log, both "this message simply flowed off" and "syzbot is not hitting this path" will be possible. Therefore, while we are at it, let's also prepare for concurrent wait_for_device_probe() calls by replacing wake_up() with wake_up_all(). [1] https://syzkaller.appspot.com/bug?id=25c833f1983c9c1d512f4ff860dd0d7f5a2e2c0f Reported-by: syzbot Fixes: 7c35e699c88bd607 ("driver core: Print device when resources present in really_probe()") Cc: Geert Uytterhoeven Signed-off-by: Tetsuo Handa Cc: stable Link: https://lore.kernel.org/r/20200713021254.3444-1-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 2306b481109a..fce8e35b6367 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -276,7 +276,7 @@ static void deferred_probe_timeout_work_func(struct work_struct *work) list_for_each_entry_safe(private, p, &deferred_probe_pending_list, deferred_probe) dev_info(private->device, "deferred probe pending\n"); - wake_up(&probe_timeout_waitqueue); + wake_up_all(&probe_timeout_waitqueue); } static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func); @@ -498,7 +498,8 @@ static int really_probe(struct device *dev, struct device_driver *drv) drv->bus->name, __func__, drv->name, dev_name(dev)); if (!list_empty(&dev->devres_head)) { dev_crit(dev, "Resources present before probing\n"); - return -EBUSY; + ret = -EBUSY; + goto done; } re_probe: @@ -627,7 +628,7 @@ static int really_probe(struct device *dev, struct device_driver *drv) ret = 0; done: atomic_dec(&probe_count); - wake_up(&probe_waitqueue); + wake_up_all(&probe_waitqueue); return ret; }