[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210825180439.ctyxdhykrqtl55rj@kari-VirtualBox>
Date: Wed, 25 Aug 2021 21:04:39 +0300
From: Kari Argillander <kari.argillander@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>,
ntfs3@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs/ntfs3: Use kernel ALIGN macros over driver specific
On Wed, Aug 25, 2021 at 07:37:15AM +0300, Dan Carpenter wrote:
> On Tue, Aug 24, 2021 at 09:20:59PM +0300, Kari Argillander wrote:
> > Prefer built in ALIGN macros over special made ones. This can be
> > helpful for some static analyzing tools.
> >
>
> The patch is fine but the commit message is not clear that this fixes
> a runtime bug.
Is below better? Will send V2 if this is ok to you.
fs/ntfs3: Use kernel ALIGN macros over driver specific
The static checkers (Smatch) were complaining because QuadAlign() was
buggy. If you try to align something higher than UINT_MAX it got
truncated to a u32.
Smatch warning was:
fs/ntfs3/attrib.c:383 attr_set_size_res()
warn: was expecting a 64 bit value instead of '~7'
So that this will not happen again we will change all these macros to
kernel made ones. This can also help some other static analyzing tools
to give us better warnings.
Patch was generated with Coccinelle script and after that some style
issue was hand fixed.
<insert coccinelle script >
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Kari Argillander <kari.argillander@...il.com>
>
> The static checkers (Smatch) were complaining because QuadAlign() was
> buggy. If you try to align something higher than UINT_MAX it got
> truncated to a u32.
>
> regards,
> dan carpenter
Powered by blists - more mailing lists