[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210330214320.93600506530f1ab18338b467@linux-foundation.org>
Date: Tue, 30 Mar 2021 21:43:20 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH][next] hfsplus: Fix out-of-bounds warnings in
__hfsplus_setxattr
On Tue, 30 Mar 2021 09:52:26 -0500 "Gustavo A. R. Silva" <gustavoars@...nel.org> wrote:
> Fix the following out-of-bounds warnings by enclosing
> structure members file and finder into new struct info:
>
> fs/hfsplus/xattr.c:300:5: warning: 'memcpy' offset [65, 80] from the object at 'entry' is out of the bounds of referenced subobject 'user_info' with type 'struct DInfo' at offset 48 [-Warray-bounds]
> fs/hfsplus/xattr.c:313:5: warning: 'memcpy' offset [65, 80] from the object at 'entry' is out of the bounds of referenced subobject 'user_info' with type 'struct FInfo' at offset 48 [-Warray-bounds]
>
> Refactor the code by making it more "structured."
>
> Also, this helps with the ongoing efforts to enable -Warray-bounds and
> makes the code clearer and avoid confusing the compiler.
Confused. What was wrong with the old code? Was this warning
legitimate and if so, why? Or is this patch a workaround for a
compiler shortcoming?
Powered by blists - more mailing lists