linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Kees Cook <keescook@chromium.org>
Cc: Dinh Nguyen <dinguyen@kernel.org>,
	"Ivan T . Ivanov" <iivanov@suse.de>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE
Date: Thu, 18 Nov 2021 15:23:36 +0100	[thread overview]
Message-ID: <s5hee7diluf.wl-tiwai@suse.de> (raw)
In-Reply-To: <s5hsfvtkjoh.wl-tiwai@suse.de>

On Thu, 18 Nov 2021 08:27:26 +0100,
Takashi Iwai wrote:
> 
> On Wed, 17 Nov 2021 23:01:50 +0100,
> Kees Cook wrote:
> > 
> > On Wed, Nov 17, 2021 at 08:32:44PM +0100, Takashi Iwai wrote:
> > > When CONFIG_FORTIFY_SOURCE is set, memcpy() checks the potential
> > > buffer overflow and panics.  The code in sofcpga bootstrapping
> > > contains the memcpy() calls are mistakenly translated as the shorter
> > > size, hence it triggers a panic as if it were overflowing.
> > > 
> > > This patch adds the __NO_FORTIFY define for avoiding the
> > > false-positive crash.
> > > 
> > > Buglink: https://bugzilla.suse.com/show_bug.cgi?id=1192473
> > > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > > ---
> > > 
> > > I took an easier path for now, as the attempt with a foced cast
> > > failed.  If there is a better way to handle, let me know, I'd happily
> > > resubmit.  Thanks!
> > > 
> > 
> > The way these have been fixed in the past is to declare these as char
> > arrays (see include/asm-generic/sections.h). I'd prefer something like
> > this (totally untested):
> (snip)
> 
> That looks better, indeed.  I'll rebuild the kernel with it and ask
> the bug reporter for testing it.

Confirmed to work.  Will resubmit the v2 patch.


thanks,

Takashi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2021-11-18 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 19:32 [PATCH] ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE Takashi Iwai
2021-11-17 22:01 ` Kees Cook
2021-11-18  7:27   ` Takashi Iwai
2021-11-18 14:23     ` Takashi Iwai [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=s5hee7diluf.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=dinguyen@kernel.org \
    --cc=iivanov@suse.de \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).