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 D6549C433DF for ; Mon, 17 Aug 2020 10:37:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B49C0206FA for ; Mon, 17 Aug 2020 10:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597660667; bh=4/MrRUHqWqd8WtrwSt4YMWbr3QCuk7npx0a63mHMmA0=; h=Subject:To:Cc:From:Date:List-ID:From; b=dNDJxFjJ4leql6WN9g8ggVQi8nt6qU1oSMM48c7kJq9NL/jOPIHY6nfHd/sU7nGad dMzssHg8NVcGPcAapQ91lS3ARusvS0Lu+0JnuBSMP+mE/f9SENs3m+h4BYXkQP06qb 9tl3j75C02lB/XQPfjQcdD8+4YhEkhFM5eLyCg0Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727880AbgHQKhr (ORCPT ); Mon, 17 Aug 2020 06:37:47 -0400 Received: from forward5-smtp.messagingengine.com ([66.111.4.239]:48595 "EHLO forward5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726746AbgHQKhq (ORCPT ); Mon, 17 Aug 2020 06:37:46 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.nyi.internal (Postfix) with ESMTP id 5BD341941B1E; Mon, 17 Aug 2020 06:37:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 17 Aug 2020 06:37:45 -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=ks+9FS oYUQ9cLxdpyqDGtF3N51LLrLKkvikq3eQoSF0=; b=PFOgam7sVT3aRR4OfDLptc 9sM5JciZtS2gHZpLI0qleQ+Nz7H1EvNXjoxwom2EOqCmAY8YGe/2mAczMTUG4v9/ 1YsgzitmOdD8LRZXtZZ2pGyLjleid+0ckSiTEavxFLhOMj24PWmMCeOzw/1LpfuR rOwKuBAAEMxneTdK1V7lNX5dHTWDUDhFxyHn8j8O1j88OeDgVtza+T8mZ5Ay+znU rj5p8ExGCxhy3fF/CpZ+DZMdMuasRp8rO72ZxmG0RLrsDvjW15g8u3Lv2J5v0jQF VWeoi4aUTSTNhQRMsdWxMgoKGkxA2JxByhLaAEH01N8Cgbz2jD2Tc2+ltwAJz9Xg == 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 CFAD8328005A; Mon, 17 Aug 2020 06:37:44 -0400 (EDT) Subject: FAILED: patch "[PATCH] driver core: Fix probe_count imbalance in really_probe()" failed to apply to 4.14-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:02 +0200 Message-ID: <15976606822760@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 4.14-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; }