Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1116439rwr; Thu, 27 Apr 2023 12:33:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41GglFUQtnadsA4sUjFuus9rXuoMV5QMbIhmtC+vls7mQi85kQ8zkJ03FkXZBgY5/chaqs X-Received: by 2002:a05:6a20:a3a2:b0:f5:cf7d:fcac with SMTP id w34-20020a056a20a3a200b000f5cf7dfcacmr2744566pzk.37.1682624035321; Thu, 27 Apr 2023 12:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682624035; cv=none; d=google.com; s=arc-20160816; b=pYzgzSZ667GGCWGUaomewKx2czx6e3DlDzyj8tg2kN3fb77TngnHGT+aD0/iq6EP55 aEQUyRpLcqKE8MWVYL6jMLESc0dD+JpDuby4C1xqKMvFcM4rcH46UA0y/pzHMH2wTc+m t8E24nuDXkz/M29b9nUSz16LkgXmHNHfS8U5ny/god03s1wtIt5OMfltXjnbW5KU3zZu oiEDptCYhdcU1tKl0E5l0f8wMAZHsO9Vxf+WtfqfoRcLvPs9kM03diiiQ7tYUObQ0wSG 8Q6MaRDP/l0/L4cuZjyEMHB6rBZJ+P+d8bOtp9OSI0xsxkCZ8TfMY2+aSFlE5oPmF8JU K9+Q== 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=Un6PhaeqG/c9I0xZFW28/e2EQnBrCsv6A7JnaaHiw+KeMtD8wQ/+cL7ytZlgV4g+36 0F0Nwy4rUKnYvkN1JguFBTQTHvqkiff1RWeD/qw05+z8BWsd0EvzyNBquw5ql97Vooud 7JLwR9NOL0g8rMtTK++sbCIPrOXgdHuEl/kw7o43eT05OvxCvI/OPOAO5fuZcaPEsM80 JpY1sIOnGWMNxriqyctbHgkFT8iCdAXNYkRPT9OZ30j91YlyPso9Pj0SP9zTg3B1UEIi D3VXB/LnWZ1OuDX4yS4kxBdUVzAZxsSUCgG0snNomZLJry6YrqvbP8v/EaIkbMyUwC5c 3DkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="XaKz/mw9"; 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 4-20020a630704000000b00524b56d9e63si19514182pgh.324.2023.04.27.12.33.34; Thu, 27 Apr 2023 12:33:55 -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="XaKz/mw9"; 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 S245525AbjD0TdF (ORCPT + 99 others); Thu, 27 Apr 2023 15:33:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245514AbjD0Tcy (ORCPT ); Thu, 27 Apr 2023 15:32:54 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98E3E10CF for ; Thu, 27 Apr 2023 12:32:53 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-329518648ebso68973435ab.0 for ; Thu, 27 Apr 2023 12:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682623972; x=1685215972; 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=XaKz/mw9Y2g0L8T4QZtLPLHZv+bk7NMwidoFU/ZmMh1K+AhwAEMBuy1xnJimPikhcG Wg50N2SMQlR9ipJ/Oj2V3syIsCPxE/kyylyVZbyO5V217M5odXacrBxy9eHViV9UFcTA oyAR19TPxJ8HlLjMut9u/tQjxrmiuRgn0D1kA078GYt8lqpHDgkdYUdrKEpprBDdIdvP xMFbj+X0bWAA+MZWY2cPVp3WUYNejbMPSfbiNNFfBrwpm3DM+QErjm9kanMLqk64RxrN tAQdbVrgtLdw7Lds5RQ3cueqDnSpQVVJZog5CTEE7YKZS9MhScEem1FFEUZaiHRq+nea v0RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682623972; x=1685215972; 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=LCe9ngwnyFZx/Du3726HlOcJxIHP3ySQ/eOrdO0hmBfj7al9M5HlpcP3Q0jSE6I1IQ QnZwVqV3eoZGE+ymjQCbKwi3ynjJ39QlydTdn/j+zzi0I3BKrdzoiviUl1giNJMGssq9 nhV4Zp1LjtMmi8m6yzW5mP9agwu9cnb0N3/vhrmt8jm9WniJQV7QMG0l8ix3NneAhhCk DfVkLZ+ocV+FEPQj0MO9/N8TDvDjhDZ7Dw9NhJswXjmuL5OO3svvtp8Yr3tRRXG3xAvC B4Cts2MOhzlvKPHJmCwZPNQ9nwICxIOzVLtjjHbWcyjLSkdjorwDxA+K8hoxnoW45egK +q4Q== X-Gm-Message-State: AC+VfDykRTq6XLtSdxHD6bOvy3/XfJ3DIUB7okdmFYVqRzLIZkMUg6q2 DFF0edFM9EDgg0CRzApZADE7/DvLjNI= X-Received: by 2002:a92:2a0c:0:b0:323:1869:15a1 with SMTP id r12-20020a922a0c000000b00323186915a1mr1874873ile.25.1682623972162; Thu, 27 Apr 2023 12:32:52 -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 n12-20020a056638264c00b00411baa5ec5asm3349898jat.154.2023.04.27.12.32.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 12:32:51 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH v2 3/9] share/bap: Fix not removing timeout on bap_free Date: Thu, 27 Apr 2023 12:32:39 -0700 Message-Id: <20230427193245.323502-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230427193245.323502-1-luiz.dentz@gmail.com> References: <20230427193245.323502-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