All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: "Darrick J . Wong" <djwong@kernel.org>,
	Zorro Lang <zlang@redhat.com>,
	linux-xfs@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Keith Packard <keithp@keithp.com>,
	Francis Laniel <laniel_francis@privacyrequired.com>,
	Daniel Axtens <dja@axtens.net>,
	Dan Williams <dan.j.williams@intel.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Tadeusz Struk <tadeusz.struk@linaro.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs: Use flex_cpy() to check extent copying
Date: Tue, 25 Oct 2022 11:58:36 +0300	[thread overview]
Message-ID: <Y1elPIWqgyQIHz4n@smile.fi.intel.com> (raw)
In-Reply-To: <20221024172058.534477-2-keescook@chromium.org>

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



      reply	other threads:[~2022-10-25  8:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 17:20 [PATCH v2 0/2] Introduce flexible array struct helpers Kees Cook
2022-10-24 17:20 ` [PATCH v2 1/2] " Kees Cook
2022-10-24 18:35   ` Keith Packard
2022-10-26 20:33     ` Kees Cook
2022-10-25  6:12   ` kernel test robot
2022-10-25  8:57   ` Andy Shevchenko
2022-10-24 17:20 ` [PATCH 2/2] xfs: Use flex_cpy() to check extent copying Kees Cook
2022-10-25  8:58   ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1elPIWqgyQIHz4n@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dja@axtens.net \
    --cc=djwong@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=keithp@keithp.com \
    --cc=laniel_francis@privacyrequired.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pabeni@redhat.com \
    --cc=tadeusz.struk@linaro.org \
    --cc=vincenzo.frascino@arm.com \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.