Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp120097iof; Sun, 5 Jun 2022 22:59:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXuv1fNMb/6iURWFqsq8fJRkGx/CWBF9fuSJgngL+JBJ7uROt9XxQoLaDx9hC7vnnkQSOW X-Received: by 2002:a62:3646:0:b0:51b:91c7:fd4a with SMTP id d67-20020a623646000000b0051b91c7fd4amr31548126pfa.78.1654495148567; Sun, 05 Jun 2022 22:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654495148; cv=none; d=google.com; s=arc-20160816; b=vdjm+TLPDnjJQIt3GsQnb1KAWs7tKINVm8EMRP5STAtNfWxSqgcrStxYDflTx+X60U yzGzvYcrWRLIDo2K2eDBwEs0utqp0HM0aI0/XsUB83i/df8JBWRvzTJocUj46B41pkPc EsNdkKQjzfdF6o5eVM7AWttcyMUEVqqtOlgxslF93ELDjL9ibNhsM5kSJV34H2YdJ+gh M5I+fJyb/nG3Z6zdq2p+B5Sv9Tmfe2I7f6wfID0CxiG0nR+ZoM0hYX+nSPtg3TwkGdaV rhvUWTWF6vwiI7yg9VYXg73gcIcEWt3mm85KgmkmhiixiLyN2t4ZN+TNHXUh2XGStcGU /Ejg== 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=Tqe5mxEbjqIqPi8Yc940RoXdgtQcko5HFQU08KGwJTM=; b=Tx8qbea0jsvzM65g+FPxEKo0GDy66OR+USsShj02xRIU2yAbFqnR1Kdj07vbM85oGf Jagcx0JGa+I02qY9Z7g8UtOQxn13Jw/iXphl93T/7mxJkB6qnrtrdTKEN7clvxEEBsQw 0Eg+K9uMoxigf+VkhEYJLTgrqCce83OYYh/mCz9LlbNSaIWWwz9txQTqu84Bh2c1MZ/K rTU/DdIMfCAA0HuXDBhMFWlntwWzoO+fYvm7gzkpRCJW98JY3ADoqSNwAQo2g4fKDxwg a94j+dNtBodW/B0NqtloFuMi5fdnXJB5FWzhutvIT+Zvcds0DtgHtjQAI9SC+zBB4pFN McfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uV01uIL7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e12-20020aa7824c000000b0050dd2797010si16772158pfn.321.2022.06.05.22.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:59:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uV01uIL7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2413E2F0F78; Sun, 5 Jun 2022 21:47:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346517AbiFCSEI (ORCPT + 99 others); Fri, 3 Jun 2022 14:04:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347275AbiFCRwL (ORCPT ); Fri, 3 Jun 2022 13:52:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2504713E9C; Fri, 3 Jun 2022 10:51:57 -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 B687D60F3B; Fri, 3 Jun 2022 17:51:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF593C385B8; Fri, 3 Jun 2022 17:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278716; bh=tfgjU31NPL+z9713wFziaUtlFoPM/QCEwzK8ujtven8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uV01uIL7yYahrUm1ov4hLIijDLv7R3wkQioVpB1uBQpXeUrN/pMicQQN5+rhELHHb YVBxtUFaGASQb/k3wNBGF7/VWrU1qewwrGXWBxbg+q40OePh7AplRaf78Jwts3RVwl 3+hbfckBOXTgtITSFYbMAq0FUs0P0yAFXHKM4r1A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , "Steven Rostedt (Google)" , Marcel Holtmann Subject: [PATCH 5.15 40/66] Bluetooth: hci_qca: Use del_timer_sync() before freeing Date: Fri, 3 Jun 2022 19:43:20 +0200 Message-Id: <20220603173821.830759872@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173820.663747061@linuxfoundation.org> References: <20220603173820.663747061@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-kernel@vger.kernel.org From: Steven Rostedt commit 72ef98445aca568a81c2da050532500a8345ad3a upstream. While looking at a crash report on a timer list being corrupted, which usually happens when a timer is freed while still active. This is commonly triggered by code calling del_timer() instead of del_timer_sync() just before freeing. One possible culprit is the hci_qca driver, which does exactly that. Eric mentioned that wake_retrans_timer could be rearmed via the work queue, so also move the destruction of the work queue before del_timer_sync(). Cc: Eric Dumazet Cc: stable@vger.kernel.org Fixes: 0ff252c1976da ("Bluetooth: hciuart: Add support QCA chipset for UART") Signed-off-by: Steven Rostedt (Google) Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- drivers/bluetooth/hci_qca.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -696,9 +696,9 @@ static int qca_close(struct hci_uart *hu skb_queue_purge(&qca->tx_wait_q); skb_queue_purge(&qca->txq); skb_queue_purge(&qca->rx_memdump_q); - del_timer(&qca->tx_idle_timer); - del_timer(&qca->wake_retrans_timer); destroy_workqueue(qca->workqueue); + del_timer_sync(&qca->tx_idle_timer); + del_timer_sync(&qca->wake_retrans_timer); qca->hu = NULL; kfree_skb(qca->rx_skb);