Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5359975rwp; Mon, 17 Jul 2023 02:42:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlEIDqycCr/HPmhjd6C6XPo09QWWUEgw39VJ4LkYJs5JBO/1hZ7o7lr1CfCABNoIW0Jk4MGR X-Received: by 2002:a17:907:9095:b0:973:e5d9:d6ff with SMTP id ge21-20020a170907909500b00973e5d9d6ffmr9459126ejb.66.1689586972045; Mon, 17 Jul 2023 02:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689586972; cv=none; d=google.com; s=arc-20160816; b=0aZveCXE2Fw++YmSmvK5GnAaQPZWvziIdplUHVoCalXBQi9+1LaJdh5+61TQVZc5j+ llAy7UA0ut0f0lLEWpR7oABWeGamxE1MWl+aoK6ft+5qBEVIDbrFE7mzXp7kYJG330Jc onBcHLUoooRo616OlMer7uMksfEXC4FmjlRs2TE/m03HR90VgKLJowixTcJRpCYmIe4x s0zZYbYMdV3hPfEktz4kmqJ9xaIV80E/ehos0XGL/guQp//jeYPMeYca8EjAZn5QvMR2 O9d5cPjXxva+cq2H7RRVP2SBJRajxAlKGg3NHGRbu489ou+xxhT/zgra5iUlGqvaIAoS CNRg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=6ZuB47KOAoZTqU2lsbSHOoGbn1riEx3O76vUNJrXVPs=; fh=lhpuVRKcKGow4QVaWew2lCrpK/U33n7sVzFMlALp0I8=; b=OnbdMT6DsoenHJ2delPyTXyUgBid+ESLj3t40Tj2POBk67gykIlmk5f5yif8m5m7KV lIZiKF2QFkKQxN2omlLb7kT4GWGqTbRmMviz01/8Yap4bOBgtiBP53hLKYm0PwFIqVzw MI5g0dw8GemTrQ+piULBn4LgFu96A12KqegniM0V0hCrRCzCza2ES0SLYcNQjwDzQFnD iybVPNWH9gD2KgJ318eVIVn0jgi8MHLhNvbESe3pW3WO6Wp40IqYl/GNAM2cvAWKm0HR dtghBpSZ6N2UEQgSebpMpiY0y7ByUeUf4tQpwBVgR1/dTQznLHOQDfHq9UpQw/kYRDbt q4BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=go3ljCfC; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id um15-20020a170906cf8f00b009937e7c4e4fsi13861867ejb.80.2023.07.17.02.42.17; Mon, 17 Jul 2023 02:42:52 -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=@intel.com header.s=Intel header.b=go3ljCfC; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230311AbjGQJcZ (ORCPT + 99 others); Mon, 17 Jul 2023 05:32:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230293AbjGQJcV (ORCPT ); Mon, 17 Jul 2023 05:32:21 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593F512D; Mon, 17 Jul 2023 02:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689586340; x=1721122340; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=k1VttNSjGVJlFU/THPyMisX2NJIoBk9nmTtj2yhOEFA=; b=go3ljCfCyaMJpN+8PgyX88Jf+88RTn7eZCDTk3hZO0LEhb0+c7N+eQYc 7s7FIF1RmM+bnHF7H6INSKclTVcg3LUG2x6crG1vZNPQG8nOwb7KVygsm lkxOkvarqQJi8R82kpVym0E5hQYnpbrdWOz0Mpx5F3tlv2ymhP0p8tAGb E5PsTM2Nctq5f2MGpCvzZ8BTU8boq4JL+IUiPxpFLeDYETjMUNrRzjn5+ 7cC5pOfT6miGcFHlDY/wD/SQReDZMwnt3aE06g2eElA0HEHXMjd6MA2tH ElRMeBhvwtwTVBd0lEpKp/BnX3VX0RIDwE8tjL5G/hnMu2LqThcNP6ebY Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="355823768" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="355823768" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2023 02:32:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="723139813" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="723139813" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 17 Jul 2023 02:32:18 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 64F80256; Mon, 17 Jul 2023 12:32:24 +0300 (EEST) From: Andy Shevchenko To: Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Andy Shevchenko Subject: [PATCH v1 1/1] Bluetooth: MGMT: Use correct address for memcpy() Date: Mon, 17 Jul 2023 12:32:14 +0300 Message-Id: <20230717093214.82102-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 In function ‘fortify_memcpy_chk’, inlined from ‘get_conn_info_complete’ at net/bluetooth/mgmt.c:7281:2: include/linux/fortify-string.h:592:25: error: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] 592 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors This is due to the wrong member is used for memcpy(). Use correct one. Signed-off-by: Andy Shevchenko --- net/bluetooth/mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 33c06f7c7641..d6c9b7bc8592 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -7278,7 +7278,7 @@ static void get_conn_info_complete(struct hci_dev *hdev, void *data, int err) bt_dev_dbg(hdev, "err %d", err); - memcpy(&rp.addr, &cp->addr.bdaddr, sizeof(rp.addr)); + memcpy(&rp.addr, &cp->addr, sizeof(rp.addr)); status = mgmt_status(err); if (status == MGMT_STATUS_SUCCESS) { -- 2.40.0.1.gaa8946217a0b