git: 41abe983dbd9 - stable/15 - nvme: Use memcpy instead of memmove in nvme_cdata_get_disk_ident
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 24 Apr 2026 15:28:55 UTC
The branch stable/15 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=41abe983dbd9c8a4d9e398c48b85739e5d1dbd2d
commit 41abe983dbd9c8a4d9e398c48b85739e5d1dbd2d
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-12-02 15:57:08 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-04-24 15:26:37 +0000
nvme: Use memcpy instead of memmove in nvme_cdata_get_disk_ident
These buffers should not overlap.
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D53842
(cherry picked from commit 44d6df4f65b1441cf9cd9f12cd41edd52205d084)
---
sys/dev/nvme/nvme.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h
index 42620468e6f6..5ee7afcbcfec 100644
--- a/sys/dev/nvme/nvme.h
+++ b/sys/dev/nvme/nvme.h
@@ -2012,7 +2012,7 @@ nvme_cdata_get_disk_ident(const struct nvme_controller_data *cdata, uint8_t *sn)
_Static_assert(NVME_SERIAL_NUMBER_LENGTH < DISK_IDENT_SIZE,
"NVME serial number too big for disk ident");
- memmove(sn, cdata->sn, NVME_SERIAL_NUMBER_LENGTH);
+ memcpy(sn, cdata->sn, NVME_SERIAL_NUMBER_LENGTH);
sn[NVME_SERIAL_NUMBER_LENGTH] = '\0';
for (int i = 0; sn[i] != '\0'; i++) {
if (sn[i] < 0x20 || sn[i] >= 0x80)