All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: h@magnolia, xfs <linux-xfs@vger.kernel.org>,
	Zorro Lang <zlang@redhat.com>,
	linux-hardening@vger.kernel.org
Subject: Re: [RFC PATCH] xfs: fix FORTIFY_SOURCE complaints about log item memcpy
Date: Tue, 25 Oct 2022 11:40:32 -0700	[thread overview]
Message-ID: <202210251139.3612057E@keescook> (raw)
In-Reply-To: <Y1cFxnea750izJd7@magnolia>

On Mon, Oct 24, 2022 at 02:38:14PM -0700, Darrick J. Wong wrote:
> <nod> I realized that these helpers introducing unsafe memcpy weren't
> needed.  Later on after chatting with dchinner a bit I came to the
> conclusion that we might as well convert most of the _copy_format
> functions to memcpy the structure head and flex array separately since
> that function is converting an ondisk log item into its in-memory
> representation, and some day we'll make those struct fields endian safe.
> They aren't now, and that's one of the (many) gaping holes that need
> fixing.

Ah, perfect! Yeah, this is one of the other standard solutions -- header
and flex array handled separately. I'm still working on APIs to handle
the common cases, though. XFS probably will want to keep it separate as
you've done.

> I sent my candidate fixes series to the list just now.

Thanks! I'll go check them out.

-- 
Kees Cook

  reply	other threads:[~2022-10-25 18:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20  0:04 [RFC PATCH] xfs: fix FORTIFY_SOURCE complaints about log item memcpy Darrick J. Wong
2022-10-20  3:05 ` Kees Cook
2022-10-24 16:59 ` Kees Cook
2022-10-24 21:38   ` Darrick J. Wong
2022-10-25 18:40     ` Kees Cook [this message]
2022-10-24 22:32   ` Dave Chinner
2022-10-25 18:45     ` Kees Cook

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=202210251139.3612057E@keescook \
    --to=keescook@chromium.org \
    --cc=djwong@kernel.org \
    --cc=h@magnolia \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --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.