[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdX8BaZ9d2oqQaAhtOVJzDFgcDuq_L2YMKB_iSTyfJa94Q@mail.gmail.com>
Date: Sun, 10 Sep 2017 12:55:15 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Kees Cook <keescook@...omium.org>,
Daniel Micay <danielmicay@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Mark Rutland <mark.rutland@....com>,
Daniel Axtens <dja@...ens.net>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Chris Metcalf <cmetcalf@...hip.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...e.hu>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH 7/7] include/linux/string.h: add the option of fortified
string.h functions
Hi Kees, Daniel,
On Mon, Jun 19, 2017 at 10:26 PM, Kees Cook <keescook@...omium.org> wrote:
> From: Daniel Micay <danielmicay@...il.com>
>
> This adds support for compiling with a rough equivalent to the glibc
> _FORTIFY_SOURCE=1 feature, providing compile-time and runtime buffer
> overflow checks for string.h functions when the compiler determines the
> size of the source or destination buffer at compile-time. Unlike glibc,
> it covers buffer reads in addition to writes.
[...]
> Link: http://lkml.kernel.org/r/20170526095404.20439-1-danielmicay@gmail.com
> Signed-off-by: Daniel Micay <danielmicay@...il.com>
> Acked-by: Kees Cook <keescook@...omium.org>
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Daniel Axtens <dja@...ens.net>
> Cc: Rasmus Villemoes <linux@...musvillemoes.dk>
> Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Cc: Chris Metcalf <cmetcalf@...hip.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: Ingo Molnar <mingo@...e.hu>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> [kees: move from -mm, add ARCH_HAS_FORTIFY_SOURCE, tweak Kconfig help]
> Signed-off-by: Kees Cook <keescook@...omium.org>
This is now commit 6974f0c4555e285a upstream.
> --- a/include/linux/string.h
> +++ b/include/linux/string.h
> @@ -187,4 +187,204 @@ static inline const char *kbasename(const char *path)
> return tail ? tail + 1 : path;
> }
>
> +#define __FORTIFY_INLINE extern __always_inline __attribute__((gnu_inline))
With gcc-4.1.2, I now get zillions of:
include/linux/string.h:439: warning: ‘gnu_inline’ attribute
directive ignored
This attribute seems to be supported as of gcc 4.2?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists