From patchwork Tue Jul 16 08:11:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13734117 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013014.outbound.protection.outlook.com [52.101.67.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 965464D8CE for ; Tue, 16 Jul 2024 08:11:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.14 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721117506; cv=fail; b=jEZCO/8g1WdJJnQXjZWnbY9Gs+W82SjnccR8Fg7sBqd4VyFxqku8LzT3wsnpLFkKEoEnAkU6WxhHnoL7i5zaZ6BuRNiytGyY0zOSe4Dovu0VXomtHMZN47Ttu68sK5IOxhHbcmEMQXL4+Y4NWmycyD4CRWSzMrMaBtoi475XbJQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721117506; c=relaxed/simple; bh=JHpFKhQy780zVk1lPsYS8zwfwpNcrDTF2H9cCeqO6Cc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=RkSWlA8NjXVpA8b2w2rlXay10ynGlMkKhNdUzj7aSzfcNWzJwjVzq9jV/E/dsuGnDM0F+x6tt4g1r13wlIXaIcALlcBbNtoC/1h21S9BptNvZX+tURIwfjgOQ2X6VsKycr6SQ9x/225BD76PlQoSKnjMzB6LFODdQAf24ZbKGZg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=hHsxqgNe; arc=fail smtp.client-ip=52.101.67.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="hHsxqgNe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TZmrXNPTKq3bYEE0V81OM5lx5d4cZIHdMLr7O989U9n6HZNX7fn7gvkMhAEFS/A2CnSRNMs1EYr/DxhZdNrvm/4T3yfG6OosTAp36P5fnvVk2Zb4BKqVyZwSSD9QCejRCV3cc5OyHRVdar2uQqMN+lZVY0pZlyxU+iIqUHI5mjirNEiV8Kjx1DeQ4kYWcP/IgEPix2qEY7XCJjF7YzPzTD/vj4EmBYr+sspZkG8vyG2I5is9MKisH/X5JjWuTtr6aI5RXpJJ+H8SemWNiiwlfYORr9izrNp40DnRkkAR2cH1PChWUe8cWcYXxH2IV1hFaFT9+GIjrw4fEZiB1zBU/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QSFvrCKGHb00vcFPMwdVGSPz2v3yAo9Nc84lEYUHBIE=; b=lTSldLRz5PY1dLzjMpy2HRhfEa8bFvl7YlTEOSW45MPGqnlvyWp0+yEgLgRrXQpWSLPQjJ6y38jzLG/0Pnn9saAnqDvDZF3vZ1RHoTwMIgo/lDA3fxmTWNqO7xF3QpwAwYjI2Q4uHk+6a5JudAkSFxMGY6qhuXbC9JJGyDl/gqzmEKTDtdxnngJQOT4/qDN+kVtJDkBzDI9Byio0yema0h6TGh/m0e7JcM9OtvY0QQlAtR5pnhgBkr8lFzok/SGkHy6BLBiFVQ4RmSbLSBn5+ayLgQbgFUXaFShDb1i6XYDJB78O+ZMG+A0NqrCQqcv8UUQ2GH7lu1VhkXGgQ6tWbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QSFvrCKGHb00vcFPMwdVGSPz2v3yAo9Nc84lEYUHBIE=; b=hHsxqgNeudGxi8E5vJRedCy/4wdsn3NH1JHtFfqPsrg83Gg+PZmqMptAry3fHVH7ps5Wtmk6WmhSHf0FpfrICC0beIJwo7+v35f/TeJq2Dbpap5es21s8XCnhoFtabky3TeUvPmcJ1eCEbKhHg81YK3xWEQzaBkQe26ENkdOiKM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) by DBBPR04MB7881.eurprd04.prod.outlook.com (2603:10a6:10:1ea::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Tue, 16 Jul 2024 08:11:42 +0000 Received: from DU2PR04MB8903.eurprd04.prod.outlook.com ([fe80::2cf:c259:f258:efa8]) by DU2PR04MB8903.eurprd04.prod.outlook.com ([fe80::2cf:c259:f258:efa8%5]) with mapi id 15.20.7762.027; Tue, 16 Jul 2024 08:11:42 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 1/1] bap: Fix crash in bap_bcast_remove Date: Tue, 16 Jul 2024 11:11:31 +0300 Message-Id: <20240716081131.14893-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240716081131.14893-1-iulia.tanasescu@nxp.com> References: <20240716081131.14893-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4P191CA0015.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:5d5::12) To DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8903:EE_|DBBPR04MB7881:EE_ X-MS-Office365-Filtering-Correlation-Id: f00dba0b-fa3b-481b-2e92-08dca56eed3f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: Kl6e++mBgvJJkq+qACPfvlZg2txeYaaD/TCCnLSHVl1Vw8hyik5u9ZE7l0CT+xceWJSnwoP5+yqoDqksEX3ebuVOE5yyDZRIDB1SEC4kVcZyNHzhB2u5kx6iKGN3KjGucfcKKiZhNv71TEFVQqgFVx9TBydfqzOlEV/QGVC4gzpcGFhXXKnilBsO/CaxhvGW/ciBOLhEErQ7bo3dHcS5Ss4sTeAJ7Rz48lxFYwOKlMzvMBEwrYNvQPLCG+sUc8BNAMt+FMfSpJg2xL1Y3at7sY3BCJEG5r7wDHZTzAFMp/U+mqg2EtsrJyltJblZvIh45msqKZkCdFKYwCm0O8ZU/ZQsHThhDHapToI85d4uypXmqefAXx+SqQFSBVT3UJJmwuqQh7rU/ievQgaMLEP2T25d3XWF25WEOGgZDyld81cxExjbDX9FcYvtsxWILPXon6nRSAZva6t6icPokBZ1Q10l7pGoIxWC5SyRzfMtqWYRBXpVjhwyE3msjeEeGgnQfh4h8MVtqm46kNWu/cueQApgdQXlXHaSICP42Xumm4uw/s9L0hT0pJZOViZEl5Y4w1BeUQFPEJNHbGAKNkFs4JXV2uXC691yvg62GqRpT/52RpEFLkGYiQBVmNjZOVbfa6YZC4yuT+arQtua1vTBW2EJLdhiyhOrM5ULMj0g6sbPwMCnRuSPo8seQ5HbDi2K8s1nze08ijuFDKo00I66R/S0/QS7DIw8VudRSIBD1JyZirlFX6wubTuhoeHJlLSdgsl28n1eMOZdjTVijeXI+qoMtADYj4xL3hfgEQ//yX7zqe97nONcpX2DwThiFovwnWC4+TIIfis4LWIuhQaxHevIPA+ZmOcw74urxd7jPbf1bFTwV8ebmo4tn3VTXrgjayIE4C0i0hmthJYJOX6uWbOYh5xzo/4W6ZXRj/ePf439vhan1wpzdBa3v5RdlHWvRQafieaJUVW/eCOMRb6+5TGkap1Ye3idXnkeNhhN4l8Wuh2b7UA+h0W/A5ISFIQUgG9EdfIgarTd1vSizC+Yg7EsLpIqjoM+fiqQbzJBVqZ1ztaHRj4VY3vmrNOoHGs0bJmXvCtWnYzpo18F8doDOPvuOpkptZDL8CuRR7I7fGWlKKHopfGMN9GJD0OsIFzTltN9CtfLWg+IeKyc40lfLY1GmvlSDkVq2TqXuLTt55NHkk9Y60LI6Pn2UDwfKCE8aCzpfH/oE3AOG4b9JkYKvskLebt1yZtFs3Xw+Be1Z6YciX+SYUPVQEI3OVzzWGizE4fwjHv0zKbUcRsCA00s0PfNTys7s9soTO2LuLEJBVMUTj1MlWV8UIvbjjx6aAKuqYe21romsMNctP+BN4FpzQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8903.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Lxa+xzvcZnW7KXlSJdj4zwMF/5so699ahIe1ZnDXPOqL4+S6vbITHLA9fIbS96z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BDTtDa0i8UvaxJJCq+d/zcpbadObKiKG8gWQhjN/awCPQ01nj1QDyHVYdSMFZ4PSUlZscS9MXCZGGFZtD2Mr1TXy+KYW909qA9rNChLgaag89KnRzw5ILLbpD8V5umWN+3xfS4GBsZXqIQLTDuc7v/EiTe1MTpvbr77+NWMzod8AhjzAiN6nLfwY3JLIWphds+y9iD4q+Tqjsl3/4B52MNRwsOPo9gh2VALlTLhCygU8lg0cGUxB4raj066CaNKPTYZpxb2gEw+kDhOVHHsK6xNyYnBiKgu0g/MTeepCER0uLsFMPyxJOYdV36B5dEou+UjwmRM4vZ1TliLMcHYKC5pITJkE4meE9mSTAwR0q+PwHkE5RWgzunShkvOTuV0LgaXNnw6qju3EZ2JeZQXYJpGbKm7N5VnJXoMO1Vd+fq3gtG6Lwsv7Ql+aNpoIGxzjwBkf2Fm7IeOON2ZycS/6XIoX70UO3qTpGw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f00dba0b-fa3b-481b-2e92-08dca56eed3f X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8903.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 08:11:42.5966 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HU8U/HDf21j15Iybt0CB7tHo8+CrFZ2FjjERxQvfPsZMvtYiPUCcpXbg2GaPv90F79VZt+Fq09y8hQUS+rJcSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7881 This adds a check for the PA request dequeued in bap_bcast_remove, to avoid accessing a member within a NULL pointer. --- profiles/audio/bap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index afa938091..16c02524f 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -3194,7 +3194,7 @@ static void bap_bcast_remove(struct btd_service *service) */ req = queue_remove_if(data->adapter->bcast_pa_requests, match_service, service); - if (req->io_id) { + if (req && req->io_id) { g_source_remove(req->io_id); req->io_id = 0; }