Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4676784rwb; Wed, 17 Aug 2022 04:24:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR77q7hmf03XTpWgwTIBgdtJGSblM8PmQUcxcms1idtORYkKOORUUU2+byzFNbGzfA2i4LRP X-Received: by 2002:a63:5d4e:0:b0:41d:dcc3:aa85 with SMTP id o14-20020a635d4e000000b0041ddcc3aa85mr21280238pgm.324.1660735480314; Wed, 17 Aug 2022 04:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660735480; cv=none; d=google.com; s=arc-20160816; b=nKCRXTqzOZBcg4tLrqk6kJX55FoBdPlADkldqeI5OZdipjFZpk8omoXmHHw3AyK8eF NadBtkhXQhO3069e40oJitEhC5emSWPXN9M/XkQQTZAACC8m4HazwPbHBw+7GJ80Y7Tz gpIct2MTVNixIhOweN7PH/RGTfwiHyrxo82tiUKLYCTpk458tXbWktW82/BkSDnYK0Em SxgJlRZZYybK0kcA0X9u+b9cI4XwFsXsxDXoWtbssMyIT0hru28fOmpMddek6HlRwL2a KC3PUcL5zAeMP5miDQl9Y+u78x4/H3PFdYz4g5kuBA7auG2ZwWhog2LkfC4ELKpbkqR8 MrzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=Tf5nyuS4SmXDDxvSaVOU9kg1xhBPTFGKmDLWI/9BP8w=; b=hHxaTcMC9bU5734GrgVCsk3aVjrjsPKjjqm+4XPPvxRgUbnM8ZslKJo11CZL+eJGSV JiJ64AcJxAZMs8/V7ZThnPa6qROxNbjK6axTgRWHdy59k14BgZ3t+omP92yiEARG8V6t ux8d9BkXXj7ZvhATHxmZQvrcOkqcGg8ycNPqHxjvjuINqRk1Cl1GpS4TRM9l0bFraqWH s3Jk9eqqWWwWiyXhYhArIddXmN6NECDR8VcWkMNSzgHPTr0GSI8o3Q2yEKJru+Fy9BnX DYPL2frNBXwWOlSsqQVb67Rf9kxox6qrDW7Iqf+CYVxnmcyIMbeR6HEKZEjJSpdcpjmW pspw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iw18-20020a170903045200b0016cf03900absi951324plb.492.2022.08.17.04.24.15; Wed, 17 Aug 2022 04:24:40 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235516AbiHQLOm (ORCPT + 99 others); Wed, 17 Aug 2022 07:14:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230122AbiHQLOm (ORCPT ); Wed, 17 Aug 2022 07:14:42 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CF3554671 for ; Wed, 17 Aug 2022 04:14:40 -0700 (PDT) Received: from fsav411.sakura.ne.jp (fsav411.sakura.ne.jp [133.242.250.110]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 27HBEbQo079590; Wed, 17 Aug 2022 20:14:37 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav411.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav411.sakura.ne.jp); Wed, 17 Aug 2022 20:14:37 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav411.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 27HBEa7N079586 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Aug 2022 20:14:37 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: Date: Wed, 17 Aug 2022 20:14:36 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: [PATCH] Bluetooth: hci_sync: fix double mgmt_pending_free() in remove_adv_monitor() Content-Language: en-US To: syzbot , davem@davemloft.net, edumazet@google.com, johan.hedberg@gmail.com, kuba@kernel.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, luiz.dentz@gmail.com, marcel@holtmann.org, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com References: <000000000000d010b705e66d8520@google.com> From: Tetsuo Handa In-Reply-To: <000000000000d010b705e66d8520@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,SORTED_RECIPS, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 syzbot is reporting double kfree() at remove_adv_monitor() [1], for commit 7cf5c2978f23fdbb ("Bluetooth: hci_sync: Refactor remove Adv Monitor") forgot to remove duplicated mgmt_pending_remove() when merging "if (err) {" path and "if (!pending) {" path. Link: https://syzkaller.appspot.com/bug?extid=915a8416bf15895b8e07 [1] Reported-by: syzbot Fixes: 7cf5c2978f23fdbb ("Bluetooth: hci_sync: Refactor remove Adv Monitor") Signed-off-by: Tetsuo Handa --- net/bluetooth/mgmt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 6e31023b84f5..3d2e0773a1c1 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -5054,7 +5054,6 @@ static int remove_adv_monitor(struct sock *sk, struct hci_dev *hdev, else status = MGMT_STATUS_FAILED; - mgmt_pending_remove(cmd); goto unlock; } -- 2.18.4