Blame SOURCES/0020-super0-Use-memmove-when-adjusting-sparc2.2-superbloc.patch
|
|
d922d5 |
From 2dcd6492718c2921feac993aa71ed3a7c2522077 Mon Sep 17 00:00:00 2001
|
|
|
d922d5 |
From: Jes Sorensen <jsorensen@fb.com>
|
|
|
d922d5 |
Date: Thu, 31 May 2018 13:17:46 -0400
|
|
|
d922d5 |
Subject: [RHEL7.5 PATCH 20/26] super0: Use memmove() when adjusting sparc2.2
|
|
|
d922d5 |
superblock data
|
|
|
d922d5 |
|
|
|
d922d5 |
memcpy() does not allow overlapping copies, switch to memmove()
|
|
|
d922d5 |
|
|
|
d922d5 |
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
|
|
|
d922d5 |
---
|
|
|
d922d5 |
super0.c | 7 ++++---
|
|
|
d922d5 |
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
d922d5 |
|
|
|
d922d5 |
diff --git a/super0.c b/super0.c
|
|
|
d922d5 |
index 756cab5..42989b9 100644
|
|
|
d922d5 |
--- a/super0.c
|
|
|
d922d5 |
+++ b/super0.c
|
|
|
d922d5 |
@@ -520,9 +520,10 @@ static int update_super0(struct supertype *st, struct mdinfo *info,
|
|
|
d922d5 |
* up 4 bytes before continuing
|
|
|
d922d5 |
*/
|
|
|
d922d5 |
__u32 *sb32 = (__u32*)sb;
|
|
|
d922d5 |
- memcpy(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
|
|
|
d922d5 |
- sb32+MD_SB_GENERIC_CONSTANT_WORDS+7+1,
|
|
|
d922d5 |
- (MD_SB_WORDS - (MD_SB_GENERIC_CONSTANT_WORDS+7+1))*4);
|
|
|
d922d5 |
+
|
|
|
d922d5 |
+ memmove(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
|
|
|
d922d5 |
+ sb32+MD_SB_GENERIC_CONSTANT_WORDS+7+1,
|
|
|
d922d5 |
+ (MD_SB_WORDS - (MD_SB_GENERIC_CONSTANT_WORDS+7+1))*4);
|
|
|
d922d5 |
if (verbose >= 0)
|
|
|
d922d5 |
pr_err("adjusting superblock of %s for 2.2/sparc compatibility.\n",
|
|
|
d922d5 |
devname);
|
|
|
d922d5 |
--
|
|
|
d922d5 |
2.7.4
|
|
|
d922d5 |
|