Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4489466rwo; Tue, 25 Jul 2023 06:57:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlHOFQEGXW+lGqQ/DpZy83jsCcQ/QkG+80GW3ZhH6hBO5aqIItlVfDtICq6xX7cAgR34P5KT X-Received: by 2002:ac2:57c8:0:b0:4fe:ca9:d9bd with SMTP id k8-20020ac257c8000000b004fe0ca9d9bdmr41976lfo.56.1690293421073; Tue, 25 Jul 2023 06:57:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690293421; cv=pass; d=google.com; s=arc-20160816; b=jafQVM6aIwCyQtD+RON5/1XOSzGwUNe6Zjx7jBenCbV3BMT5DB8lUG95z8QkcmOX3n kmpX2j6yDFm+inJXg1odrtVC7NX5aEiNkyt4ejTGszSBPoZObELcwvknzRff+OBbM3Wf xmbVtHpwP0gxtTD7F79vr3AdFMbZeSNn1cM9E0X1BOQTcOrZzTx+X9bVH9TyhDye28uI sVCB7YMOr2uN4pRBy1Y6HnFSQ1f4Mh/SNNq5hYyFrwGm4e4v6xghdFExdKscRclAhmYC 8TcJyf9LchlpWA/dx4FBJ6oHR7bbFtLszYhXVhN3+Vra0DWFmGda1eitRvwFgKxeV223 vWSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5e+kH7jbavEfXy2CI+FXctgAclZYu0bRugEzfUjGJ1E=; fh=O7b9e/0FHf0lC36zxfkGCP11r7lJVOROe7GJbtvFS9U=; b=q4vz920g5w0bEKOGK/0L57gQ21TwfdH0sTfn7+dfj3oKS5bY6eLWVK5FIe2f2n9Csd shHyauhPPY4b7XCwlc8Si0rbgwRgJBzY/dvOqSmGqgV9ArJaUS0toRPFt/BzBEWkZUV0 RZXCMnA5wOts7vM8NEo6GZI0rHoMQiLdE95gIbXYR14DzRSY3Kv78C4fZ2qLRFNtpipB mY3bSbjkFAU7YJMrAxAp9Qki0uBNyvkTvx+wUCM6FSNZdLuJby94h5fIPVM/vhjFSWrk 0imUNBOatVKBHJlQMmOvp8tMh42BiqiBS1K4gB/cRg/6WOdgTIyTSKyODlOnVqpEHleZ UPNg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=UJJXfWBd; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t6-20020a170906268600b0099238b86ef1si8515024ejc.164.2023.07.25.06.56.34; Tue, 25 Jul 2023 06:57:01 -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=@nxp.com header.s=selector2 header.b=UJJXfWBd; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231462AbjGYNsT (ORCPT + 99 others); Tue, 25 Jul 2023 09:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231664AbjGYNsI (ORCPT ); Tue, 25 Jul 2023 09:48:08 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2081.outbound.protection.outlook.com [40.107.6.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 354D4A6 for ; Tue, 25 Jul 2023 06:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Inr9dIYMyDNs2XBjh1oDRQaT/o0phLojmTG/4nUlNB+gGhT/WgPnOfb0ftV4wSFVVoVUsF2A4c2+VeEZVD47GGGMeWreC78JanIbrPkysrbRCDMiQyOP1SYTQI80Ebp25BfO4hTepxJuy1cMVeRCJ6l5ZthmPlJlBsskc6dQndMtujuw5RzP5YxVgdJlsrFjS+CaQdHnLpvn6mw4rWcniiK/Fngv3/t8r5673MyWkxV2J/ktT4Ux2MZfrFu4NjrCWyjkWX+4e927tI0DUH01d1hdoti5CmFULcdP7JKxCiFZHROPmISN8OyFpPggvFTAFBqO17EYBY9Cv1+HbrkNXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=5e+kH7jbavEfXy2CI+FXctgAclZYu0bRugEzfUjGJ1E=; b=FiA1XHYm6Ip+vwQWoD487S6Da090+v2JKzKGDx4u7ujnKgHDeZqxoaXNAeOt7zRshEnxjrm7KkbxT6kiTI6VI5DfQnMj0imMdi2JUJ0cYVFamc4feePpBf0cKkBzH0+plfgphuVjzgRVhyBkGGlKP/E6BYxQUKn2bb2Nw3kNdOccu4mZmD4vW6dore3g835TIVWF50bbLTIudSfCZIzjrYnhtLJW0gVr9pprZ7MQtJnUliZdNqzFbf7vbwWYcNA/CGlojj7tyf+nRWWD0HmQDqP9InPAOBcIWFrhUnBgtjG4N3MWHxXwggswoHq5Tr7maqzGoLjY+T82kCuHds4c+Q== 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=5e+kH7jbavEfXy2CI+FXctgAclZYu0bRugEzfUjGJ1E=; b=UJJXfWBdW/DNK/GfWhUc5utjuKUXgQZABu/FYCGhEjuC3bwLKZbc3qalx5J9GP50WlqZDXu8DefkNMCkJyUCwKt72jzTOuIovkZbp/MyqZ5joLOyOvhDsOlhqZec5m84T5C8MUPX8r6YIqZabdjQbUvHiL07lQTq5e19COEntwU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB9126.eurprd04.prod.outlook.com (2603:10a6:20b:449::16) by PAXPR04MB9593.eurprd04.prod.outlook.com (2603:10a6:102:24f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul 2023 13:48:04 +0000 Received: from AS8PR04MB9126.eurprd04.prod.outlook.com ([fe80::273d:f528:aaa9:288]) by AS8PR04MB9126.eurprd04.prod.outlook.com ([fe80::273d:f528:aaa9:288%4]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023 13:48:04 +0000 From: Nitin Jadhav To: linux-bluetooth@vger.kernel.org Cc: devyani.godbole@nxp.com, pav@iki.fi, luiz.dentz@gmail.com, sathish.narasimman@intel.com, nitin.jadhav@nxp.com Subject: [PATCH BlueZ v4 1/3] shared/vcp: Fix the crash observed with VOCS Date: Tue, 25 Jul 2023 16:47:40 +0300 Message-Id: <20230725134742.51651-2-nitin.jadhav@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725134742.51651-1-nitin.jadhav@nxp.com> References: <20230725134742.51651-1-nitin.jadhav@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AS4P189CA0037.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5dd::8) To AS8PR04MB9126.eurprd04.prod.outlook.com (2603:10a6:20b:449::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB9126:EE_|PAXPR04MB9593:EE_ X-MS-Office365-Filtering-Correlation-Id: aa9e3cd9-729e-44d7-271d-08db8d15c556 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: odQLTL3MDOQXJwXtau4iRgPdjOc8PcPBF8GKGas2haOuA68CIfLUnIw7A6GThEZE9bTmoAgIsIB/YYfI232pgjX/C2elSQ90ibMqBxD9DXGKw3HiZSzA4EMYFS6DMxFvcbHuScXS87B5nezxgHzDtdSwq1AxPhpwzwhmDj7xsI6nxMyORwgVBIwBiWUjW3INJUPjDKOycbOh/U/D+cppuWkNP4IYiR/nxulvsSQjFl9l54dvTo3qjDSHjRd+q0EXUOsvso6qGEt3Oq5v7AiceiG/NKMA8JOfIJ9ttANYc8ExViNNkfosGLVktqX4vVgVL8z6XO1eT+nCewYulaheSOABgvVxeCSmiMtXcwqKxcy6/RM6mBbHscv/5YvDIySYlbYmzyhWukmtH8GlEBUEdeHokucuMkuVP+1o+PqcAQlMOydXCYBnS6cunm3SmljIWaMfOsQb2mGUWY25gH46NHi81mvKqSbCAvls2j9gNgpX/GJruc9kwTROLFWAGvqXxyZgQIbuvGO8wio8BJYgKxaiiDLzb5gU4HYVzMx3XTYLuWvrFwKXLXGN3Y/h2H/+B1Zc2tstBTW2eJqHp3P+Et59wisHD0YDHI7BEUhiR5Q/PGfVAS440xdLjJSVwSfw X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB9126.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(396003)(366004)(39860400002)(346002)(451199021)(36756003)(86362001)(2906002)(52116002)(478600001)(38100700002)(38350700002)(186003)(1076003)(26005)(2616005)(6506007)(55236004)(5660300002)(8676002)(41300700001)(6666004)(6512007)(44832011)(66946007)(6486002)(66476007)(4326008)(83380400001)(316002)(66556008)(8936002)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bwcdMmKlUP3dQVzzOo1CF8RLf8gAYBOZ4zBjxSN/VcGHJQyRdo5k/kNud7Fq?= =?us-ascii?Q?0hHjY9jJug8RZNbe+bL3whH0wwDiFzHo1l6Cqg5JmToxGVmUTpzAJbpj6dg1?= =?us-ascii?Q?9Cxyp/VWqiT1ofXFFCdvybjX4vorj8JfdytqrlQOtkfSczahX9ZtxpPpWA8k?= =?us-ascii?Q?8Vztl8zxlpBNk8duO8H4dq8f5t17V+f+UrFBhV0YHDCJnllagPf1XYH7nV2N?= =?us-ascii?Q?g61rVCE8DO4eAT1syjtoQuhHv2kiUkQvfHaWOBoOAKU8gWyyykfiJEpmDIUn?= =?us-ascii?Q?zZnX3XKV++r5GxE0S5Oas5Iehz41f/G95rVL3MBURPDS8/DLJrjNRizkrqhg?= =?us-ascii?Q?SvOdbK8a1UoQ6ft6RYdk992IW6LWF0PrO4R6MKiPIcK+KzJglsHCm+WcHWQG?= =?us-ascii?Q?NwdRNRRJaAXkp6GrchJxKi3qk2ZPA6BeDZrATMjZg75r4DiJ1GNKoETl1VuS?= =?us-ascii?Q?cns9Eex7pDbQiFPuuwzpufcKJL/6WX27fdFSIfgY6yXZMQeP1gRkO8++mnuS?= =?us-ascii?Q?79/gPJTHDVXfiVcUALZa2e0TqMy6ziqsoGbvsYsfHmE4R3EiBDPKsNa3b1k9?= =?us-ascii?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ed7j+0XI1x7xFdQ?= =?us-ascii?Q?lG9vvY270NNme6Mlk2teIUO3sKkARv2HMKiqmNr2yKEA1qH1b2JoodNapzNP?= =?us-ascii?Q?V8JCDDM96SDSSviCQDZPC1y9jxBbvwf0d4aJaBTu?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa9e3cd9-729e-44d7-271d-08db8d15c556 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB9126.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:48:04.8423 (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: a8wWlgxVvvmn8qd+F+ovxhb6we7sZGODHWM3rIl9VziPiCiqmFfwYrWU2UeyTnD1bgowVpJZly5uQLcw+YvZag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9593 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 Root cause - There are two types of database- Remote and Local (rdb and ldb). - In client mode currently the code was written to access ldb. Fix - Correcting it, to access rdb has resolved the problem in VOCS. - Same correction is done for VCS. Reported-by: Pauli Virtanen --- src/shared/vcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/vcp.c b/src/shared/vcp.c index 74bd01729..314618664 100644 --- a/src/shared/vcp.c +++ b/src/shared/vcp.c @@ -1719,10 +1719,10 @@ bool bt_vcp_attach(struct bt_vcp *vcp, struct bt_gatt_client *client) return false; bt_uuid16_create(&uuid, VCS_UUID); - gatt_db_foreach_service(vcp->ldb->db, &uuid, foreach_vcs_service, vcp); + gatt_db_foreach_service(vcp->rdb->db, &uuid, foreach_vcs_service, vcp); bt_uuid16_create(&uuid, VOL_OFFSET_CS_UUID); - gatt_db_foreach_service(vcp->ldb->db, &uuid, foreach_vocs_service, vcp); + gatt_db_foreach_service(vcp->rdb->db, &uuid, foreach_vocs_service, vcp); return true; } -- 2.34.1