Patch "Bluetooth: MGMT: Use correct address for memcpy()" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Bluetooth: MGMT: Use correct address for memcpy()

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bluetooth-mgmt-use-correct-address-for-memcpy.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a28f9f27602774acb1e607f11f9fb6b60c1e04aa
Author: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Date:   Mon Jul 17 12:32:14 2023 +0300

    Bluetooth: MGMT: Use correct address for memcpy()
    
    [ Upstream commit d1f0a9816f5fbc1316355ec1aa4ddfb9b624cca5 ]
    
    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 <andriy.shevchenko@xxxxxxxxxxxxxxx>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 1e07d0f289723..d4498037fadc6 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -7285,7 +7285,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) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux