Re: [PATCH 20/23] gcc-plugins: always build plugins with C++

2018-02-22 Thread Emese Revfy
On Sat, 17 Feb 2018 03:38:48 +0900 Masahiro Yamada wrote: > If the target compiler is GCC 4.8 or newer, plugins are compiled with > HOSTCXX. Otherwise, gcc-plugin.sh will select HOSTCC or HOSTCXX. > > To simpily things, let's decide GCC 4.8 is the requirement for GCC > pulgins. With this, plug

Re: [PATCH v4 0/4] Introduce the initify gcc plugin

2017-02-20 Thread Emese Revfy
On Wed, 15 Feb 2017 11:27:06 -0800 Kees Cook wrote: > On Tue, Feb 14, 2017 at 4:23 PM, Emese Revfy wrote: > > On Thu, 12 Jan 2017 15:40:41 -0800 > > Kees Cook wrote: > > > >> WARNING: drivers/clk/bcm/built-in.o(.text+0xec2): Section mismatch in > >> re

Re: [PATCH v4 0/4] Introduce the initify gcc plugin

2017-02-14 Thread Emese Revfy
On Thu, 12 Jan 2017 15:40:41 -0800 Kees Cook wrote: > WARNING: drivers/clk/bcm/built-in.o(.text+0xec2): Section mismatch in > reference from the function clk_gate() to the variable > .init.rodata.str:__func__.29708 > The function clk_gate() references > the variable __initconst __func__.29708. >

Re: [PATCH v4 0/4] Introduce the initify gcc plugin

2017-01-17 Thread Emese Revfy
On Thu, 12 Jan 2017 15:40:41 -0800 Kees Cook wrote: > WARNING: drivers/clk/bcm/built-in.o(.text+0xec2): Section mismatch in > reference from the function clk_gate() to the variable > .init.rodata.str:__func__.29708 > The function clk_gate() references > the variable __initconst __func__.29708. >

Re: [PATCH v4 0/4] Introduce the initify gcc plugin

2017-01-12 Thread Emese Revfy
On Tue, 10 Jan 2017 17:09:31 -0800 Kees Cook wrote: > WARNING: vmlinux.o(.text+0x1087e7): Section mismatch in reference from > the function rebind_subsystems() to the variable > .init.rodata.str:__func__.4400 > The function rebind_subsystems() references > the variable __initconst __func__.4400.

Re: [PATCH v4 0/4] Introduce the initify gcc plugin

2017-01-10 Thread Emese Revfy
On Tue, 3 Jan 2017 16:23:03 -0800 Kees Cook wrote: > On Mon, Dec 19, 2016 at 3:10 AM, Emese Revfy wrote: > > On Fri, 16 Dec 2016 14:19:10 -0800 > > Kees Cook wrote: > > > >> FWIW, it still seems to me that these aren't false positives: > >>

Re: [PATCH v4 0/4] Introduce the initify gcc plugin

2016-12-19 Thread Emese Revfy
On Fri, 16 Dec 2016 14:19:10 -0800 Kees Cook wrote: > FWIW, it still seems to me that these aren't false positives: > > WARNING: vmlinux.o(.text.unlikely+0x1b1): Section mismatch in > reference from the function uncore_pci_exit.part.22() to the function > .init.text:uncore_free_pcibus_map() > T

Re: [PATCH] gcc-plugin: include memmodel.h and tree_vrp.h for gcc-7

2016-12-16 Thread Emese Revfy
On Fri, 16 Dec 2016 10:00:22 +0100 Arnd Bergmann wrote: > Cc: sta...@vger.kernel.org > Suggested-by: Kugan > Signed-off-by: Arnd Bergmann > --- > scripts/gcc-plugins/gcc-common.h | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/scripts/gcc-plugins/gcc-common.h > b/scripts/gcc-p

Re: enabling COMPILE_TEST support for GCC plugins in v4.11

2016-12-10 Thread Emese Revfy
On Fri, 9 Dec 2016 11:12:18 -0800 Kees Cook wrote: > On Fri, Dec 9, 2016 at 2:40 AM, Arnd Bergmann wrote: > > On Thursday, December 8, 2016 11:00:42 AM CET Kees Cook wrote: > > > >> If you have a moment, applying 215e2aa6c024[1] and reverting > >> a519167e753e for an allyesconfig/allmodconfig bu

Re: [PATCH 3/3] powerpc: enable support for GCC plugins

2016-12-06 Thread Emese Revfy
On Tue, 6 Dec 2016 17:28:00 +1100 Andrew Donnellan wrote: > + # Various gccs between 4.5 and 5.1 have bugs on powerpc due to missing > + # header files. gcc <= 4.6 doesn't work at all, gccs from 4.8 to 5.1 > have > + # issues with 64-bit targets. > + ifeq ($(ARCH),powerpc) >

Re: scripts/gcc-plugins/gcc-common.h:4:22: fatal error: bversion.h: No such file or directory

2016-11-06 Thread Emese Revfy
On Sun, 6 Nov 2016 07:09:57 +0800 kbuild test robot wrote: > Hi Emese, > > FYI, the error/warning still remains. > >++(scripts/gcc-plugin.sh:12): main(): gcc-4.6 -E -x c++ - -o /dev/null > -Iscripts/gcc-plugins -Iplugin/include >scripts/Makefile.gcc-plugins:30: warning: your gcc install

Re: drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes

2016-10-18 Thread Emese Revfy
On Tue, 18 Oct 2016 15:05:39 -0700 Kees Cook wrote: > On Tue, Oct 18, 2016 at 2:36 PM, Emese Revfy wrote: > > On Tue, 18 Oct 2016 13:57:35 -0700 > > Kees Cook wrote: > > > >> This is controlled by CONFIG_FRAME_WARN. I don't think this is a > >>

Re: drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes

2016-10-18 Thread Emese Revfy
On Tue, 18 Oct 2016 13:57:35 -0700 Kees Cook wrote: > This is controlled by CONFIG_FRAME_WARN. I don't think this is a > particular problem or should be avoided, but perhaps we can set the > default to 2048 (as done on 64BIT) if we're building with the entropy > plugin. This is probably a gcc co

Re: drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes

2016-10-17 Thread Emese Revfy
On Sun, 16 Oct 2016 06:52:16 +0800 kbuild test robot wrote: >drivers/pci/hotplug/ibmphp_ebda.c: In function 'ibmphp_access_ebda': > >> drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 > >> bytes is larger than 1024 bytes [-Wframe-larger-than=] Hi, Thanks for the rep

[PATCH v3 6/7] Mark a few functions with the printf attribute

2016-07-27 Thread Emese Revfy
Fixed format strings warnings exposed by the printf attribute. Signed-off-by: Emese Revfy --- drivers/acpi/acpica/dbhistry.c | 2 +- drivers/acpi/acpica/dbinput.c | 10 ++--- drivers/acpi/acpica/dbstats.c | 88 +++--- drivers/acpi/acpica/utdebug.c

[PATCH v3 2/7] Split up struct warn_args

2016-07-27 Thread Emese Revfy
Disable the initify plugin on the 6th parameter of __warn() because the va_list type can't be NULL on the tile arch. Signed-off-by: Emese Revfy --- include/asm-generic/bug.h | 7 +-- kernel/panic.c| 32 lib/bug.c | 2 +- 3

[PATCH v3 7/7] Mark functions with the __unverified_nocapture attribute

2016-07-26 Thread Emese Revfy
This attribute disables the compile data flow verification of the designated nocapture parameters of the function. Use it only on function parameters that are difficult for the plugin to analyze. Signed-off-by: Emese Revfy --- include/linux/compiler-gcc.h | 1 + include/linux/compiler.h | 4

[PATCH v3 6/7] Mark a few functions with the printf attribute

2016-07-26 Thread Emese Revfy
This allows not only compile time format string checking but can also increase the coverage of the initify plugin. Signed-off-by: Emese Revfy --- drivers/scsi/esas2r/esas2r_log.h | 4 ++-- include/acpi/acpiosxf.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a

[PATCH v3 5/7] Mark functions with the __nocapture attribute

2016-07-26 Thread Emese Revfy
plugin initifies all vararg arguments. I couldn't test the arm, arm64 and powerpc architectures. Signed-off-by: Emese Revfy --- arch/arm/include/asm/string.h | 10 +++--- arch/arm64/include/asm/string.h | 25 ++--- arch/powerpc/include/asm/string.h | 19 +- arc

[PATCH v3 4/7] Add the initify gcc plugin

2016-07-26 Thread Emese Revfy
itify plugin to increase coverage. Signed-off-by: Emese Revfy --- arch/Kconfig | 35 + arch/x86/Kconfig |1 + arch/x86/lib/Makefile|4 + include/asm-generic/vmlinux.lds.h|2 + include/linux/compiler-gcc.h |

[PATCH v3 3/7] Constify some function parameters

2016-07-26 Thread Emese Revfy
Initify needs const pointer types, the initify plugin caught some __printf arguments that weren't const yet. Signed-off-by: Emese Revfy --- drivers/isdn/hisax/config.c | 16 drivers/isdn/hisax/hisax.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --

[PATCH v3 2/7] Split up struct warn_args

2016-07-26 Thread Emese Revfy
to enable dataflow verification by the initify plugin. This allows marking warn_slowpath* parameters as nocapture and compile time verification of the related dataflows. Signed-off-by: Emese Revfy --- include/asm-generic/bug.h | 5 + kernel/panic.c| 32

[PATCH v3 1/7] Move type casts into is_kernel_rodata

2016-07-26 Thread Emese Revfy
so that its parameter can be marked as nocapture. Signed-off-by: Emese Revfy --- mm/util.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/util.c b/mm/util.c index 662cddf..d95f10b 100644 --- a/mm/util.c +++ b/mm/util.c @@ -17,10 +17,10 @@ #include

[PATCH v3 0/7] Introduce the initify gcc plugin

