Skip to contentSkip to conversation

xfs_db: bit fuzzing should read the right bit when flipping

PATCH In review Darrick J. Wong 2 participants 2 messages Aug 19, 2017 – Aug 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_db: bit fuzzing should read the right bit when flipping

The middle and last bit flip fuzz verbs need to read the same bit that they're trying to set.

---
 db/fuzz.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
db/fuzz.c +2 -2
index 53cedbc..d0d78a9 100644
@@ -226,7 +226,7 @@ fuzz_lastbit(
 	int		nbits)
 {
 	setbit_l((char *)buf, bitoff + nbits - 1,
-			!getbit_l((char *)buf, bitoff));
+			!getbit_l((char *)buf, bitoff + nbits - 1));
 	return true;
 }
 
@@ -238,7 +238,7 @@ fuzz_middlebit(
 	int		nbits)
 {
 	setbit_l((char *)buf, bitoff + nbits / 2,
-			!getbit_l((char *)buf, bitoff));
+			!getbit_l((char *)buf, bitoff + nbits / 2));
 	return true;
 }
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Darrick J. Wong

The middle and last bit flip fuzz verbs need to read the same bit that they're trying to set.

Quoted 31 lines
---
 db/fuzz.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
db/fuzz.c +2 -3
index 53cedbc..d0d78a9 100644
@@ -226,7 +226,7 @@ fuzz_lastbit(
 	int		nbits)
 {
 	setbit_l((char *)buf, bitoff + nbits - 1,
-			!getbit_l((char *)buf, bitoff));
+			!getbit_l((char *)buf, bitoff + nbits - 1));
 	return true;
 }
 
@@ -238,7 +238,7 @@ fuzz_middlebit(
 	int		nbits)
 {
 	setbit_l((char *)buf, bitoff + nbits / 2,
-			!getbit_l((char *)buf, bitoff));
+			!getbit_l((char *)buf, bitoff + nbits / 2));
 	return true;
 }
 
--

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html