Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8365767rwn; Wed, 14 Sep 2022 13:13:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ACdsAwJRocw7hNG5av2n1VgBWkCgg0GMbCVwgukPQMdSdzt6GizZgf2q4quHAQT2dQnJS X-Received: by 2002:a63:33cd:0:b0:42b:80a2:7aef with SMTP id z196-20020a6333cd000000b0042b80a27aefmr33768112pgz.38.1663186438439; Wed, 14 Sep 2022 13:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663186438; cv=none; d=google.com; s=arc-20160816; b=Ry/u7xF4v/N4uxn4AJbHeyIXqGfC4oIFtZE5BUwPUyVwo5zGmGxZiE7DSi549achxd wc9px/XvwWuGkWmjqpB/q7cjPxvxOAnqFVirg34Vv9EnZYMzMEnEXGBU+FUwrQwoRgZt lJ0EKYIN3rek35zJPMYuz8zUM/jZOgMfoueNuJN0GkqjtHLw9fGP47hYvaAsbqF5fLcd kbN8Be+tw0J5pptifstWSA7oiDFIfSSVOZsWwFdsfsrPdvsIoUvyEOJkMk11wIxb2AQh qWYmmGXvZ9pWawPccG21Cb0HEgVfKc8f7jOIcXACXG1WBkXgG6Gsr/nX/h4fyc3iQ4JC YYBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:date:message-id :from:subject:content-transfer-encoding:mime-version:dkim-signature; bh=MoNAswUM+Q/R6WRSRuOVtJJz1cmEOnZhOrjLYohzlvY=; b=mqOcW5Vdda1WLhkV42DFIi9AFG+7F5kJ57fOG4Ip4vbncmjaDx2K04hOWfECtUoVrn G89q2bpkz7NQd30W2ionzDdKJDjPmmQOmTqv1bQbOy09RVZXPxEehKPKNY9DoIgQ4HjW cpzbku7AuuWuqHAHJ8msS/XWmVLQzmYDuyXV4VujmhpC7ntv+nUMeMIbCZgJijfPHuP0 84jWAFyiXB+u1xYohvSaJ6GUghYt5RHbPGqXRhd32GXlcT3tY2dnq2cYfyV9yYHMjN4X fZYm077tWdEq8miyUpJyPfqALxBiMPG+haiBPKSHdcNKgji6O5WP6x4FsGBziBh0RrOS jECQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b11CITgF; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f192-20020a636ac9000000b004398a434162si558174pgc.340.2022.09.14.13.12.21; Wed, 14 Sep 2022 13:13:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b11CITgF; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229741AbiINUK1 (ORCPT + 99 others); Wed, 14 Sep 2022 16:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbiINUKS (ORCPT ); Wed, 14 Sep 2022 16:10:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84FB91160 for ; Wed, 14 Sep 2022 13:10:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 80E5F61EDD for ; Wed, 14 Sep 2022 20:10:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id DDC78C4347C; Wed, 14 Sep 2022 20:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663186215; bh=stVRc1yS+SOK2i5XhtLCYosmNa7H/zyiLN+LsWBTwIg=; h=Subject:From:Date:References:In-Reply-To:To:Cc:From; b=b11CITgF1WHzIJmEV9yPJE5FCYnDLVzgH3TIXs96emL/a5opvbH+jJgv9iu9zVaaO AAbP9NGKN4tFlFqS551wuedO2Wz8ORESszIsagHpeGX3e/5x57FPjsS4VdkOZoKy6M Qu3sbqfaASPhvaJlAIZphyhLqBCyHmFidmZlvhwxRTMFazixopdnOKoNBX/hw8K7ec +XJdWLE3loJfCYSw+mXsEBTWSwi+OMAVp+dfEwYHQ2qh+euscDmg5rhA1yUje2xKME HAJKaqMdAkBhsuGTCTq+rr93j7K8OjQgEdxhp7a+nWBBflx6b+skfJZUPuZH+vnT07 SyoPrxol2/oow== Received: from aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (localhost.localdomain [127.0.0.1]) by aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (Postfix) with ESMTP id C9E8EC73FEB; Wed, 14 Sep 2022 20:10:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH] Bluetooth: avoid hci_dev_test_and_set_flag() in mgmt_init_hdev() From: patchwork-bot+bluetooth@kernel.org Message-Id: <166318621582.18930.5263572054834552054.git-patchwork-notify@kernel.org> Date: Wed, 14 Sep 2022 20:10:15 +0000 References: In-Reply-To: To: Tetsuo Handa Cc: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, syzbot+844c7bf1b1aa4119c5de@syzkaller.appspotmail.com, linux-bluetooth@vger.kernel.org, syzkaller-bugs@googlegroups.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz : On Mon, 12 Sep 2022 01:21:42 +0900 you wrote: > syzbot is again reporting attempt to cancel uninitialized work > at mgmt_index_removed() [1], for setting of HCI_MGMT flag from > mgmt_init_hdev() from hci_mgmt_cmd() from hci_sock_sendmsg() can > race with testing of HCI_MGMT flag from mgmt_index_removed() from > hci_sock_bind() due to lack of serialization via hci_dev_lock(). > > Since mgmt_init_hdev() is called with mgmt_chan_list_lock held, we can > safely split hci_dev_test_and_set_flag() into hci_dev_test_flag() and > hci_dev_set_flag(). Thus, in order to close this race, set HCI_MGMT flag > after INIT_DELAYED_WORK() completed. > > [...] Here is the summary with links: - Bluetooth: avoid hci_dev_test_and_set_flag() in mgmt_init_hdev() https://git.kernel.org/bluetooth/bluetooth-next/c/f74ca25d6d66 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html