[folded-merged] bitops-introduce-the-for_each_set_clump8-macro-fix.patch removed from -mm tree

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

 



The patch titled
     Subject: linux/bitmap.h: fix potential sign-extension overflow
has been removed from the -mm tree.  Its filename was
     bitops-introduce-the-for_each_set_clump8-macro-fix.patch

This patch was dropped because it was folded into bitops-introduce-the-for_each_set_clump8-macro.patch

------------------------------------------------------
From: "Gustavo A. R. Silva" <gustavo@xxxxxxxxxxxxxx>
Subject: linux/bitmap.h: fix potential sign-extension overflow

In expression 0xff << offset, left shifting by more than 31 bits has
undefined behavior.  Notice that the shift amount, *offset*, can be as
much as 63.

Fix this by adding suffix ULL to integer 0xFF.

Addresses Coverity 1487071 ("Bad bit shift operation")

Link: http://lkml.kernel.org/r/20191015184657.GA26541@embeddedor
Fixes: d33f5cbaadd8 ("bitops: introduce the for_each_set_clump8 macro")
Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
Cc: William Breathitt Gray <vilhelm.gray@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/bitmap.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/bitmap.h~bitops-introduce-the-for_each_set_clump8-macro-fix
+++ a/include/linux/bitmap.h
@@ -520,7 +520,7 @@ static inline void bitmap_set_value8(uns
 	const size_t index = BIT_WORD(start);
 	const unsigned long offset = start % BITS_PER_LONG;
 
-	map[index] &= ~(0xFF << offset);
+	map[index] &= ~(0xFFULL << offset);
 	map[index] |= value << offset;
 }
 
_

Patches currently in -mm which might be from gustavo@xxxxxxxxxxxxxx are

bitops-introduce-the-for_each_set_clump8-macro.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux