From patchwork Wed Sep 6 11:42:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudia Draghicescu X-Patchwork-Id: 720468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23938EB8FAF for ; Wed, 6 Sep 2023 11:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240127AbjIFLsH (ORCPT ); Wed, 6 Sep 2023 07:48:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235689AbjIFLsG (ORCPT ); Wed, 6 Sep 2023 07:48:06 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2076.outbound.protection.outlook.com [40.107.6.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F264137 for ; Wed, 6 Sep 2023 04:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lzzSeSmVj/O4lDux//3CncrGi+I3ejdXTrlIGNsSUjfpeGzirR/Ahnls8LsUu+AkNPFXU0ydsZXJLOUDK2WWdw4pNIla3XWvWn0PVeUZyb5sw3PzzwkgdQQ2/nxb01VUV1oB25UKl6vyDhOiQnF0gPMKPJ5Y5BYKZJpjS0qAal/yK5H9TwBz58toVitqdVAm6iWi2iTeGR8RQkRD27pVXT4rxtSCVjDSqr2RQEaEs8riqwiHx0GrJldfjssbcPb8+sXy1H4ikk6Sgv5+q16bAA95UBqDOG8Y7aV1qJh1/j8980RcNa9EOwT0CQ7k5F3CKe7u7iPBg8Zd+749E3+yRg== 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=GDjQN2/IjJ+N4KN53yHYy+fqtM26KdA9uJv5Zb4YMHs=; b=LnZf4ImtEsxOhNGIL6ORW6GkU+jGeK8In49hd0D8qn58lsWnv6AtrLIbLpI6r8vI1AN7A0eIoy8j3oPwkKqN7Qg8/ZTGTsurHBsRTIYGgkie7oqUN4d/OWvMTk2n68A7Nzc1zpqwof1BJ3N49h22fqMb1VXWXnxDNljIfTjN9qXGfVOlCMsOPGksagHWynFSpNmva0glsu5FgU5fdk4S5Yci2V1fAWcVVXZdEygsvPLyeGTAUnx3ML5vN56HHcfs4bDjuPgnZSV+I7Rm2tCxPCbjuTamGQJ4VwpFeviOV7o7Sh98AKX6hzeTq6HpuFVXnveyjiSGJG6EbhABi9r42Q== 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=GDjQN2/IjJ+N4KN53yHYy+fqtM26KdA9uJv5Zb4YMHs=; b=fYRaTKh+5YdhwwVI1AMNf17yCZbJSZVhXs5nvRe3mvBvYRQJyZpcg42Rs+uu7mYT4E3qN/dv21jXkNn1sH6BOWdTJH9N84xtwUaXgibcZMk0yN6BljDs6BwTdx7nosYtvbpdi7A7wyrth9YhPpeL0uYbezhrX4dQIIZzLZF19TA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) by AM9PR04MB8353.eurprd04.prod.outlook.com (2603:10a6:20b:3ef::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34; Wed, 6 Sep 2023 11:47:52 +0000 Received: from GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9]) by GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9%7]) with mapi id 15.20.6745.034; Wed, 6 Sep 2023 11:47:52 +0000 From: Claudia Draghicescu To: linux-bluetooth@vger.kernel.org Cc: iulia.tanasescu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Claudia Draghicescu Subject: [PATCH BlueZ 1/1] btio: Fix BASE copy from getsockopt() Date: Wed, 6 Sep 2023 14:42:34 +0300 Message-Id: <20230906114234.10617-2-claudia.rosu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230906114234.10617-1-claudia.rosu@nxp.com> References: <20230906114234.10617-1-claudia.rosu@nxp.com> X-ClientProxiedBy: WA0P291CA0010.POLP291.PROD.OUTLOOK.COM (2603:10a6:1d0:1::12) To GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9151:EE_|AM9PR04MB8353:EE_ X-MS-Office365-Filtering-Correlation-Id: 332050ba-6e7a-456a-480b-08dbaecf19d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qtWzSKMA93l0a24sjBeynu/18TwrGmNr9H6AA7PCwVbv1QxEzBUaDMOj3xCXBf+2Bzj5rgErSt4b+fpRAijhAl530ZLbB+8xpJWbT5WlIM2wO8YcO3gGq3314b8P1tiowRj/cK60w9OQeURavKRbQqOxjIBKb/dJNBPqJrEvJnn4xXcdxtv9hVmybQtCvtrGEhOFUcJOdIZ9pfmrx52756nUMxfwMvT1jTX77F6jrUDuSP8OBWXu+eQTCbxyT5BtgZ18gevhJuQhkC8AxlbDMZyIZjWo/pnawQgUylUPE5LUMlNd/5iSc6wTORSVAUX+rCRBAV+jga5w3Dv4KMYy5rpHZCQ9BH5PY2BUQ6oW0ZyNTcuJEVCU6je3Fx/nl6OaJI8tJC2PAlqcVnMm3biy6XZ1H29OvEv6rFCOYMpQiDPbHH8aeAZXJHCWxzvGBbcVHtqG8XBvtkez2C2HXOpuKM6SJyRXXJwiaqNOiLNFreJITPbFle9jrzqGxZhrgaC3lTU7Ubq1n0mhS+mRsjkEm4MJehsbaLhJFYSuPc7E7dp3Jf9DfCN1jj3cgICsr1vNoczqgzY5WhOq3Qr7jgrMbfQ3MkR0PqDgb/JOrJiku1mwganuziCJc8IhEKDEhm1Q X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:GV1PR04MB9151.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(366004)(396003)(346002)(136003)(39860400002)(451199024)(186009)(1800799009)(36756003)(38100700002)(86362001)(38350700002)(478600001)(6666004)(26005)(1076003)(5660300002)(52116002)(66946007)(66476007)(316002)(66556008)(6486002)(6506007)(6916009)(41300700001)(2616005)(6512007)(8676002)(4326008)(8936002)(2906002)(4744005)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: buAH9Xml7RaesydyR95YN0cCGNK63opb4Tv6gbRkfT+Jaq+uFwbDbVT8eQp5sm/hlpaTqsQNyxaE0+8+/YIwewt+GO0CFgrq9TCFBZOhuUlKSwTSoSbj2zXmc+FT2aRLOii9BaY2z9Z0Sg+aDftmCzfDERWHibG7BXzOUzKnggzR0GY4mghowxudZ3Bft/xgiLbqfkuTl/gQ5Qe500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s45ow8T9RdXfW9LQZz9CH6YNM8lQ/8H+DrlH2flJa7dKQapXQrpdovcfRHZDsOafvjvWD9w294OC3wzgZngyA8a4Bus5C43TTUyjvNKRw94rP3qltL7svehFihZjggzNZlXtrty4Ft1h5j9BIgn4rc1XHDsNdW5OS4+B2M81XypU3Ra2y+edoxKFYPuB4ypOk9iA/RIvK0JP/usKXWHdpTQhcaKsaUMDRBvCOGei27rVHPHL4EUrmW+DaiDLliIXIbB+m12bYMmR4e11r2d9JNV1qWd1i81WclSbXz8AWWwxnuryP6G3JgpGwBMPo1fHiFuv9o X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 332050ba-6e7a-456a-480b-08dbaecf19d2 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2023 11:47:52.0352 (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: aUnDhCA11Ftr5KY3FzvsfiHKvKSjKyyvORxZWpY88XZ/ri+UnOySdXQtILY7YCybWRK/xICS074GN+QI3a5hnw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8353 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Fix copy of BASE from getsockopt() and update base length. --- btio/btio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/btio/btio.c b/btio/btio.c index 8178250d2..8d9959038 100644 --- a/btio/btio.c +++ b/btio/btio.c @@ -1649,10 +1649,12 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args) return FALSE; } - if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_BASE, &base, &len) < 0) { + if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_BASE, + &base.base, &len) < 0) { ERROR_FAILED(err, "getsockopt(BT_ISO_BASE)", errno); return FALSE; } + base.base_len = len; if (!get_src(sock, &src, sizeof(src), err)) return FALSE;