[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1elPIWqgyQIHz4n@smile.fi.intel.com>
Date: Tue, 25 Oct 2022 11:58:36 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Kees Cook <keescook@...omium.org>
Cc: "Darrick J . Wong" <djwong@...nel.org>,
Zorro Lang <zlang@...hat.com>, linux-xfs@...r.kernel.org,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Keith Packard <keithp@...thp.com>,
Francis Laniel <laniel_francis@...vacyrequired.com>,
Daniel Axtens <dja@...ens.net>,
Dan Williams <dan.j.williams@...el.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Guenter Roeck <linux@...ck-us.net>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Tadeusz Struk <tadeusz.struk@...aro.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Paolo Abeni <pabeni@...hat.com>, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH 2/2] xfs: Use flex_cpy() to check extent copying
On Mon, Oct 24, 2022 at 10:20:58AM -0700, Kees Cook wrote:
> Use flex_cpy() instead of memcpy() to copy the bui_fmt flexible array
> structure, which will perform bounds checking internally. Avoids the
> false positive warning seen under FORTIFY_SOURCE:
>
> memcpy: detected field-spanning write (size 48) of single field "dst_bui_fmt" at fs/xfs/xfs_bmap_item.c:628 (size 16)
...
> #include "xfs_error.h"
> #include "xfs_log_priv.h"
> #include "xfs_log_recover.h"
> +#include <linux/flex_array.h>
Wouldn't it be better to include it before any "local" headers?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists