On Mon, Apr 10, 2023 at 08:29:35PM -0700, Andrew Morton wrote:
On Tue, 11 Apr 2023 10:35:13 +0800 Peng Zhang <zhangpeng.00@xxxxxxxxxxxxx> wrote:There is no user-visible effect of this bug as the assembly code
The type of variable pointed to by pivs is unsigned long, but the typeThanks, but there's nothing in this changelog which explains why a
used in sizeof is a pointer type. Change it to unsigned long.
-stable backport is being proposed. When fixing a bug, please always
describe the user-visible effects of that bug.
generated will be identical.
Windows 64-bit (pointer 64-bit, unsigned long is 32 bit) is the only--- a/lib/maple_tree.cIs there any situation in which
+++ b/lib/maple_tree.c
@@ -3255,7 +3255,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end
if (tmp < max_p)
memset(pivs + tmp, 0,
- sizeof(unsigned long *) * (max_p - tmp));
+ sizeof(unsigned long) * (max_p - tmp));
if (tmp < mt_slots[mt])
memset(slots + tmp, 0, sizeof(void *) * (max_s - tmp));
sizeof(unsigned long *) != sizeof(unsigned long)?
one I know. Linux is all ILP32 or LP64. There may be some embedded
environments which are different, but I have no idea what they might be.