[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5hee7diluf.wl-tiwai@suse.de>
Date: Thu, 18 Nov 2021 15:23:36 +0100
From: Takashi Iwai <tiwai@...e.de>
To: Kees Cook <keescook@...omium.org>
Cc: Dinh Nguyen <dinguyen@...nel.org>,
"Ivan T . Ivanov" <iivanov@...e.de>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE
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@...e.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
Powered by blists - more mailing lists