From: Daniel Micay <danielmicay@gmail.com>
To: Kees Cook <keescook@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: "kernel-hardening@lists.openwall.com"
<kernel-hardening@lists.openwall.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Daniel Axtens <dja@axtens.net>
Subject: [kernel-hardening] Re: [PATCH v3] add the option of fortified string.h functions
Date: Fri, 26 May 2017 04:35:06 -0400 [thread overview]
Message-ID: <1495787706.2392.3.camel@gmail.com> (raw)
In-Reply-To: <CAGXu5jJQpiSHVw-6OeS92i2UU+QFDeXN9Wrs-V_8YKD_fHuqNg@mail.gmail.com>
On Thu, 2017-05-25 at 20:40 -0700, Kees Cook wrote:
> On Mon, May 22, 2017 at 4:10 PM, Daniel Micay <danielmicay@gmail.com>
> wrote:
> > diff --git a/arch/x86/include/asm/string_64.h
> > b/arch/x86/include/asm/string_64.h
> > index 733bae07fb29..3c5b26e07b85 100644
> > --- a/arch/x86/include/asm/string_64.h
> > +++ b/arch/x86/include/asm/string_64.h
> > @@ -77,6 +77,11 @@ int strcmp(const char *cs, const char *ct);
> > #define memcpy(dst, src, len) __memcpy(dst, src, len)
> > #define memmove(dst, src, len) __memmove(dst, src, len)
> > #define memset(s, c, n) __memset(s, c, n)
> > +
> > +#ifndef __NO_FORTIFY
> > +#define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc.
> > */
> > +#endif
> > +
> > #endif
> >
> > #define __HAVE_ARCH_MEMCPY_MCSAFE 1
>
> Ah-ha, this same KASAN exclusion is missing for string_32.h, which is
> what I think akpm tripped over in build tests.
>
> -Kees
It's not KASAN-related but rather some cruft that's still around in the
32-bit x86 header. It unnecessarily defines memcpy as __builtin_memcpy
even though the built-in is already used on modern GCC, while the 64-bit
header only does a similar define for GCC < 4.3. I'll just make it stop
doing that with fortify enabled.
prev parent reply other threads:[~2017-05-26 8:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 23:10 [kernel-hardening] [PATCH v3] add the option of fortified string.h functions Daniel Micay
2017-05-22 23:24 ` [kernel-hardening] " Kees Cook
2017-05-23 22:48 ` Andrew Morton
2017-05-24 2:12 ` Kees Cook
2017-05-25 0:24 ` Daniel Micay
2017-05-25 23:52 ` Andrew Morton
2017-05-26 3:40 ` Kees Cook
2017-05-26 8:35 ` Daniel Micay [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=1495787706.2392.3.camel@gmail.com \
--to=danielmicay@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dja@axtens.net \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.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 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).