lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 Apr 2023 04:42:11 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Peng Zhang <zhangpeng.00@...edance.com>, Liam.Howlett@...cle.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        maple-tree@...ts.infradead.org,
        David Binderman <dcb314@...mail.com>, stable@...r.kernel.org
Subject: Re: [PATCH v2] maple_tree: Use correct variable type in sizeof

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@...edance.com> wrote:
> 
> > The type of variable pointed to by pivs is unsigned long, but the type
> > used in sizeof is a pointer type. Change it to unsigned long.
> 
> Thanks, but there's nothing in this changelog which explains why a
> -stable backport is being proposed.  When fixing a bug, please always
> describe the user-visible effects of that bug.

There is no user-visible effect of this bug as the assembly code
generated will be identical.

> > --- a/lib/maple_tree.c
> > +++ 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));
> 
> Is there any situation in which
> sizeof(unsigned long *) != sizeof(unsigned long)?

Windows 64-bit (pointer 64-bit, unsigned long is 32 bit) is the only
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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