Re: [RFC PATCH 5/5] livepatch: x86: remove unused relocation code

2015-11-12 Thread Josh Poimboeuf
On Wed, Nov 11, 2015 at 04:48:07PM +0100, Petr Mladek wrote: > On Mon 2015-11-09 23:45:55, Jessica Yu wrote: > > Architecture-specific relocation code no longer needed, since symbol > > resolution and relocation work will be offloaded to module loader. > >

Re: module: save load_info for livepatch modules

2015-11-12 Thread Josh Poimboeuf
On Thu, Nov 12, 2015 at 04:03:45PM +0100, Petr Mladek wrote: > On Thu 2015-11-12 14:22:28, Miroslav Benes wrote: > > On Thu, 12 Nov 2015, Petr Mladek wrote: > > > > >Maybe I am missing something but isn't it necessary to call vfree() on > > > > >info somewhere in the end? > > > > > > > > So

Re: livepatch: reuse module loader code to write relocations

2015-11-12 Thread Josh Poimboeuf
On Thu, Nov 12, 2015 at 04:27:01PM +0100, Miroslav Benes wrote: > On Wed, 11 Nov 2015, Jessica Yu wrote: > > > +++ Miroslav Benes [11/11/15 15:30 +0100]: > > > On Mon, 9 Nov 2015, Jessica Yu wrote: > > > > > > So I guess we don't need klp_reloc anymore. > > > > Yes, that's correct. I am noticing

Re: [PATCH 4/4] module: clean up RO/NX handling.

2015-11-11 Thread Josh Poimboeuf
On Thu, Nov 12, 2015 at 11:58:25AM +1030, Rusty Russell wrote: > Josh Poimboeuf <jpoim...@redhat.com> writes: > > On Tue, Nov 10, 2015 at 12:27:34PM +1030, Rusty Russell wrote: > >> Josh Poimboeuf <jpoim...@redhat.com> writes: > >> > On Mon, Nov 09, 201

Re: [RFC PATCH 2/5] module: save load_info for livepatch modules

2015-11-12 Thread Josh Poimboeuf
On Mon, Nov 09, 2015 at 11:45:52PM -0500, Jessica Yu wrote: > In livepatch modules, preserve section, symbol, string information from > the load_info struct in the module loader. This information is used to > patch modules that are not loaded in memory yet; specifically it is used > to resolve

Re: [RFC PATCH 2/5] module: save load_info for livepatch modules

2015-11-12 Thread Josh Poimboeuf
On Mon, Nov 09, 2015 at 11:45:52PM -0500, Jessica Yu wrote: > In livepatch modules, preserve section, symbol, string information from > the load_info struct in the module loader. This information is used to > patch modules that are not loaded in memory yet; specifically it is used > to resolve

Re: [PATCH v2] livepatch: x86: bugfix about kASLR

2015-11-10 Thread Josh Poimboeuf
On Fri, Nov 06, 2015 at 02:25:00PM +0800, Zhou Chengming wrote: > When enable KASLR, livepatch will adjust old_addr of changed > function accordingly. So do the same thing for reloc. > > [PATCH v1] https://lkml.org/lkml/2015/11/4/91 > > Reported-by: Cyril B. >

Re: [RFC PATCH 4/5] samples: livepatch: init reloc list and mark as klp module

2015-11-10 Thread Josh Poimboeuf
On Tue, Nov 10, 2015 at 09:15:54AM +0100, Jiri Slaby wrote: > On 11/10/2015, 05:45 AM, Jessica Yu wrote: > > Intialize the list of relocation sections in the sample > > klp_object (even if the list will be empty in this case). > > Also mark module as a livepatch module so that the module > >

Re: [PATCH v3] livepatch: old_name,number scheme in livepatch sysfs directory

2015-11-10 Thread Josh Poimboeuf
On Tue, Nov 10, 2015 at 09:49:09AM +0100, Miroslav Benes wrote: > On Mon, 9 Nov 2015, Josh Poimboeuf wrote: > > > On Mon, Nov 09, 2015 at 05:01:18PM -0600, Chris J Arges wrote: > > > On 11/09/2015 02:56 PM, Josh Poimboeuf wrote: > > > > I'd recommend splitting

Re: [PATCH] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-02 Thread Josh Poimboeuf
On Mon, Nov 02, 2015 at 02:16:16PM -0600, Chris J Arges wrote: > On Mon, Nov 02, 2015 at 01:52:44PM -0600, Josh Poimboeuf wrote: > > On Mon, Nov 02, 2015 at 11:58:47AM -0600, Chris J Arges wrote: > > > The following directory structure will allow for cases when the same > >

Re: [PATCH] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-02 Thread Josh Poimboeuf
On Mon, Nov 02, 2015 at 11:58:47AM -0600, Chris J Arges wrote: > The following directory structure will allow for cases when the same > function name exists in a single object. > /sys/kernel/livepatch/// > > The number is incremented on each known initialized func kobj thus creating >

[PATCH] x86/livepatch: Fix crash with !CONFIG_DEBUG_SET_MODULE_RONX

2015-11-02 Thread Josh Poimboeuf
in a page fault when load_module() does "mod->state = MODULE_STATE_LIVE". Reported-by: Cyril B. <c...@alwaysdata.com> Tested-by: Cyril B. <c...@alwaysdata.com> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/kernel/livepatch.c | 9 + 1 f

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-03 Thread Josh Poimboeuf
On Tue, Nov 03, 2015 at 01:44:41PM +0100, Petr Mladek wrote: > Also I would omit the suffix at all when it is the first occurrence. > It will cause that unique symbols will not be numbered. That would make parsing the entry unnecessarily harder and more error-prone. I think it should always have

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-03 Thread Josh Poimboeuf
On Tue, Nov 03, 2015 at 10:50:05AM +0100, Miroslav Benes wrote: > On Mon, 2 Nov 2015, Chris J Arges wrote: > > > The following directory structure will allow for cases when the same > > function name exists in a single object. > > /sys/kernel/livepatch/// > > There is still a period here and

Re: [PATCH] x86/livepatch: Fix crash with !CONFIG_DEBUG_SET_MODULE_RONX

2015-11-03 Thread Josh Poimboeuf
On Tue, Nov 03, 2015 at 11:22:12AM +0100, Miroslav Benes wrote: > On Mon, 2 Nov 2015, Josh Poimboeuf wrote: > > > When loading a patch module on a kernel with > > !CONFIG_DEBUG_SET_MODULE_RONX, the following crash occurs: > > > > [ 205.988776] livepatch: enablin

Re: [PATCH v14 00/24] Compile-time stack metadata validation

2015-11-04 Thread Josh Poimboeuf
On Wed, Oct 21, 2015 at 11:11:39AM -0500, Josh Poimboeuf wrote: > This is v14 of the compile-time stack metadata validation patch set, > along with proposed fixes for many of the warnings it found. It's based > on the tip/master branch. > > v13 can be found here: > > http

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Josh Poimboeuf
On Wed, Nov 04, 2015 at 11:56:13PM +0100, Jiri Kosina wrote: > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > Subject: [PATCH] livepatch: Cleanup page permission changes > > > > Calling set_memory_rw() and set_memory_ro() for every iteration of the > > loop i

[PATCH] livepatch: Cleanup page permission changes

2015-11-03 Thread Josh Poimboeuf
ter the loop. Suggested-by: Miroslav Benes <mbe...@suse.cz> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/kernel/livepatch.c | 25 ++--- kernel/livepatch/core.c | 42 +- 2 files changed, 39 insertions(+

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-05 Thread Josh Poimboeuf
On Thu, Nov 05, 2015 at 09:17:59AM -0600, Josh Poimboeuf wrote: > On Thu, Nov 05, 2015 at 10:40:26AM +0100, Jiri Kosina wrote: > > On Thu, 5 Nov 2015, Jiri Kosina wrote: > > > > > > > > +#ifdef CONFIG_DEBUG_SET_MODULE_RONX > > > > > > +sta

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-05 Thread Josh Poimboeuf
On Thu, Nov 05, 2015 at 04:18:12PM +0100, Miroslav Benes wrote: > On Wed, 4 Nov 2015, Josh Poimboeuf wrote: > > > On Wed, Nov 04, 2015 at 10:52:52AM +0100, Miroslav Benes wrote: > > > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > > > Object entry would be

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-03 Thread Josh Poimboeuf
On Tue, Nov 03, 2015 at 08:57:24PM +0100, Jiri Kosina wrote: > On Tue, 3 Nov 2015, Petr Mladek wrote: > > > Also I would omit the suffix at all when it is the first occurrence. It > > will cause that unique symbols will not be numbered. > > That'd mean that the names (including suffixes) are

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Josh Poimboeuf
On Wed, Nov 04, 2015 at 10:10:06AM -0600, Josh Poimboeuf wrote: > On Wed, Nov 04, 2015 at 10:18:29AM +0100, Jiri Kosina wrote: > > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > > > It's probably a good idea to keep the patches bisectable, so I made this > > &g

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-04 Thread Josh Poimboeuf
On Wed, Nov 04, 2015 at 10:52:52AM +0100, Miroslav Benes wrote: > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > Object entry would be empty for not loaded object. I would not > > > dare to propose to remove such object entries. It would make things > > > worse

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Josh Poimboeuf
On Wed, Nov 04, 2015 at 10:18:29AM +0100, Jiri Kosina wrote: > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > It's probably a good idea to keep the patches bisectable, so I made this > > a separate patch which applies on top of the first one. > > > > (Note

[PATCH v2 0/3] CONFIG_DEBUG_SET_MODULE_RONX bug fix and cleanups

2015-11-05 Thread Josh Poimboeuf
/3 is a livepatch cleanup for simplification of the livepatch relocation code. v2: - removed set_page_attributes() duplication in livepatch cleanup patch in favor of using new {un}set_module_core_ro_nx() functions - changed 'size' from int to size_t Josh Poimboeuf (3): livepatch: Fix crash

[PATCH v2 1/3] livepatch: Fix crash with !CONFIG_DEBUG_SET_MODULE_RONX

2015-11-05 Thread Josh Poimboeuf
in a page fault when load_module() does "mod->state = MODULE_STATE_LIVE". Reported-by: Cyril B. <c...@alwaysdata.com> Tested-by: Cyril B. <c...@alwaysdata.com> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/kernel/livepatch.c | 9 + 1 f

[PATCH v2 3/3] livepatch: Cleanup module page permission changes

2015-11-05 Thread Josh Poimboeuf
() functions are used to change the page permissions. Toggling NX isn't necessary in this case, but it's not highly performance sensitive code so it should be fine. Suggested-by: Miroslav Benes <mbe...@suse.cz> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/kernel/live

[PATCH v2 2/3] module: Use the same logic for setting and unsetting RO/NX

2015-11-05 Thread Josh Poimboeuf
asymmetrical. Instead, use the same logic to do both. Also add some new set_module_{init,core}_ro_nx() helper functions for more symmetry with the unset functions. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- kernel/module.c | 57 ++

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-05 Thread Josh Poimboeuf
On Thu, Nov 05, 2015 at 10:40:26AM +0100, Jiri Kosina wrote: > On Thu, 5 Nov 2015, Jiri Kosina wrote: > > > > > > +#ifdef CONFIG_DEBUG_SET_MODULE_RONX > > > > > +static void set_page_attributes(void *start, void *end, > > > > > + int (*set)(unsigned long start, int >

Re: [PATCH v2 3/3] livepatch: Cleanup module page permission changes

2015-11-06 Thread Josh Poimboeuf
On Fri, Nov 06, 2015 at 02:42:46PM +0100, Petr Mladek wrote: > On Fri 2015-11-06 06:12:47, Josh Poimboeuf wrote: > > On Fri, Nov 06, 2015 at 11:40:55AM +0100, Petr Mladek wrote: > > > On Thu 2015-11-05 15:18:05, Josh Poimboeuf wrote: > > > > Calling set_memory_rw()

Re: [PATCH v2 3/3] livepatch: Cleanup module page permission changes

2015-11-06 Thread Josh Poimboeuf
On Fri, Nov 06, 2015 at 11:40:55AM +0100, Petr Mladek wrote: > On Thu 2015-11-05 15:18:05, Josh Poimboeuf wrote: > > Calling set_memory_rw() and set_memory_ro() for every iteration of the > > loop in klp_write_object_relocations() is messy, inefficient, and > > error-prone

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-03 Thread Josh Poimboeuf
On Tue, Nov 03, 2015 at 11:52:08AM +0100, Miroslav Benes wrote: > On Mon, 2 Nov 2015, Chris J Arges wrote: > > [...] > > > +static int klp_get_func_pos_callback(void *data, const char *name, > > + struct module *mod, unsigned long addr) > > +{ > > + struct

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-03 Thread Josh Poimboeuf
On Tue, Nov 03, 2015 at 05:09:48PM +0100, Miroslav Benes wrote: > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > On Tue, Nov 03, 2015 at 11:52:08AM +0100, Miroslav Benes wrote: > > > On Mon, 2 Nov 2015, Chris J Arges wrote: > > > > > > [...] > > >

Re: [PATCH v13 00/23] Compile-time stack metadata validation

2015-10-12 Thread Josh Poimboeuf
On Mon, Oct 12, 2015 at 09:41:11AM +0200, Ingo Molnar wrote: > > * Josh Poimboeuf <jpoim...@redhat.com> wrote: > > > Hi Ingo, > > > > Do you have any more objections to these patches? Would you be willing > > to apply them? > > So I still don't

Re: [PATCH v6 0/4] Compile-time stack validation

2015-07-07 Thread Josh Poimboeuf
On Tue, Jul 07, 2015 at 09:54:09AM -0500, Josh Poimboeuf wrote: Also posting a listing of the reported warnings in a reply to this email. These are the currently reported stackvalidate warnings on tip/master with my Fedora-based config. There were over 1400 warnings, in 37 .c files and 18 .S

Re: [PATCH v6 4/4] stackvalidate: Add ignore macros

2015-07-07 Thread Josh Poimboeuf
On Tue, Jul 07, 2015 at 03:00:38PM -0700, Andy Lutomirski wrote: On Tue, Jul 7, 2015 at 7:54 AM, Josh Poimboeuf jpoim...@redhat.com wrote: Add new stackvalidate ignore macros: STACKVALIDATE_IGNORE_INSN and STACKVALIDATE_IGNORE_FUNC. These can be used to tell stackvalidate to skip

Re: [PATCH v6 2/4] x86/stackvalidate: Compile-time stack validation

2015-07-07 Thread Josh Poimboeuf
On Tue, Jul 07, 2015 at 03:57:14PM -0700, Andy Lutomirski wrote: On Tue, Jul 7, 2015 at 7:54 AM, Josh Poimboeuf jpoim...@redhat.com wrote: 5. A callable function may not jump to a dynamically determined address. Such jumps can't be validated since the jump destination is unknown

Re: [PATCH v6 2/4] x86/stackvalidate: Compile-time stack validation

2015-07-07 Thread Josh Poimboeuf
On Tue, Jul 07, 2015 at 04:35:17PM -0700, Andy Lutomirski wrote: On Tue, Jul 7, 2015 at 4:29 PM, Josh Poimboeuf jpoim...@redhat.com wrote: On Tue, Jul 07, 2015 at 03:57:14PM -0700, Andy Lutomirski wrote: On Tue, Jul 7, 2015 at 7:54 AM, Josh Poimboeuf jpoim...@redhat.com wrote

Re: [PATCH v6 0/4] Compile-time stack validation

2015-07-07 Thread Josh Poimboeuf
On Tue, Jul 07, 2015 at 09:54:09AM -0500, Josh Poimboeuf wrote: I did some more looking and it turns out that inline assembly doesn't play nicely with frame pointers at all. If the inline asm is at the beginning of the function, gcc sometimes emits the inline asm code before

Re: [PATCH v6 4/4] stackvalidate: Add ignore macros

2015-07-07 Thread Josh Poimboeuf
On Tue, Jul 07, 2015 at 04:00:54PM -0700, Andy Lutomirski wrote: On Tue, Jul 7, 2015 at 3:59 PM, Josh Poimboeuf jpoim...@redhat.com wrote: On Tue, Jul 07, 2015 at 03:00:38PM -0700, Andy Lutomirski wrote: On Tue, Jul 7, 2015 at 7:54 AM, Josh Poimboeuf jpoim...@redhat.com wrote: Add new

[PATCH v6 0/4] Compile-time stack validation

2015-07-07 Thread Josh Poimboeuf
-independent, as suggested by H. Peter Anvin v2: - Fixed memory leaks reported by Petr Mladek Josh Poimboeuf (4): x86/asm: Frame pointer macro cleanup x86/stackvalidate: Compile-time stack validation x86/stackvalidate: Add file and directory ignores stackvalidate: Add ignore macros

[PATCH v6 1/4] x86/asm: Frame pointer macro cleanup

2015-07-07 Thread Josh Poimboeuf
The FRAME/ENDFRAME asm macros for setting up and restoring the frame pointer aren't currently being used. However, they will be needed soon to help asm functions to comply with stackvalidate. Make the code more readable and improve the comments. Signed-off-by: Josh Poimboeuf jpoim...@redhat.com

[PATCH v6 2/4] x86/stackvalidate: Compile-time stack validation

2015-07-07 Thread Josh Poimboeuf
seconds of total CPU). It hasn't been optimized for performance yet, so there are probably some opportunities for better build performance. Signed-off-by: Josh Poimboeuf jpoim...@redhat.com --- Documentation/stack-validation.txt| 189 MAINTAINERS | 8 + arch

[PATCH v6 4/4] stackvalidate: Add ignore macros

2015-07-07 Thread Josh Poimboeuf
Add new stackvalidate ignore macros: STACKVALIDATE_IGNORE_INSN and STACKVALIDATE_IGNORE_FUNC. These can be used to tell stackvalidate to skip validation of an instruction or a function, respectively. Signed-off-by: Josh Poimboeuf jpoim...@redhat.com --- include/linux/stackvalidate.h | 38

[PATCH v6 3/4] x86/stackvalidate: Add file and directory ignores

2015-07-07 Thread Josh Poimboeuf
. Signed-off-by: Josh Poimboeuf jpoim...@redhat.com --- arch/x86/boot/Makefile| 3 ++- arch/x86/boot/compressed/Makefile | 3 ++- arch/x86/entry/vdso/Makefile | 5 - arch/x86/purgatory/Makefile | 2 ++ arch/x86/realmode/Makefile| 4 +++- arch/x86

Re: [PATCH v6 2/4] x86/stackvalidate: Compile-time stack validation

2015-07-09 Thread Josh Poimboeuf
On Tue, Jul 07, 2015 at 04:35:17PM -0700, Andy Lutomirski wrote: On Tue, Jul 7, 2015 at 4:29 PM, Josh Poimboeuf jpoim...@redhat.com wrote: On Tue, Jul 07, 2015 at 03:57:14PM -0700, Andy Lutomirski wrote: On Tue, Jul 7, 2015 at 7:54 AM, Josh Poimboeuf jpoim...@redhat.com wrote

Re: [PATCH v11 00/20] Compile-time stack validation

2015-08-27 Thread Josh Poimboeuf
On Wed, Aug 26, 2015 at 09:07:23AM +0200, Ingo Molnar wrote: * Josh Poimboeuf jpoim...@redhat.com wrote: BTW, since I'm planning on adding a CFI generation option to this tool, I wonder if stackvalidate is a misnomer. I can't think of anything better. Any naming ideas

Re: [PATCH v11 03/20] x86/stackvalidate: Compile-time stack validation

2015-08-27 Thread Josh Poimboeuf
On Wed, Aug 26, 2015 at 04:26:28PM +0200, Andi Kleen wrote: b) 100% reliable stack traces for DWARF enabled kernels This is not yet implemented. See Documentation/stack-validation.txt for more details about what is planned. The automatic CFI generation tool seems like a bad idea

Re: [PATCH v11 00/20] Compile-time stack validation

2015-08-28 Thread Josh Poimboeuf
On Fri, Aug 28, 2015 at 10:21:16AM +0200, Ingo Molnar wrote: * Josh Poimboeuf jpoim...@redhat.com wrote: On Wed, Aug 26, 2015 at 09:07:23AM +0200, Ingo Molnar wrote: * Josh Poimboeuf jpoim...@redhat.com wrote: BTW, since I'm planning on adding a CFI generation option

[PATCH v12 02/21] x86/asm: Frame pointer macro cleanup

2015-09-09 Thread Josh Poimboeuf
the comments. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/frame.h | 33 ++--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/frame.h b/arch/x86/include/asm/frame.h index 793179c..8a6cd26 100644 --- a/ar

[PATCH v12 01/21] tools: Fix formatting of the "make -C tools" help message

2015-09-09 Thread Josh Poimboeuf
Align the x86_energy_perf_policy line with the others and restore the original alphabetical sorting. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/Makefile | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/Make

[PATCH v12 16/21] x86/asm/crypto: Create stack frames in clmul_ghash_mul/update()

2015-09-09 Thread Josh Poimboeuf
clmul_ghash_mul() and clmul_ghash_update() are callable non-leaf functions which don't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create stack frames for them when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Herbert Xu

[PATCH v12 17/21] x86/asm/entry: Create stack frames in thunk functions

2015-09-09 Thread Josh Poimboeuf
type. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/entry/thunk_64.S | 4 1 file changed, 4 insertions(+) diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S index efb2b93..98df1fa 100644 --- a/arch/x86/entry/thunk_64.S +++ b/arch/x86/entry/thun

[PATCH v12 19/21] x86/asm: Create stack frames in rwsem functions

2015-09-09 Thread Josh Poimboeuf
rwsem.S has several callable non-leaf functions which don't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create stack frames for them when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/lib/rwsem.S | 11 ++-

[PATCH v12 21/21] x86/asm/power: Create stack frames in hibernate_asm_64.S

2015-09-09 Thread Josh Poimboeuf
is enabled and give them proper ELF function annotations. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Acked-by: Pavel Machek <pa...@ucw.cz> Cc: "Rafael J. Wysocki" <r...@rjwysocki.net> --- arch/x86/power/hibernate_asm_64.S | 7 +++ 1 file changed, 7 insertio

[PATCH v12 20/21] x86/asm/efi: Create a stack frame in efi_call()

2015-09-09 Thread Josh Poimboeuf
efi_call() is a callable non-leaf function which doesn't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create a stack frame for it when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Reviewed-by: Matt Fleming <matt.flem...@

[PATCH v12 00/21] Compile-time stack metadata validation

2015-09-09 Thread Josh Poimboeuf
Linus Torvalds <torva...@linux-foundation.org> Cc: Andi Kleen <a...@firstfloor.org> Cc: Pedro Alves <pal...@redhat.com> Cc: Namhyung Kim <namhy...@gmail.com> Cc: Bernd Petrovitsch <be...@petrovitsch.priv.at> Cc: "Chris J Arges" <chris.j.ar...@canonical.com> Cc: Andrew Morton <

[PATCH v12 03/21] x86/asm: Add C versions of frame pointer macros

2015-09-09 Thread Josh Poimboeuf
Add C versions of the frame pointer macros which can be used to create a stack frame in inline assembly. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/frame.h | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/i

[PATCH v12 18/21] x86/asm/acpi: Create a stack frame in do_suspend_lowlevel()

2015-09-09 Thread Josh Poimboeuf
do_suspend_lowlevel() is a callable non-leaf function which doesn't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create a stack frame for it when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Acked-by: Pavel Machek <pa...@u

[PATCH v12 10/21] x86/amd: Set ELF function type for vide()

2015-09-09 Thread Josh Poimboeuf
vide() is a callable function, but is missing the ELF function type, which confuses tools like stacktool. Properly annotate it to be a callable function. The generated code is unchanged. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/kernel/cpu/amd.c | 5 - 1 file c

[PATCH v12 14/21] x86/asm/crypto: Move .Lbswap_mask data to .rodata section

2015-09-09 Thread Josh Poimboeuf
, 7, 6, 5, 4, 3, 2, 1, 0 Move it to .rodata which is a more appropriate section for read-only data. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Herbert Xu <herb...@gondor.apana.org.au> Cc: "David S. Miller" <da...@davemloft.net> --- arch/x86/crypto/aesn

[PATCH v12 06/21] x86/stacktool: Add ignore macros

2015-09-09 Thread Josh Poimboeuf
Add new stacktool ignore macros: STACKTOOL_IGNORE_INSN and STACKTOOL_IGNORE_FUNC. These can be used to tell stacktool to skip validation of an instruction or a function, respectively. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/stacktool.

[PATCH v12 08/21] x86/paravirt: Add stack frame dependency to PVOP inline asm calls

2015-09-09 Thread Josh Poimboeuf
if CONFIG_FRAME_POINTER is enabled by listing the stack pointer as an output operand for the PVOP inline asm statements. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Jeremy Fitzhardinge <jer...@goop.org> Cc: Chris Wright <chr...@sous-sol.org> Cc: Alok Kataria <akata...@vmware.com&g

[PATCH v12 13/21] x86/asm/crypto: Create stack frames in aesni-intel_asm.S

2015-09-09 Thread Josh Poimboeuf
aesni-intel_asm.S has several callable non-leaf functions which don't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create stack frames for them when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Herbert Xu

[PATCH v12 12/21] x86/xen: Add xen_cpuid() and xen_setup_gdt() to stacktool whitelists

2015-09-09 Thread Josh Poimboeuf
use of the instruction. Add both functions to the stacktool whitelist. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Cc: Boris Ostrovsky <boris.ostrov...@oracle.com> Cc: David Vrabel <david.vra...@citrix.com> --- arch

[PATCH v12 09/21] x86/paravirt: Create a stack frame in PV_CALLEE_SAVE_REGS_THUNK

2015-09-09 Thread Josh Poimboeuf
functions. Create a stack frame when CONFIG_FRAME_POINTER is enabled and add the ELF function type. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Jeremy Fitzhardinge <jer...@goop.org> Cc: Chris Wright <chr...@sous-sol.org> Cc: Alok Kataria <akata...@vmware.com&g

[PATCH v12 07/21] x86/xen: Add stack frame dependency to hypercall inline asm calls

2015-09-09 Thread Josh Poimboeuf
is enabled by listing the stack pointer as an output operand for the hypercall inline asm statements. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Cc: Boris Ostrovsky <boris.ostrov...@oracle.com> Cc: David Vrabel <da

[PATCH v12 11/21] x86/reboot: Add ljmp instructions to stacktool whitelist

2015-09-09 Thread Josh Poimboeuf
stacktool reports a false positive warning for the ljmp instruction in machine_real_restart(). Normally, ljmp isn't allowed in a function, but this is a special case where it's jumping into real mode. Add the jumps to a whitelist which tells stacktool to ignore them. Signed-off-by: Josh

[PATCH v12 05/21] x86/stacktool: Add file and directory ignores

2015-09-09 Thread Josh Poimboeuf
. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/boot/Makefile| 3 ++- arch/x86/boot/compressed/Makefile | 3 ++- arch/x86/entry/vdso/Makefile | 5 - arch/x86/purgatory/Makefile | 2 ++ arch/x86/realmode/Makefile| 4 +++-

[PATCH v12 15/21] x86/asm/crypto: Move jump_table to .rodata section

2015-09-09 Thread Josh Poimboeuf
. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Herbert Xu <herb...@gondor.apana.org.au> Cc: "David S. Miller" <da...@davemloft.net> --- arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/cryp

Re: [PATCH v11 00/20] Compile-time stack validation

2015-09-14 Thread Josh Poimboeuf
On Mon, Sep 14, 2015 at 03:19:52PM +0200, Ingo Molnar wrote: > > > In this case it would be a simple: > > > > > >debuginfo check all > > > > > > to check everything. You can also make the selection of debuginfo > > > components > > > to check a regular option, not a subcommand. > > > >

Re: [PATCH v12 00/21] Compile-time stack metadata validation

2015-09-15 Thread Josh Poimboeuf
On Tue, Sep 15, 2015 at 11:57:00AM -0500, Chris J Arges wrote: > I got the following compiler error when building v12 of this patchset: > > DESCEND stacktool > CC stacktool.o > CC elf.o > CC special.o > CC arch/x86/decode.o > LD arch/x86/stacktool-in.o >

Re: [PATCH v13 13/23] x86/asm/crypto: Create stack frames in aesni-intel_asm.S

2015-10-01 Thread Josh Poimboeuf
On Thu, Oct 01, 2015 at 08:10:26AM +0200, mini...@ld-linux.so wrote: > On Tue, Sep 22, 2015 at 10:47:04AM -0500, Josh Poimboeuf wrote: > > aesni-intel_asm.S has several callable non-leaf functions which don't > > honor CONFIG_FRAME_POINTER, which can result in bad stack traces.

Re: [PATCH v13.1 04/23] x86/stacktool: Compile-time stack metadata validation

2015-10-01 Thread Josh Poimboeuf
On Thu, Oct 01, 2015 at 09:50:51AM -0500, Chris J Arges wrote: > > > + > > +$(STACKTOOL_IN): FORCE > > + @$(MAKE) $(build)=stacktool > > + > > +$(STACKTOOL): $(STACKTOOL_IN) > > + @(test -d ../../kernel -a -d ../../tools -a -d ../stacktool && (( \ > > + diff -I'^#include'

Re: [PATCH v13 13/23] x86/asm/crypto: Create stack frames in aesni-intel_asm.S

2015-10-01 Thread Josh Poimboeuf
On Thu, Oct 01, 2015 at 07:36:54PM +0200, Mathias Krause wrote: > On Do, Okt 01, 2015 at 08:29:50 -0500, Josh Poimboeuf wrote: > > On Thu, Oct 01, 2015 at 08:10:26AM +0200, mini...@ld-linux.so wrote: > > > On Tue, Sep 22, 2015 at 10:47:04AM -0500, Josh Poimboeuf wrote: > >

Re: [PATCH v13 00/23] Compile-time stack metadata validation

2015-09-28 Thread Josh Poimboeuf
Hi Ingo, Do you have any more objections to these patches? Would you be willing to apply them? Thanks! Josh On Tue, Sep 22, 2015 at 10:46:51AM -0500, Josh Poimboeuf wrote: > This is v13 of the compile-time stack metadata validation patch set, > along with proposed fixes fo

[PATCH v13 02/23] x86/asm: Frame pointer macro cleanup

2015-09-22 Thread Josh Poimboeuf
the comments. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/frame.h | 33 ++--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/frame.h b/arch/x86/include/asm/frame.h index 793179c..8a6cd26 100644 --- a/ar

[PATCH v13 00/23] Compile-time stack metadata validation

2015-09-22 Thread Josh Poimboeuf
t; Cc: Chris J Arges <chris.j.ar...@canonical.com> Cc: Andrew Morton <a...@linux-foundation.org> Chris J Arges (2): x86/uaccess: Add stack frame output operand in get_user inline asm x86/stacktool: Ignore head_$(BITS) files. Josh Poimboeuf (21): tools: Fix formatting of the

[PATCH v13 03/23] x86/asm: Add C versions of frame pointer macros

2015-09-22 Thread Josh Poimboeuf
Add C versions of the frame pointer macros which can be used to create a stack frame in inline assembly. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/frame.h | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/i

[PATCH v13 14/23] x86/asm/crypto: Move .Lbswap_mask data to .rodata section

2015-09-22 Thread Josh Poimboeuf
, 7, 6, 5, 4, 3, 2, 1, 0 Move it to .rodata which is a more appropriate section for read-only data. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Herbert Xu <herb...@gondor.apana.org.au> Cc: David S. Miller <da...@davemloft.net> --- arch/x86/crypto/aesni-intel_as

[PATCH v13 13/23] x86/asm/crypto: Create stack frames in aesni-intel_asm.S

2015-09-22 Thread Josh Poimboeuf
aesni-intel_asm.S has several callable non-leaf functions which don't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create stack frames for them when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Herbert Xu

[PATCH v13 05/23] x86/stacktool: Add file and directory ignores

2015-09-22 Thread Josh Poimboeuf
. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/boot/Makefile| 3 ++- arch/x86/boot/compressed/Makefile | 3 ++- arch/x86/entry/vdso/Makefile | 5 - arch/x86/purgatory/Makefile | 2 ++ arch/x86/realmode/Makefile| 4 +++-

[PATCH v13 07/23] x86/xen: Add stack frame dependency to hypercall inline asm calls

2015-09-22 Thread Josh Poimboeuf
is enabled by listing the stack pointer as an output operand for the hypercall inline asm statements. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Reviewed-by: David Vrabel <david.vra...@citrix.com> Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Cc: Boris Ostro

[PATCH v13 06/23] x86/stacktool: Add ignore macros

2015-09-22 Thread Josh Poimboeuf
Add new stacktool ignore macros: STACKTOOL_IGNORE_INSN and STACKTOOL_IGNORE_FUNC. These can be used to tell stacktool to skip validation of an instruction or a function, respectively. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/stacktool.

[PATCH v13 08/23] x86/paravirt: Add stack frame dependency to PVOP inline asm calls

2015-09-22 Thread Josh Poimboeuf
if CONFIG_FRAME_POINTER is enabled by listing the stack pointer as an output operand for the PVOP inline asm statements. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Jeremy Fitzhardinge <jer...@goop.org> Cc: Chris Wright <chr...@sous-sol.org> Cc: Alok Kataria <akata...@vmware.com&g

[PATCH v13 09/23] x86/paravirt: Create a stack frame in PV_CALLEE_SAVE_REGS_THUNK

2015-09-22 Thread Josh Poimboeuf
functions. Create a stack frame when CONFIG_FRAME_POINTER is enabled and add the ELF function type. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Jeremy Fitzhardinge <jer...@goop.org> Cc: Chris Wright <chr...@sous-sol.org> Cc: Alok Kataria <akata...@vmware.com&g

[PATCH v13 18/23] x86/asm/acpi: Create a stack frame in do_suspend_lowlevel()

2015-09-22 Thread Josh Poimboeuf
do_suspend_lowlevel() is a callable non-leaf function which doesn't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create a stack frame for it when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Acked-by: Pavel Machek <pa...@u

[PATCH v13 11/23] x86/reboot: Add ljmp instructions to stacktool whitelist

2015-09-22 Thread Josh Poimboeuf
stacktool reports a false positive warning for the ljmp instruction in machine_real_restart(). Normally, ljmp isn't allowed in a function, but this is a special case where it's jumping into real mode. Add the jumps to a whitelist which tells stacktool to ignore them. Signed-off-by: Josh

[PATCH v13 12/23] x86/xen: Add xen_cpuid() and xen_setup_gdt() to stacktool whitelists

2015-09-22 Thread Josh Poimboeuf
use of the instruction. Add both functions to the stacktool whitelist. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Reviewed-by: David Vrabel <david.vra...@citrix.com> Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Cc: Boris Ostrovsky <boris.ostrov...@oracle.c

[PATCH v13 22/23] x86/uaccess: Add stack frame output operand in get_user inline asm

2015-09-22 Thread Josh Poimboeuf
stack frame to be created before the inline asm code if CONFIG_FRAME_POINTER is enabled by listing the stack pointer as an output operand for the get_user inline assembly statement. Signed-off-by: Chris J Arges <chris.j.ar...@canonical.com> Signed-off-by: Josh Poimboeuf <jpoim...@redhat

[PATCH v13 19/23] x86/asm: Create stack frames in rwsem functions

2015-09-22 Thread Josh Poimboeuf
rwsem.S has several callable non-leaf functions which don't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create stack frames for them when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/lib/rwsem.S | 11 ++-

[PATCH v13 20/23] x86/asm/efi: Create a stack frame in efi_call()

2015-09-22 Thread Josh Poimboeuf
efi_call() is a callable non-leaf function which doesn't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create a stack frame for it when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Reviewed-by: Matt Fleming <matt.flem...@

[PATCH v13 23/23] x86/stacktool: Ignore head_$(BITS) files.

2015-09-22 Thread Josh Poimboeuf
From: Chris J Arges <chris.j.ar...@canonical.com> Tell stacktool to skip validation of head_64, head_32 as they don't affect runtime kernel stack traces. Signed-off-by: Chris J Arges <chris.j.ar...@canonical.com> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x

[PATCH v13 21/23] x86/asm/power: Create stack frames in hibernate_asm_64.S

2015-09-22 Thread Josh Poimboeuf
is enabled and give them proper ELF function annotations. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Acked-by: Pavel Machek <pa...@ucw.cz> Cc: Rafael J. Wysocki <r...@rjwysocki.net> --- arch/x86/power/hibernate_asm_64.S | 7 +++ 1 file changed, 7 insertions(+) diff --gi

[PATCH v13 10/23] x86/amd: Set ELF function type for vide()

2015-09-22 Thread Josh Poimboeuf
vide() is a callable function, but is missing the ELF function type, which confuses tools like stacktool. Properly annotate it to be a callable function. The generated code is unchanged. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/kernel/cpu/amd.c | 5 - 1 file c

[PATCH v13 01/23] tools: Fix formatting of the "make -C tools" help message

2015-09-22 Thread Josh Poimboeuf
Align the x86_energy_perf_policy line with the others and restore the original alphabetical sorting. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/Makefile | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/Make

[PATCH v13 17/23] x86/asm/entry: Create stack frames in thunk functions

2015-09-22 Thread Josh Poimboeuf
type. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/entry/thunk_64.S | 4 1 file changed, 4 insertions(+) diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S index efb2b93..98df1fa 100644 --- a/arch/x86/entry/thunk_64.S +++ b/arch/x86/entry/thun

[PATCH v13 15/23] x86/asm/crypto: Move jump_table to .rodata section

2015-09-22 Thread Josh Poimboeuf
. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Herbert Xu <herb...@gondor.apana.org.au> Cc: David S. Miller <da...@davemloft.net> --- arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/crypto/crc32c-

[PATCH v13 16/23] x86/asm/crypto: Create stack frames in clmul_ghash_mul/update()

2015-09-22 Thread Josh Poimboeuf
clmul_ghash_mul() and clmul_ghash_update() are callable non-leaf functions which don't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create stack frames for them when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> Cc: Herbert Xu

Re: [PATCH 2/3] x86/stacktool: Ignore head_$(BITS) files.

2015-09-18 Thread Josh Poimboeuf
On Thu, Sep 17, 2015 at 05:14:36PM -0500, Chris J Arges wrote: > Tell stacktool to skip validation of head_64, head_32 as they don't affect > runtime kernel stack traces. > > Signed-off-by: Chris J Arges <chris.j.ar...@canonical.com> Reviewed-by: Josh Poimboeuf &l

<    1   2   3   4   5   6   7   8   9   10   >