2016-07-26 Thread Emese Revfy
__ksymtab_gpl __ksymtab_strings __init_rodata __param __modver 03 .init.text .altinstr_aux .init.data .x86_cpu_dev.init .parainstructions .altinstructions .altinstr_replacement .iommu_table .apicdrivers .exit.text .exit.data .smp_locks .bss .brk Emese Revfy (7): Move type

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Emese Revfy
On Tue, 12 Jul 2016 18:38:47 -0400 Kees Cook wrote: > On Tue, Jul 12, 2016 at 6:08 PM, Russell King - ARM Linux > wrote: > > On Tue, Jul 12, 2016 at 03:45:56PM -0400, Kees Cook wrote: > >> On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: > > That sounds like a pro

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Emese Revfy
On Tue, 12 Jul 2016 15:45:56 -0400 Kees Cook wrote: > On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: > > If a function is called by __init and __exit functions as well then > > the plugin moves it to the __exit section. This causes false positive > > section mismatch e

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Emese Revfy
On Tue, 12 Jul 2016 16:05:45 -0400 Kees Cook wrote: > /* > * The initify gcc-plugin attempts to identify const arguments that are only > * used during init (see __init), so they can be moved to the .init.rodata > * section. If an argument is passed to a non-init function, it must > * normally

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Emese Revfy
On Tue, 12 Jul 2016 15:45:56 -0400 Kees Cook wrote: > On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: > Thanks for sending this! I'll get it added to my tree for some 0day > build testing, and then get it into my -next tree. I'll send a new patch set soon. I'm wor

Re: [PATCH v2 3/3] Constify some function parameters

2016-07-06 Thread Emese Revfy
On Tue, 5 Jul 2016 07:58:04 +0800 kbuild test robot wrote: > All warnings (new ones prefixed by >>): > >drivers/isdn/hisax/config.c: In function 'VHiSax_putstatus': > >> drivers/isdn/hisax/config.c:688:5: warning: assignment discards 'const' > >> qualifier from pointer target type [-Wdiscar

[PATCH v2 3/3] Constify some function parameters

2016-07-06 Thread Emese Revfy
Initify needs const pointer types, the initify plugin caught some __printf arguments that weren't const yet. Signed-off-by: Emese Revfy --- drivers/isdn/hisax/config.c | 16 drivers/isdn/hisax/hisax.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --

[PATCH v2 3/3] Constify some function parameters

2016-07-04 Thread Emese Revfy
Initify needs const pointer types, the initify plugin caught some __printf arguments that weren't const yet. Signed-off-by: Emese Revfy --- drivers/isdn/hisax/config.c | 4 ++-- drivers/isdn/hisax/hisax.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH v2 2/3] Mark functions with the __nocapture attribute

2016-07-04 Thread Emese Revfy
test the arm, arm64 and powerpc architectures. Signed-off-by: Emese Revfy --- arch/arm/include/asm/string.h | 4 +-- arch/arm64/include/asm/string.h | 19 ++-- arch/powerpc/include/asm/string.h | 19 ++-- arch/x86/include/asm/string_32.h | 21 ++--- arch/x86/includ

[PATCH v2 1/3] Add the initify gcc plugin

2016-07-04 Thread Emese Revfy
itify plugin to increase coverage. Signed-off-by: Emese Revfy --- arch/Kconfig | 23 + include/asm-generic/vmlinux.lds.h|2 + scripts/Makefile.gcc-plugins |4 + scripts/gcc-plugins/gcc-common.h | 41 ++ scripts/gcc-plugins/initify_plugin.c |

[PATCH v2 0/3] Introduce the initify gcc plugin

2016-07-04 Thread Emese Revfy
86_cpu_dev.init .parainstructions .altinstructions .altinstr_replacement .iommu_table .apicdrivers .exit.text .exit.data .smp_locks .bss .brk Emese Revfy (3): Add the initify gcc plugin Mark functions with the __nocapture attribute Constify some function parameters Changes from v1: * Remo

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-07-01 Thread Emese Revfy
On Wed, 29 Jun 2016 17:12:45 -0700 Joe Perches wrote: > On Wed, 2016-06-29 at 20:42 +0200, Emese Revfy wrote: > > On Tue, 28 Jun 2016 14:00:57 -0700 Joe Perches wrote: > > > On Tue, 2016-06-28 at 22:40 +0200, Emese Revfy wrote: > > > > On Tue, 28 Jun 2016 09:

Re: [PATCH v1 1/2] Add the initify gcc plugin

2016-06-29 Thread Emese Revfy
On Tue, 28 Jun 2016 23:05:56 +0200 Rasmus Villemoes wrote: > On Tue, Jun 28 2016, Emese Revfy wrote: > > > The kernel already has a mechanism to free up code and data memory that > > is only used during kernel or module initialization. > > This plugin will teach the co

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-29 Thread Emese Revfy
On Tue, 28 Jun 2016 14:00:57 -0700 Joe Perches wrote: > On Tue, 2016-06-28 at 22:40 +0200, Emese Revfy wrote: > > On Tue, 28 Jun 2016 09:43:31 -0700 Joe Perches wrote: > > > On Tue, 2016-06-28 at 13:36 +0200, Emese Revfy wrote: > > > > The nocapture gcc attr

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-29 Thread Emese Revfy
On Tue, 28 Jun 2016 22:50:55 +0200 Rasmus Villemoes wrote: > On Tue, Jun 28 2016, Emese Revfy wrote: > > diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h > > index 6f96247..4cdf266 100644 > > --- a/include/asm-generic/bug.h > > +++ b/include/asm-

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-29 Thread Emese Revfy
On Wed, 29 Jun 2016 18:52:27 +0100 Mark Rutland wrote: > On Wed, Jun 29, 2016 at 09:21:37AM +0100, Mark Rutland wrote: > > On Tue, Jun 28, 2016 at 01:46:04PM -0700, Kees Cook wrote: > > > On Tue, Jun 28, 2016 at 9:14 AM, Emese Revfy wrote: > > > > On Tue, 28 Jun 20

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 09:43:31 -0700 Joe Perches wrote: > On Tue, 2016-06-28 at 13:36 +0200, Emese Revfy wrote: > > The nocapture gcc attribute can be on functions only. > > The attribute takes one or more unsigned integer constants as parameters > > that specify the function

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 21:02:54 +0200 Rasmus Villemoes wrote: > It'll get placed in multiple sections by the compiler, and nothing bad > happens. String deduplication is something the linker does to sections > equipped with appropriate flags. So in this case that of course means Note that I didn't

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 19:00:22 +0200 Mathias Krause wrote: > > section vanilla vanilla + initifychange > > --- > > .rodata 39059688 (0x25400e8)38527210 (0x24be0ea)-532478 > > .data

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 13:57:49 +0100 Mark Rutland wrote: > On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: > > This patch set is based on the "Add support for complex gcc plugins that > > don't fit in a single file" patch set (git/kees/linux.git#kspp

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 13:34:07 +0200 Emese Revfy wrote: > * automatically discover init/exit functions and apply the __init or >__exit attributes on them Hi, I have a question about this. If a function is called by __init and __exit functions as well then I move it to the __exit sect

[PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-28 Thread Emese Revfy
test the arm, arm64 and powerpc architectures. Signed-off-by: Emese Revfy --- arch/arm/include/asm/string.h | 10 +++--- arch/arm64/include/asm/string.h | 23 ++-- arch/powerpc/include/asm/string.h | 19 +- arch/x86/boot/string.h| 4 +-- arch/x86/include/asm/stri

[PATCH v1 1/2] Add the initify gcc plugin

2016-06-28 Thread Emese Revfy
systems. The instrumentation pass of the latent_entropy plugin must run after the initify plugin to increase coverage. Signed-off-by: Emese Revfy --- arch/Kconfig | 23 + include/asm-generic/vmlinux.lds.h|2 + scripts/Makefile.gcc-plugins |4 + scripts

[PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
18)77576664 (0x49fb9d8) -38464 .init.text 1108455 (0x10e9e7) 1137618 (0x115bd2) +29163 Emese Revfy (2): Add the initify gcc plugin Mark functions with the __nocapture attribute --- arch/Kconfig | 23 + arch/arm/include/asm/string.h

[PATCH v4 4/4] Add the extra_latent_entropy kernel parameter

2016-06-20 Thread Emese Revfy
When extra_latent_entropy is passed on the kernel command line, entropy will be extracted from up to the first 4GB of RAM while the runtime memory allocator is being initialized. Based on work created by the PaX Team. Signed-off-by: Emese Revfy --- Documentation/kernel-parameters.txt | 5

[PATCH v4 3/4] Mark functions with the latent_entropy attribute

2016-06-20 Thread Emese Revfy
integer fields. These functions have been selected because they are init functions or are called at random times or they have variable loops. Signed-off-by: Emese Revfy --- block/blk-softirq.c | 2 +- drivers/char/random.c| 6 +++--- fs/namespace.c | 1 + include

[PATCH v4 2/4] Add the latent_entropy gcc plugin

2016-06-20 Thread Emese Revfy
do_one_initcall() and _do_fork(). Signed-off-by: Emese Revfy --- arch/Kconfig| 18 + arch/powerpc/kernel/Makefile| 4 + include/linux/random.h | 10 + init/main.c | 1 + kernel/fork.c

[PATCH v4 1/4] Add support for passing gcc plugin arguments

2016-06-20 Thread Emese Revfy
Signed-off-by: Emese Revfy --- scripts/Makefile.gcc-plugins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins index 5e22b60..da7f86c 100644 --- a/scripts/Makefile.gcc-plugins +++ b/scripts/Makefile.gcc-plugins

[PATCH v4 0/4] Introduce the latent_entropy gcc plugin

2016-06-20 Thread Emese Revfy
/ephox-gcc-plugins/latent_entropy This patch set is based on the "Introduce GCC plugin infrastructure" patch set (git/mmarek/kbuild.git#kbuild HEAD: 543c37cb165049c3be). Emese Revfy (4): Add support for passing gcc plugin arguments Add the latent_entropy gcc plugin Mark function

Re: [PATCH v9 3/4] Add Cyclomatic complexity GCC plugin

2016-06-15 Thread Emese Revfy
On Tue, 14 Jun 2016 12:29:59 -0700 Laura Abbott wrote: > On 05/23/2016 03:10 PM, Emese Revfy wrote: > 1) make mrproper > 2) make defconfig > 3) enable GCC_PLUGINS, GCC_PLUGIN_CYC_COMPLEXITY > 4) enable FUNCTION_TRACER (it will select other options as well) > 5) make &&am

Re: [PATCH v3 2/4] Add the latent_entropy gcc plugin

2016-06-15 Thread Emese Revfy
On Wed, 15 Jun 2016 11:07:08 -0700 Kees Cook wrote: > On Tue, Jun 14, 2016 at 3:20 PM, Emese Revfy wrote: > This doesn't look right to me: these are CFLAGS_REMOVE_* entries, and > I think you want to _add_ the DISABLE_LATENT_ENTROPY_PLUGIN to the > CFLAGS here. Thanks for th

Re: [PATCH v3 0/4] Introduce the latent_entropy gcc plugin

2016-06-15 Thread Emese Revfy
On Wed, 15 Jun 2016 11:55:44 -0700 Kees Cook wrote: > The limit on the length of lines is 80 columns and this is a strongly > preferred limit. I think the code looks worse when it is truncated to 80 columns but I'll do it and resend the patches. -- Emese

Re: [PATCH v9 3/4] Add Cyclomatic complexity GCC plugin

2016-06-14 Thread Emese Revfy
On Tue, 14 Jun 2016 12:29:59 -0700 Laura Abbott wrote: > This has some weird interaction with ftrace. On x86 > > 1) make mrproper > 2) make defconfig > 3) enable GCC_PLUGINS, GCC_PLUGIN_CYC_COMPLEXITY > 4) enable FUNCTION_TRACER (it will select other options as well) > 5) make && make modules >

Re: [PATCH v2 1/3] Add the latent_entropy gcc plugin

2016-06-14 Thread Emese Revfy
On Tue, 14 Jun 2016 11:27:00 -0700 Kees Cook wrote: > On Mon, Jun 13, 2016 at 2:49 PM, Emese Revfy wrote: > > On Thu, 9 Jun 2016 14:51:45 -0700 > > Kees Cook wrote: > > >> > + * gcc plugin to help generate a little bit of entropy from program > >>

[PATCH v3 4/4] Add the extra_latent_entropy kernel parameter

2016-06-14 Thread Emese Revfy
When extra_latent_entropy is passed on the kernel command line, entropy will be extracted from up to the first 4GB of RAM while the runtime memory allocator is being initialized. Based on work created by the PaX Team. Signed-off-by: Emese Revfy --- Documentation/kernel-parameters.txt | 5

[PATCH v3 3/4] Mark functions with the latent_entropy attribute

2016-06-14 Thread Emese Revfy
integer fields. These functions have been selected because they are init functions or are called at random times or they have variable loops. Signed-off-by: Emese Revfy --- block/blk-softirq.c | 2 +- drivers/char/random.c| 6 +++--- fs/namespace.c | 2 +- include

[PATCH v3 2/4] Add the latent_entropy gcc plugin

2016-06-14 Thread Emese Revfy
do_one_initcall() and _do_fork(). Signed-off-by: Emese Revfy --- arch/Kconfig| 18 + arch/powerpc/kernel/Makefile| 8 +- include/linux/random.h | 10 + init/main.c | 1 + kernel/fork.c

[PATCH v3 1/4] Add support for passing gcc plugin arguments

2016-06-14 Thread Emese Revfy
Signed-off-by: Emese Revfy --- scripts/Makefile.gcc-plugins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins index 5e22b60..da7f86c 100644 --- a/scripts/Makefile.gcc-plugins +++ b/scripts/Makefile.gcc-plugins

[PATCH v3 0/4] Introduce the latent_entropy gcc plugin

2016-06-14 Thread Emese Revfy
/ephox-gcc-plugins/latent_entropy This patch set is based on the "Introduce GCC plugin infrastructure" patch set (v9 next-20160520). Emese Revfy (4): Add support for passing gcc plugin arguments Add the latent_entropy gcc plugin Mark functions with the latent_entropy attribut

Re: [PATCH v2 1/3] Add the latent_entropy gcc plugin

2016-06-13 Thread Emese Revfy
On Thu, 9 Jun 2016 14:51:45 -0700 Kees Cook wrote: > On Mon, May 30, 2016 at 4:31 PM, Emese Revfy wrote: > > - GCC_PLUGINS_CFLAGS := $(addprefix > > -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) > > + GCC_PLUGINS_CFLAGS := $(strip $(addprefix > > -fpl

Re: [PATCH] gcc-plugins: disable under COMPILE_TEST

2016-06-12 Thread Emese Revfy
On Sun, 12 Jun 2016 15:25:39 -0700 Kees Cook wrote: > I don't like this because it means if someone specifically selects > some plugins in their .config, and the headers are missing, the kernel > will successfully compile. For many plugins, this results in a kernel > that lacks the requested secu

Re: [PATCH] gcc-plugins: disable under COMPILE_TEST

2016-06-12 Thread Emese Revfy
rint a warning). This allows building allyes/allmod configs until the gcc plugin headers get installed. Signed-off-by: Emese Revfy --- Makefile | 6 +++--- scripts/Makefile.gcc-plugins | 8 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b

Re: [PATCH v2 0/3] Introduce the latent_entropy gcc plugin

2016-06-09 Thread Emese Revfy
On Thu, 9 Jun 2016 14:18:08 -0700 Kees Cook wrote: > By the way, as you work on v3, can you also be sure to put your > patches through scripts/checkpatch.pl? There are a lot of >80 > character lines, and other nits. I'd like to minimize the warnings. I only split those lines where the split does

Re: linux-next: build warnings after merge of the kbuild tree

2016-06-09 Thread Emese Revfy
On Thu, 9 Jun 2016 12:22:58 +1000 Stephen Rothwell wrote: > Hi Michal, > > After merging the kbuild tree, today's linux-next build (x86_64 > allmodconfig) produced these warnings: > > Cyclomatic Complexity 1 scripts/mod/devicetable-offsets.c:main > Cyclomatic Complexity 1 kernel/bounds.c:foo >

Re: linux-next: build warnings after merge of the kbuild tree

2016-06-09 Thread Emese Revfy
On Thu, 9 Jun 2016 12:57:16 +0200 Michal Marek wrote: > Dne 9.6.2016 v 06:05 Stephen Rothwell napsal(a): > > On Wed, 8 Jun 2016 19:56:38 -0700 Kees Cook wrote: > >> Ah, yes, that should default to off. We'll get a fix landed ASAP. > > > > Note that this was an allmodconfig build. The default i

Re: [PATCH v9 0/4] Introduce GCC plugin infrastructure

2016-06-07 Thread Emese Revfy
On Tue, 7 Jun 2016 13:59:53 -0700 Kees Cook wrote: > > > > I applied the series to kbuild.git#kbuild now, sorry for the delay. > > Awesome! Thank you very much. I'll prepare the latent entropy plugin > for -next now too. I'll send a new patch series this week because I'm developing a small feat

Re: [PATCH v2 1/3] Add the latent_entropy gcc plugin

2016-06-03 Thread Emese Revfy
On Wed, 1 Jun 2016 12:42:27 -0700 Andrew Morton wrote: > On Tue, 31 May 2016 01:31:45 +0200 Emese Revfy wrote: > > > This plugin mitigates the problem of the kernel having too little entropy > > during > > and after boot for generating crypto keys. > > >

[PATCH v2 3/3] Add the extra_latent_entropy kernel parameter

2016-05-30 Thread Emese Revfy
When extra_latent_entropy is passed on the kernel command line, entropy will be extracted from up to the first 4GB of RAM while the runtime memory allocator is being initialized. Based on work created by the PaX Team. Signed-off-by: Emese Revfy --- Documentation/kernel-parameters.txt | 5

[PATCH v2 2/3] Mark functions with the latent_entropy attribute

2016-05-30 Thread Emese Revfy
integer fields. These functions have been selected because they are init functions or are called at random times or they have variable loops. Signed-off-by: Emese Revfy --- block/blk-softirq.c | 2 +- drivers/char/random.c| 6 +++--- fs/namespace.c | 2 +- include

[PATCH v2 1/3] Add the latent_entropy gcc plugin

2016-05-30 Thread Emese Revfy
do_one_initcall() and _do_fork(). Signed-off-by: Emese Revfy --- arch/Kconfig| 18 ++ arch/powerpc/kernel/Makefile| 8 +- include/linux/random.h | 10 + init/main.c | 1 + kernel/fork.c

[PATCH v2 0/3] Introduce the latent_entropy gcc plugin

2016-05-30 Thread Emese Revfy
/ephox-gcc-plugins/latent_entropy This patch set is based on the "Introduce GCC plugin infrastructure" patch set (v9 next-20160520). Emese Revfy (3): Add the latent_entropy gcc plugin Mark functions with the latent_entropy attribute Add the extra_latent_entropy kernel parameter Chang

Re: [PATCH v1 1/3] Add the latent_entropy gcc plugin

2016-05-30 Thread Emese Revfy
On Tue, 24 May 2016 19:55:17 -0700 Kees Cook wrote: > Yeah, answering "how random is this?" is not easy, but that's not what > I meant. I'm more curious about specific build configs or hardware > where calling get_random_int() early enough would always produce the > same value (or the same value

Re: [PATCH v1 1/3] Add the latent_entropy gcc plugin

2016-05-24 Thread Emese Revfy
On Tue, 24 May 2016 10:32:15 -0700 Kees Cook wrote: > Also, does this matter that it's non-atomic? It seems like the u64 > below is being written to by multiple threads and even read by > multiple threads. Am I misunderstanding something? The non-atomic accesses are intentional because they can

Re: [PATCH v1 2/3] Mark functions with the latent_entropy attribute

2016-05-24 Thread Emese Revfy
On Tue, 24 May 2016 10:16:09 -0700 Kees Cook wrote: > On Mon, May 23, 2016 at 3:16 PM, Emese Revfy wrote: > > +#ifdef CONFIG_MEMORY_HOTPLUG > > +#define add_meminit_latent_entropy > > +#else > > +#define add_meminit_latent_entropy __latent_entropy > > +#

Re: [PATCH v1 3/3] Add the extra_latent_entropy kernel parameter

2016-05-24 Thread Emese Revfy
On Tue, 24 May 2016 10:09:16 -0700 Kees Cook wrote: > On Mon, May 23, 2016 at 3:17 PM, Emese Revfy wrote: > > @@ -1235,6 +1236,15 @@ static void __free_pages_ok(struct page *page, > > unsigned int order) > > } > > > > #ifdef CONFIG_GCC_PLUGIN_LATEN

[PATCH v1 3/3] Add the extra_latent_entropy kernel parameter

2016-05-23 Thread Emese Revfy
When extra_latent_entropy is passed on the kernel command line, entropy will be extracted from up to the first 4GB of RAM while the runtime memory allocator is being initialized. Based on work created by the PaX Team. Signed-off-by: Emese Revfy --- Documentation/kernel-parameters.txt | 5

[PATCH v1 2/3] Mark functions with the latent_entropy attribute

2016-05-23 Thread Emese Revfy
These functions have been selected because they are init functions or are called at random times or they have variable loops. Based on work created by the PaX Team. Signed-off-by: Emese Revfy --- block/blk-softirq.c | 2 +- drivers/char/random.c| 6 +++--- fs/namespace.c

[PATCH v1 1/3] Add the latent_entropy gcc plugin

2016-05-23 Thread Emese Revfy
do_one_initcall() and _do_fork(). Based on work created by the PaX Team. Signed-off-by: Emese Revfy --- arch/Kconfig| 17 ++ arch/powerpc/kernel/Makefile| 8 +- include/linux/random.h | 8 + init/main.c

[PATCH v1 0/3] Introduce the latent_entropy gcc plugin

2016-05-23 Thread Emese Revfy
/ephox-gcc-plugins/latent_entropy This patch set is based on the "Introduce GCC plugin infrastructure" patch set (v9). Emese Revfy (3): Add the latent_entropy gcc plugin Mark functions with the latent_entropy attribute Add the extra_latent_entropy kernel parameter --- Documentat

[PATCH v9 4/4] Add sancov plugin

2016-05-23 Thread Emese Revfy
try Vyukov (https://gcc.gnu.org/viewcvs/gcc?limit_changes=0&view=revision&revision=231296). Signed-off-by: Emese Revfy --- Makefile| 10 +-- arch/Kconfig| 9 +++ arch/x86/purgatory/Makefile | 2 + lib/Kconfig.debug

[PATCH v9 3/4] Add Cyclomatic complexity GCC plugin

2016-05-23 Thread Emese Revfy
er of connected components (exit nodes). Signed-off-by: Emese Revfy --- arch/Kconfig| 12 + scripts/Makefile.gcc-plugins| 1 + scripts/gcc-plugins/Makefile| 1 + scripts/gcc-plugins/cyc_complexity_plugin.c

[PATCH v9 2/4] GCC plugin infrastructure

2016-05-23 Thread Emese Revfy
passes. Note that 'make clean' keeps the *.so files (only the distclean or mrproper targets clean all) because they are needed for out-of-tree modules. Based on work created by the PaX Team. Signed-off-by: Emese Revfy --- .gitignore | 1 + Doc

[PATCH v9 1/4] Shared library support

2016-05-23 Thread Emese Revfy
Infrastructure for building independent shared library targets. Based on work created by the PaX Team. Signed-off-by: Emese Revfy --- scripts/Makefile.build | 2 +- scripts/Makefile.clean | 4 +++- scripts/Makefile.host | 55 +- 3 files

[PATCH v9 0/4] Introduce GCC plugin infrastructure

2016-05-23 Thread Emese Revfy
project supported by the Linux Foundation. Emese Revfy (4): Shared library support GCC plugin infrastructure Add Cyclomatic complexity plugin Add sancov plugin Changes from v8: * Use warnings instead of errors because of allmodconfig/allyesconfig builds with old gcc versions (Suggested-by

Re: [PATCH v8 2/4] GCC plugin infrastructure

2016-05-18 Thread Emese Revfy
On Tue, 17 May 2016 16:28:05 +0200 Michal Marek wrote: > Dne 13.5.2016 v 01:57 Emese Revfy napsal(a): > > --- /dev/null > > +++ b/scripts/Makefile.gcc-plugins > > @@ -0,0 +1,21 @@ > > +ifdef CONFIG_GCC_PLUGINS > > + __PLUGINCC := $(call cc-ifversion

Re: [kernel-hardening] [PATCH v8 3/4] Add Cyclomatic complexity GCC plugin

2016-05-18 Thread Emese Revfy
On Wed, 18 May 2016 18:25:00 +1000 Andrew Donnellan wrote: > On 13/05/16 09:58, Emese Revfy wrote: > > Add a very simple plugin to demonstrate the GCC plugin infrastructure. This > > GCC > > plugin computes the cyclomatic complexity of each function. &g

Re: [kernel-hardening] [PATCH v8 2/4] GCC plugin infrastructure

2016-05-18 Thread Emese Revfy
> I've done some basic sanity testing on powerpc with the cyclomatic > complexity plugin (with LE native + cross-compilers) and it seems to > work with the patch below. > > Signed-off-by: Andrew Donnellan > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index a18a0dc..0cfed5b 100

[PATCH v8 4/4] Add sancov plugin

2016-05-12 Thread Emese Revfy
try Vyukov (https://gcc.gnu.org/viewcvs/gcc?limit_changes=0&view=revision&revision=231296). Signed-off-by: Emese Revfy --- Makefile| 12 +-- arch/Kconfig| 9 +++ arch/x86/purgatory/Makefile | 2 + lib/Kconfig.debug

[PATCH v8 3/4] Add Cyclomatic complexity GCC plugin

2016-05-12 Thread Emese Revfy
er of connected components (exit nodes). Signed-off-by: Emese Revfy --- arch/Kconfig| 12 + scripts/Makefile.gcc-plugins| 1 + scripts/gcc-plugins/Makefile| 1 + scripts/gcc-plugins/cyc_complexity_plugin.c

[PATCH v8 2/4] GCC plugin infrastructure

2016-05-12 Thread Emese Revfy
passes. Note that 'make clean' keeps the *.so files (only the distclean or mrproper targets clean all) because they are needed for out-of-tree modules. The arm and arm64 architectures were tested by David Brown . Signed-off-by: Emese Revfy ---

[PATCH v8 1/4] Shared library support

2016-05-12 Thread Emese Revfy
Infrastructure for building independent shared library targets. Signed-off-by: Emese Revfy --- scripts/Makefile.build | 2 +- scripts/Makefile.clean | 4 +++- scripts/Makefile.host | 55 +- 3 files changed, 58 insertions(+), 3 deletions

[PATCH v8 0/4] Introduce GCC plugin infrastructure

2016-05-12 Thread Emese Revfy
. Emese Revfy (4): Shared library support GCC plugin infrastructure Add Cyclomatic complexity plugin Add sancov plugin Changes from v7: * Moved the "The GCC plugin infrastructure supports the arm and arm64 architectures too" and the "Documentations of the GCC plugin infrast

Re: [PATCH v7 2/6] GCC plugin infrastructure

2016-05-12 Thread Emese Revfy
On Wed, 11 May 2016 13:24:30 +0200 Michal Marek wrote: > On 2016-04-22 20:22, Emese Revfy wrote: > > diff --git a/Documentation/dontdiff b/Documentation/dontdiff > > index 8ea834f..5385cba 100644 > > --- a/Documentation/dontdiff > > +++ b/Documentation/dontdiff &g

Re: [PATCH v7 1/6] Shared library support

2016-05-05 Thread Emese Revfy
On Tue, 3 May 2016 23:25:27 +0200 Emese Revfy wrote: > > Do you need to change both the top Makefile and Makefile.clean > > for belt-and-braces cleaning? > > It doesn't delete the *.so files without the hunk from the top Makefile. > The mrproper and distclean tar

Re: [PATCH v7 1/6] Shared library support

2016-05-05 Thread Emese Revfy
On Wed, 4 May 2016 13:09:05 +0900 Masahiro Yamada wrote: > Hi Emese, > > > 2016-05-04 6:29 GMT+09:00 Emese Revfy : > > On Tue, 3 May 2016 11:00:56 +0900 > > Masahiro Yamada wrote: > > > > Hi, > > > >> # Compile .c file, create posit

Re: [PATCH v7 1/6] Shared library support

2016-05-03 Thread Emese Revfy
On Tue, 3 May 2016 11:00:56 +0900 Masahiro Yamada wrote: Hi, > # Compile .c file, create position independent .o file > # host-cxxshobjs -> .o > quiet_cmd_host-cxxshobjs = HOSTCXX -fPIC $@ > cmd_host-cxxshobjs = $(HOSTCXX) $(hostcxx_flags) -fPIC -c -o $@ $< >$(h

Re: [PATCH v7 1/6] Shared library support

2016-05-03 Thread Emese Revfy
On Mon, 2 May 2016 14:03:00 +0900 Masahiro Yamada wrote: Hi, > > diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean > > index 55c96cb..e4e88ab 100644 > > --- a/scripts/Makefile.clean > > +++ b/scripts/Makefile.clean > > @@ -38,7 +38,8 @@ subdir-ymn:= $(addprefix $(obj)/,$(subdir-ym

  1   2   >