Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1339976rwr; Thu, 27 Apr 2023 16:30:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GRS/Oeepb1Enh+MMrmM9X9AmDlX58eL/abO5Ef+uaSj+o4gFEt0DYXdNdPBbQYwI+YOSv X-Received: by 2002:a17:90a:d506:b0:247:3fec:e732 with SMTP id t6-20020a17090ad50600b002473fece732mr3445995pju.13.1682638234510; Thu, 27 Apr 2023 16:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682638234; cv=none; d=google.com; s=arc-20160816; b=DEVCQ2Ng144ouNuJqbRi5F0fJTwu8DnMxGOiQIOqjhXWnl4jbkLwpcw8r/s4TiQnWT 8gzeZH7y8l65ivOqNQ/jifkaHHTlmmrs0B3Oga3Y2Ebx9SrTk9fJ+eoW7gvIL32QQ1nB c9mFA+N5UqQjID03LNhhk8zXl3NsLbL4rWJ/0ewrq2/oT6GiGkLPZ+a7ETay81WvtMJK 3IiKiaS9n4wFxtQHsIr2uwuaRaOq61FRwpO51RwmT0TREmPip88oBPARyS7xgSbo3xo2 f+zMPjHsb0netZDpTyoSK8WSy8i2hmMLroZGIqi42YBYzRqOCafCgg+BKMFi84dZX/ab nO2Q== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=E/6BjiB3CztTfLUdP27sBZNVOKuIvJqXf2EZ0PwMXGE=; b=z7zaBRMqQaPje48PznJUjsKZw/+jcA7wSp0ndtKwIUumVIEmjff/4wKIN/E2ZEbqs8 0reuXNmfvSKQSumC3J7rNlrVjElNdpjEfLxxU176/0DwXjHbgtwbfzg2FQckMObqMrNF G77N8ep/K4Byi5TnMhe9WSuTteZHKvJZQScrDjL7g42DNlcGHXTX/5k0yDibzGFNYfBP 4rN/hwU0/GLeg9LY3iU8fPMxWMZvDYv9O81mSfT4aN9eR1/CINAAn3fbtXBmQQeg5chR Om0FafoeljXdRc3d35d7RwqB+ohJYjLu3zgDC7UJ8s9e+64K84s6GcnV4+rtAoKf4jQs iSUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="UKOCOv/C"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a17090a6f0100b0023699c44b66si755456pjk.167.2023.04.27.16.30.19; Thu, 27 Apr 2023 16:30:34 -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=@gmail.com header.s=20221208 header.b="UKOCOv/C"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbjD0XOB (ORCPT + 99 others); Thu, 27 Apr 2023 19:14:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344399AbjD0XOA (ORCPT ); Thu, 27 Apr 2023 19:14:00 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76A8F272E for ; Thu, 27 Apr 2023 16:13:59 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1a516fb6523so92930795ad.3 for ; Thu, 27 Apr 2023 16:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682637238; x=1685229238; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=E/6BjiB3CztTfLUdP27sBZNVOKuIvJqXf2EZ0PwMXGE=; b=UKOCOv/CBXUfnQVbEq4cO4b+YoohtaUpo8Hcr3T4Xoajzxy/LxRrRIawdCqrjxCz4R ezj58lUMhqLjM4l3JxNjlkARzG31rTN8gbSppYGiz+M7ZHy+IwQQvAKdNLUzMFOeOc3w psWB7OSaV4C7TI2yx+ijHkgvGS/GMpWFXb98xaPCwAUH+CNKOYfoE05kMtgZKug2FkZq B0D13SSDdMEIsIQKZzkIdCExcmwwvWvW+MbcBhcmLNAgK8vWtR/M10vYcb9dUrYcfTBu LBs/pJBiOjQz4zrhLfCINmFazVyLabsunGlWe0SNQB4M+tAR08qVCpTID/ZBX9XCABIb QAsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682637238; x=1685229238; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E/6BjiB3CztTfLUdP27sBZNVOKuIvJqXf2EZ0PwMXGE=; b=J+y7xpCPUbnqPlvWv86E9UQZvYOb4HHina7AYW+/gqtPiYmUwxopHad2IEfwrQA7ia b3jTYGV7SDO5p18s380frN4YHHpK0fiS4Xl/owucE1i4pc9VFJ/TluAQqQSqv+EMkfky uyOr2Idd5iZQ2K8CBs0FjxoRMXXhTdzG0xcbBmb39TZvnLQpqm6P3LOGxHE45OnIhEn+ GjciGSM+m/nB3eG+pA6eVL6v0P+p7vPETyHnh4WJKlLcR3Gb/+8zPvOG+IVM3MkeNmRO H3w+SVXYSjM+JM1x2TvVo5Bb/v+CDEp7YnYjJGPmihdg2KLbM+MI3n5O8A/cX8vl9Ijq 3G8g== X-Gm-Message-State: AC+VfDyEc6wTAApL6mHjxkksa0gFU4m4M5eOgDCIGv1mKIE4LcfVgGJg 6fvrPPFvLcqBZURSgjAPlEhVEETZRFU= X-Received: by 2002:a17:903:32ce:b0:1a6:3d8e:face with SMTP id i14-20020a17090332ce00b001a63d8efacemr3906178plr.0.1682637238095; Thu, 27 Apr 2023 16:13:58 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-59-129-171.hsd1.or.comcast.net. [71.59.129.171]) by smtp.gmail.com with ESMTPSA id c5-20020a170902aa4500b001a24cded097sm12112369plr.236.2023.04.27.16.13.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 16:13:56 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH v3 3/9] share/bap: Fix not removing timeout on bap_free Date: Thu, 27 Apr 2023 16:13:46 -0700 Message-Id: <20230427231352.576337-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230427231352.576337-1-luiz.dentz@gmail.com> References: <20230427231352.576337-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 From: Luiz Augusto von Dentz This fixes not removing the process_id timeout when freeing the session which can cause the following crash: Invalid read of size 8 at 0x18EB39: bap_debug (bap.c:553) by 0x1913A8: bap_process_queue (bap.c:3542) by 0x1A8630: timeout_callback (timeout-glib.c:25) Address 0x55e0650 is 128 bytes inside a block of size 160 free'd at 0x48480E4: free (vg_replace_malloc.c:872) --- src/shared/bap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index bc6177a5ba90..6131c312865a 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -2600,6 +2600,8 @@ static void bap_free(void *data) { struct bt_bap *bap = data; + timeout_remove(bap->process_id); + bt_bap_detach(bap); bap_db_free(bap->rdb); -- 2.40.0