[PATCH v2 1/2] ktest: give console process a dedicated tty

2015-01-28 Thread Josh Poimboeuf
Create a pseudoterminal (pty pair) to give the console a dedicated tty so it doesn't mess with ktest's terminal settings. Signed-off-by: Josh Poimboeuf --- tools/testing/ktest/ktest.pl | 66 ++-- 1 file changed, 57 insertions(+), 9 deletion

Re: [PATCH] ktest: restore tty settings after closing console

2015-01-28 Thread Josh Poimboeuf
On Tue, Jan 27, 2015 at 05:01:29PM -0500, Steven Rostedt wrote: > On Tue, 27 Jan 2015 12:10:04 -0600 > Josh Poimboeuf wrote: > > > When ktest runs the console program as a child process, the parent and > > child share the same tty for stdin and stderr. This is problem

[PATCH v2 0/2] ktest: console pty support

2015-01-28 Thread Josh Poimboeuf
atch - added a patch to enable user input to the console Josh Poimboeuf (2): ktest: give console process a dedicated tty ktest: enable user input to the console tools/testing/ktest/ktest.pl | 117 ++- 1 file changed, 93 insertions(+), 24 deletions(

Re: [PATCH 2/2] livepatch: Fix the bug if the function name is larger than KSYM_NAME_LEN-1

2015-04-14 Thread Josh Poimboeuf
On Tue, Apr 14, 2015 at 01:45:49PM +0800, Minfei Huang wrote: > On 04/14/15 at 12:32P, Josh Poimboeuf wrote: > > On Tue, Apr 14, 2015 at 01:29:50PM +0800, Minfei Huang wrote: > > > > > > For end user, they may know litter about restriction of kallsyms and > > &

Re: [PATCH] livepatch: Enhance livepatch to support remove patch module dynamically

2015-04-01 Thread Josh Poimboeuf
On Wed, Apr 01, 2015 at 10:40:19PM +0800, Minfei Huang wrote: > 2015-04-01 22:13 GMT+08:00 Jiri Kosina : > > On Wed, 1 Apr 2015, Minfei Huang wrote: > > > >> > > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > >> > > index 3f9f1d6..0266950 100644 > >> > > --- a/kernel/livepatch/cor

Re: [PATCH v2] livepatch: x86: make kASLR logic more accurate

2015-04-24 Thread Josh Poimboeuf
On Fri, Apr 24, 2015 at 09:59:03PM +0200, Jiri Kosina wrote: > We give up old_addr hint from the coming patch module in cases when kernel > load > base has been randomized (as in such case, the coming module has no idea about > the exact randomization offset). > > We are currently too pessimistic

Re: [PATCH v2] livepatch: x86: make kASLR logic more accurate

2015-04-24 Thread Josh Poimboeuf
On Fri, Apr 24, 2015 at 09:59:03PM +0200, Jiri Kosina wrote: > We give up old_addr hint from the coming patch module in cases when kernel > load > base has been randomized (as in such case, the coming module has no idea about > the exact randomization offset). > > We are currently too pessimistic

[PATCH 2/2] x86, stackvalidate: Add asm frame pointer setup macros

2015-04-27 Thread Josh Poimboeuf
instruction outside of a callable function. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/func.h | 82 + 1 file changed, 82 insertions(+) create mode 100644 arch/x86/include/asm/func.h diff --git a/arch/x86/include/asm/func.h b/arch/x86/include

[PATCH 1/2] x86, stackvalidate: Compile-time stack frame pointer validation

2015-04-27 Thread Josh Poimboeuf
Right now I'm seeing 200+ warnings. Once we get them all cleaned up, we can change the warnings to build errors so the asm code can stay clean. Signed-off-by: Josh Poimboeuf --- MAINTAINERS | 6 + arch/Kconfig | 4 + arch/x86/Kconfig

[PATCH 0/2] Compile-time stack frame pointer validation

2015-04-27 Thread Josh Poimboeuf
warnings. Once we get them all cleaned up, we can change the warnings to build errors so the asm code can stay clean. The patches are based on linux-next. Patch 1 adds the stackvalidate host tool. Patch 2 adds some helper macros for asm functions so that they can comply with stackvalidate. [1] htt

Re: [PATCH 1/2] x86: introduce kaslr_offset()

2015-04-28 Thread Josh Poimboeuf
On Mon, Apr 27, 2015 at 04:28:07PM +0200, Jiri Kosina wrote: > Offset that has been chosen for kaslr during kernel decompression can be > easily computed as a difference between _text and __START_KERNEL. We are > already making use of this in dump_kernel_offset() notifier. > > Introduce kaslr_of

Re: [PATCH 2/2] livepatch: x86: make kASLR logic more accurate

2015-04-28 Thread Josh Poimboeuf
ctive. The relocation offset can be computed using > kaslr_ofsset(), and therefore old_addr can be adjusted accordingly. > > Signed-off-by: Jiri Kosina Acked-by: Josh Poimboeuf > --- > arch/x86/include/asm/livepatch.h | 1 + > kernel/livepatch/core.c | 5 +++-- > 2 fi

Re: [PATCH 1/2] x86, stackvalidate: Compile-time stack frame pointer validation

2015-04-28 Thread Josh Poimboeuf
On Tue, Apr 28, 2015 at 02:16:06PM +0200, Peter Zijlstra wrote: > On Mon, Apr 27, 2015 at 08:56:27AM -0500, Josh Poimboeuf wrote: > > Frame pointer based stack traces aren't always reliable. One big reason > > is that most asm functions don't set up the frame poin

Re: [PATCH 1/2] x86, stackvalidate: Compile-time stack frame pointer validation

2015-04-28 Thread Josh Poimboeuf
On Tue, Apr 28, 2015 at 04:08:42PM +0200, Peter Zijlstra wrote: > On Tue, Apr 28, 2015 at 09:04:54AM -0500, Josh Poimboeuf wrote: > > On Tue, Apr 28, 2015 at 02:16:06PM +0200, Peter Zijlstra wrote: > > > On Mon, Apr 27, 2015 at 08:56:27AM -0500, Josh Poimboeuf wrote: > >

Re: [PATCH 1/2] x86, stackvalidate: Compile-time stack frame pointer validation

2015-04-28 Thread Josh Poimboeuf
On Tue, Apr 28, 2015 at 06:44:15PM +0200, Petr Mladek wrote: > On Mon 2015-04-27 08:56:27, Josh Poimboeuf wrote: > > + case 0x89: > > + insn_get_modrm(&insn); > > + if (insn.modrm.bytes[0] == 0xe5) > > +

Re: [PATCH 1/2] livepatch: Add a new function to verify the address and name match for extra module

2015-04-13 Thread Josh Poimboeuf
On Mon, Apr 13, 2015 at 06:37:10PM +0800, Minfei Huang wrote: > For my patches, I think it is used by the persion which will compose the > patch individually, not for the manufactor. > > Yes, Verifying extra function address is more useless in general, due to > the changable address on different

Re: [PATCH 2/2] livepatch: Fix the bug if the function name is larger than KSYM_NAME_LEN-1

2015-04-13 Thread Josh Poimboeuf
On Sun, Apr 12, 2015 at 09:15:54PM +0800, Minfei Huang wrote: > For now, the kallsyms will only store the first (KSYM_NAME_LEN-1). The > kallsyms name is same for the function which first (KSYM_NAME_LEN-1) is > same, but the rest is not. > > Then function will never be patched, although function n

Re: [PATCH 1/2] livepatch: Add a new function to verify the address and name match for extra module

2015-04-13 Thread Josh Poimboeuf
On Tue, Apr 14, 2015 at 08:48:11AM +0800, Minfei Huang wrote: > On 04/14/15 at 08:17P, Minfei Huang wrote: > > On 04/13/15 at 05:58P, Josh Poimboeuf wrote: > > > On Mon, Apr 13, 2015 at 06:37:10PM +0800, Minfei Huang wrote: > > > > For my patches, I think it is

Re: [PATCH 2/2] livepatch: Fix the bug if the function name is larger than KSYM_NAME_LEN-1

2015-04-13 Thread Josh Poimboeuf
On Tue, Apr 14, 2015 at 08:26:29AM +0800, Minfei Huang wrote: > On 04/13/15 at 06:13P, Josh Poimboeuf wrote: > > On Sun, Apr 12, 2015 at 09:15:54PM +0800, Minfei Huang wrote: > > > For now, the kallsyms will only store the first (KSYM_NAME_LEN-1). The > > > kallsyms na

Re: [PATCH 2/2] livepatch: Fix the bug if the function name is larger than KSYM_NAME_LEN-1

2015-04-13 Thread Josh Poimboeuf
On Tue, Apr 14, 2015 at 01:03:48PM +0800, Minfei Huang wrote: > On 04/13/15 at 11:57P, Josh Poimboeuf wrote: > > On Tue, Apr 14, 2015 at 08:26:29AM +0800, Minfei Huang wrote: > > > On 04/13/15 at 06:13P, Josh Poimboeuf wrote: > > > > On Sun, Apr 12, 2015 at 09:15:

Re: [PATCH 2/2] livepatch: Fix the bug if the function name is larger than KSYM_NAME_LEN-1

2015-04-13 Thread Josh Poimboeuf
On Tue, Apr 14, 2015 at 01:29:50PM +0800, Minfei Huang wrote: > On 04/14/15 at 12:11P, Josh Poimboeuf wrote: > > On Tue, Apr 14, 2015 at 01:03:48PM +0800, Minfei Huang wrote: > > > On 04/13/15 at 11:57P, Josh Poimboeuf wrote: > > > > On Tue, Apr 14, 2015 at 08:26:

Re: [PATCH v5 02/10] x86: Compile-time asm code validation

2015-06-11 Thread Josh Poimboeuf
On Thu, Jun 11, 2015 at 08:08:07AM +0200, Ingo Molnar wrote: > > * Josh Poimboeuf wrote: > > > I should also mention that my proposed ia32_ptregs_common patch, which > > duplicated the needed code, was more optimized for performance than code > > size. > >

Re: [PATCH v5 02/10] x86: Compile-time asm code validation

2015-06-11 Thread Josh Poimboeuf
On Thu, Jun 11, 2015 at 08:10:50AM +0200, Ingo Molnar wrote: > * Josh Poimboeuf wrote: > > > I imagine that an automatic CFI annotation adder would walk through > > > functions > > > one instruction at a time and keep track of the frame state. If so, then >

Re: [PATCH v5 01/10] x86/asm: Add FP_SAVE/RESTORE frame pointer macros

2015-06-11 Thread Josh Poimboeuf
On Thu, Jun 11, 2015 at 08:46:33AM +0200, Pavel Machek wrote: > On Thu 2015-06-11 06:22:49, Jiri Kosina wrote: > > On Wed, 10 Jun 2015, Pavel Machek wrote: > > > > > > diff --git a/arch/x86/include/asm/func.h b/arch/x86/include/asm/func.h > > > > new file mode 100644 > > > > index 000..4d62782

Re: [PATCH v5 02/10] x86: Compile-time asm code validation

2015-06-12 Thread Josh Poimboeuf
On Fri, Jun 12, 2015 at 12:18:16PM +0100, Pedro Alves wrote: > On 06/11/2015 03:10 PM, Josh Poimboeuf wrote: > > > C would definitely make more sense when analyzing object code. In fact, > > asmvalidate is written in C. But then I guess we'd have to re-implement > >

Re: [PATCH v5 02/10] x86: Compile-time asm code validation

2015-06-12 Thread Josh Poimboeuf
On Fri, Jun 12, 2015 at 05:00:50PM +0100, Pedro Alves wrote: > On 06/12/2015 03:10 PM, Josh Poimboeuf wrote: > > That said, the kernel has much more custom features than other projects. > > There are some sneaky macros, like _ASM_EXTABLE and ALTERNATIVE, which > > hide cod

Re: [PATCH] x86/debug: Remove perpetually broken, unmaintainable dwarf annotations

2015-06-02 Thread Josh Poimboeuf
On Tue, Jun 02, 2015 at 07:57:06AM +0200, Ingo Molnar wrote: > * Andy Lutomirski wrote: > > On Mon, Jun 1, 2015 at 12:45 PM, Josh Poimboeuf wrote: > > > On Fri, May 29, 2015 at 10:47:31AM -0700, Andy Lutomirski wrote: > > >> FWIW, musl is considering some kind

Re: [PATCH] livepatch: add module locking around kallsyms calls

2015-06-02 Thread Josh Poimboeuf
thers don't make this mistake? Acked-by: Josh Poimboeuf -- Josh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] x86/debug: Remove perpetually broken, unmaintainable dwarf annotations

2015-05-29 Thread Josh Poimboeuf
On Fri, May 29, 2015 at 10:47:31AM -0700, Andy Lutomirski wrote: > On Thu, May 28, 2015 at 6:17 AM, Ingo Molnar wrote: > > * Jan Beulich wrote: > >> > and meanwhile you can keep a revert of this patch ported to SUSE kernels > >> > in > >> > whatever fashion you prefer. > >> > >> Funny suggestion

Re: [PATCH] x86/debug: Remove perpetually broken, unmaintainable dwarf annotations

2015-06-01 Thread Josh Poimboeuf
On Fri, May 29, 2015 at 10:47:31AM -0700, Andy Lutomirski wrote: > On Thu, May 28, 2015 at 6:17 AM, Ingo Molnar wrote: > > > > * Jan Beulich wrote: > > > >> > and meanwhile you can keep a revert of this patch ported to SUSE kernels > >> > in > >> > whatever fashion you prefer. > >> > >> Funny su

Re: [PATCH] x86/debug: Remove perpetually broken, unmaintainable dwarf annotations

2015-06-01 Thread Josh Poimboeuf
On Mon, Jun 01, 2015 at 12:53:36PM -0700, Andy Lutomirski wrote: > On Mon, Jun 1, 2015 at 12:45 PM, Josh Poimboeuf wrote: > > On Fri, May 29, 2015 at 10:47:31AM -0700, Andy Lutomirski wrote: > >> On Thu, May 28, 2015 at 6:17 AM, Ingo Molnar wrote: > >> &g

[PATCH v5 04/10] x86/asm/crypto: Fix asmvalidate warnings for aesni-intel_asm.S

2015-06-10 Thread Josh Poimboeuf
: aesni_xts_crypt8(): missing FP_SAVE/RESTORE macros These are all non-leaf callable functions, so save/restore the frame pointer with FP_SAVE/RESTORE. Signed-off-by: Josh Poimboeuf Cc: linux-cry...@vger.kernel.org Cc: Herbert Xu Cc: "David S. Miller" --- arch/x86/crypto/aesni-intel_

[PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
Anvin v2: - Fixed memory leaks reported by Petr Mladek Josh Poimboeuf (10): x86/asm: Add FP_SAVE/RESTORE frame pointer macros x86: Compile-time asm code validation x86/asm/entry: Fix asmvalidate warnings for entry_64_compat.S x86/asm/crypto: Fix asmvalidate warnings for aesni-intel_asm.

[PATCH v5 10/10] x86/asm/lib: Fix asmvalidate warnings for rwsem.S

2015-06-10 Thread Josh Poimboeuf
(): missing FP_SAVE/RESTORE macros asmvalidate: arch/x86/lib/rwsem.o: call_rwsem_downgrade_wake(): missing FP_SAVE/RESTORE macros These are callable non-leaf functions, so save/restore the frame pointer with FP_SAVE/RESTORE. Signed-off-by: Josh Poimboeuf --- arch/x86/lib/rwsem.S | 11

[PATCH v5 02/10] x86: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
m code can stay clean. Signed-off-by: Josh Poimboeuf --- MAINTAINERS | 6 + arch/Kconfig | 3 + arch/x86/Kconfig | 1 + arch/x86/Makefile | 6 +- arch/x86/include/asm/func.h | 32 lib/Kco

[PATCH v5 06/10] x86/asm/efi: Fix asmvalidate warnings for efi_stub_64.S

2015-06-10 Thread Josh Poimboeuf
the frame pointer with FP_SAVE/RESTORE. Signed-off-by: Josh Poimboeuf Cc: Matt Fleming Cc: linux-...@vger.kernel.org --- arch/x86/platform/efi/efi_stub_64.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S index

[PATCH v5 08/10] x86/asm/head: Fix asmvalidate warnings for head_64.S

2015-06-10 Thread Josh Poimboeuf
andler_common() aren't callable functions. Change ENDPROC -> END accordingly. Signed-off-by: Josh Poimboeuf --- arch/x86/kernel/head_64.S | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index e5c27f7..8ba22cf

[PATCH v5 09/10] x86/asm/lib: Fix asmvalidate warnings for lib functions

2015-06-10 Thread Josh Poimboeuf
/memset_64.o: alternative jump to outside the scope of original function memset Change the annotations for clear_page(), copy_page(), memcpy(), and memset() so that they don't jump outside of their function boundaries. Signed-off-by: Josh Poimboeuf --- arch/x86/lib/clear_page_64.S

[PATCH v5 05/10] x86/asm/crypto: Fix asmvalidate warnings for ghash-clmulni-intel_asm.S

2015-06-10 Thread Josh Poimboeuf
functions, so save/restore the frame pointer with FP_SAVE/RESTORE. Signed-off-by: Josh Poimboeuf Cc: linux-cry...@vger.kernel.org Cc: Herbert Xu Cc: "David S. Miller" --- arch/x86/crypto/ghash-clmulni-intel_asm.S | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/crypto/gha

[PATCH v5 03/10] x86/asm/entry: Fix asmvalidate warnings for entry_64_compat.S

2015-06-10 Thread Josh Poimboeuf
ir respective functions' boundaries to the ia32_ptregs_common label. Change them to be self-contained so they stay within their boundaries. Signed-off-by: Josh Poimboeuf --- arch/x86/entry/entry_64_compat.S | 35 +++ arch/x86/include/asm/func.h |

[PATCH v5 01/10] x86/asm: Add FP_SAVE/RESTORE frame pointer macros

2015-06-10 Thread Josh Poimboeuf
Add the FP_SAVE and FP_RESTORE asm macros, which can be used to save and restore the frame pointer. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/func.h | 24 1 file changed, 24 insertions(+) create mode 100644 arch/x86/include/asm/func.h diff --git a/arch

[PATCH v5 07/10] x86/asm/acpi: Fix asmvalidate warnings for wakeup_64.S

2015-06-10 Thread Josh Poimboeuf
mping outside the function's boundaries isn't allowed. Now restore_processor_state() will return back to do_suspend_lowlevel() instead of do_suspend_lowlevel()'s caller. 5. Remove superfluous rsp changes. Signed-off-by: Josh Poimboeuf Cc: "Rafael J. Wysocki" Cc: Len

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 07:06:08AM -0500, Josh Poimboeuf wrote: > There are still a lot of outstanding warnings (which I'll paste as a > reply to this email). Once those are all cleaned up, we can change the > warnings to build errors and change the default to > CONFIG_ASM_VALIDA

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 03:08:14PM +0200, Andi Kleen wrote: > > > 2. Each callable function must never leave its own bounds (i.e. with a > >jump to outside the function) except when returning. > > That prevents a lot of optimizations with out of line code. In most cases there are ways to kee

Re: [PATCH v5 07/10] x86/asm/acpi: Fix asmvalidate warnings for wakeup_64.S

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 03:19:14PM +0200, Pavel Machek wrote: > Hi! > > > Fix the following asmvalidate warnings: > > > >asmvalidate: arch/x86/kernel/acpi/wakeup_64.o: wakeup_long64()+0x15: > > unsupported jump to outside of function > >asmvalidate: arch/x86/kernel/acpi/wakeup_64.o: wake

Re: [PATCH v5 07/10] x86/asm/acpi: Fix asmvalidate warnings for wakeup_64.S

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 03:21:35PM +0200, Pavel Machek wrote: > On Wed 2015-06-10 07:06:15, Josh Poimboeuf wrote: > > Fix the following asmvalidate warnings: > > > >asmvalidate: arch/x86/kernel/acpi/wakeup_64.o: wakeup_long64()+0x15: > > unsupported

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 03:42:41PM +0200, Pavel Machek wrote: > On Wed 2015-06-10 07:06:08, Josh Poimboeuf wrote: > > The previous version of this patch set was named "Compile-time stack > > frame pointer validation". I changed the subject from "frame pointe

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 04:11:04PM +0200, Andi Kleen wrote: > > In most cases there are ways to keep the optimizations. For example: > > > > - grow the function bounds to keep the jump internal > > So you mean moving it after the ret? That still means icache bloat. No, in most cases it just mea

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 05:04:12PM +0200, Andi Kleen wrote: > > > > - duplicate the destination code inside the function > > > > - convert the jump to a call > > > > > > That all won't work for a lot of cases. > > > > Hm, could you give an example? > > Just a standard *_user exception handler.

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 10:31:55AM -0500, Josh Poimboeuf wrote: > On Wed, Jun 10, 2015 at 05:04:12PM +0200, Andi Kleen wrote: > > It's not needed, but it's an optimization to optimize icache usage. > > It is optional (-freorder-blocks-and-partition) > > > >

Re: [PATCH v5 02/10] x86: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 10:21:36AM -0700, Andy Lutomirski wrote: > On Jun 10, 2015 5:07 AM, "Josh Poimboeuf" wrote: > > > > Add a new CONFIG_ASM_VALIDATION option which adds an asmvalidate host > > tool which runs on every compiled .S file. Its goal is to enforce

Re: [PATCH v5 01/10] x86/asm: Add FP_SAVE/RESTORE frame pointer macros

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 08:17:32PM +0200, Pavel Machek wrote: > On Wed 2015-06-10 07:06:09, Josh Poimboeuf wrote: > > Add the FP_SAVE and FP_RESTORE asm macros, which can be used to save and > > restore the frame pointer. > > Add a changelog, which can be used to tell what

Re: [PATCH v5 02/10] x86: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 11:15:19AM -0700, Andy Lutomirski wrote: > On Wed, Jun 10, 2015 at 10:53 AM, Josh Poimboeuf wrote: > > On Wed, Jun 10, 2015 at 10:21:36AM -0700, Andy Lutomirski wrote: > >> On Jun 10, 2015 5:07 AM, "Josh Poimboeuf" wrote: > >> > 2.

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 11:40:06AM -0700, Andi Kleen wrote: > Josh Poimboeuf writes: > > > On Wed, Jun 10, 2015 at 05:04:12PM +0200, Andi Kleen wrote: > >> > > > - duplicate the destination code inside the function > >> > > > - convert the jump

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 11:41:43AM -0700, Andi Kleen wrote: > Josh Poimboeuf writes: > > > > If you're wanting something like -freorder-blocks-and-partition for asm > > code, maybe we could implement something analagous to the > > likely()/unlikely() macros, to al

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 12:38:32PM -0700, Andy Lutomirski wrote: > On Wed, Jun 10, 2015 at 12:36 PM, Josh Poimboeuf wrote: > > On Wed, Jun 10, 2015 at 11:40:06AM -0700, Andi Kleen wrote: > >> Josh Poimboeuf writes: > >> > >> > On Wed, Jun 10, 201

Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 11:24:05AM -0700, Andy Lutomirski wrote: > Slightly off-topic, but this reminds me: when writing inline asm that > needs to push to the stack (for whatever reason), it's incredibly > messy to get the annotations right -- they're different depending on > whether the previous

Re: [PATCH v5 02/10] x86: Compile-time asm code validation

2015-06-10 Thread Josh Poimboeuf
On Wed, Jun 10, 2015 at 01:58:45PM -0500, Josh Poimboeuf wrote: > On Wed, Jun 10, 2015 at 11:15:19AM -0700, Andy Lutomirski wrote: > > On Wed, Jun 10, 2015 at 10:53 AM, Josh Poimboeuf > > wrote: > > > On Wed, Jun 10, 2015 at 10:21:36AM -0700, Andy Lutomirski wrote: >

Re: [PATCH v3 1/6] x86/stacktrace: do not unwind after user regs

2018-05-22 Thread Josh Poimboeuf
On Sat, May 19, 2018 at 09:42:51AM +0200, Ingo Molnar wrote: > > * Josh Poimboeuf wrote: > > > On Fri, May 18, 2018 at 08:55:47AM +0200, Ingo Molnar wrote: > > > > > > * Jiri Slaby wrote: > > > > > > > Josh pointed out, that there is no

Re: [PATCH] livepatch: Remove not longer valid limitations from the documentation

2018-05-23 Thread Josh Poimboeuf
nsistency model"). > > > > Also data structures can be patched since the commit 439e7271dc2b63de37 > > ("livepatch: introduce shadow variable API"). > > > > It is a high time we removed these limitations from the documentation. > > >

[PATCH] objtool: Fix another switch table detection issue

2018-02-28 Thread Josh Poimboeuf
: x509_note_pkey_algo()+0xa4: sibling call from callable instruction with modified stack frame Reported-and-tested-by: Arnd Bergmann Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/objtool/check.c b/tools/objtool

Re: [GIT PULL] x86/build changes for v4.17

2018-04-04 Thread Josh Poimboeuf
On Wed, Apr 04, 2018 at 04:53:52PM +, Nick Desaulniers wrote: > (re-sending as plain text) > > On Wed, Apr 4, 2018 at 2:38 AM Greg KH wrote: > > There are known-bugs with building a kernel with clang right now (I > > pointed one out a few days ago about NULL checks being deleted from the > >

Re: [PATCH] debugfs: Check return value of debugfs_real_fops() for NULL

2018-03-28 Thread Josh Poimboeuf
On Wed, Mar 28, 2018 at 07:47:53AM -0700, Manoj Gupta wrote: > Please note that there is nothing wrong in the generated code, just > that it confuses objtool. > Clang has simply omitted the statement where NULL is returned since > the pointer was always dereferenced post inlining. ... but returnin

Re: [PATCH] debugfs: Check return value of debugfs_real_fops() for NULL

2018-03-28 Thread Josh Poimboeuf
On Wed, Mar 28, 2018 at 10:30:51AM -0500, Josh Poimboeuf wrote: > On Wed, Mar 28, 2018 at 07:47:53AM -0700, Manoj Gupta wrote: > > Please note that there is nothing wrong in the generated code, just > > that it confuses objtool. > > Clang has simply omitted the statement w

Re: Suboptimal inline heuristics due to non-code sections

2018-05-01 Thread Josh Poimboeuf
On Tue, May 01, 2018 at 06:50:14AM +, Nadav Amit wrote: > When gcc considers the size of a function for inlining decisions, it > apparently considers *all* sections. Since the kernel extensively uses > sections for things other than code (e.g., exception-table, bug-table), the > optimality of t

Re: perf: fuzzer causes stack going in wrong direction warnings

2018-05-01 Thread Josh Poimboeuf
On Tue, May 01, 2018 at 09:29:38AM -0400, Vince Weaver wrote: > Hello > > I reported this back in January, but I think it got lost since everyone > was busy with other more pressing matters. > > But in any case, the perf_fuzzer still can trigger these type of messages > and just wanted to see i

Re: ORC unwinder bad backtrace

2018-05-01 Thread Josh Poimboeuf
On Wed, Apr 18, 2018 at 10:45:48AM -0500, Josh Poimboeuf wrote: > On Wed, Apr 18, 2018 at 06:54:38AM -0700, Matthew Wilcox wrote: > > f81061192 : > > ... > > 810611bf: 90 nop > > 810611c0 : > > > > I suspect an off

Re: perf: fuzzer causes stack going in wrong direction warnings

2018-05-01 Thread Josh Poimboeuf
On Tue, May 01, 2018 at 03:59:31PM -0400, Vince Weaver wrote: > On Tue, 1 May 2018, Josh Poimboeuf wrote: > > > Can you try the following patch? > > I applied the patch, but the warnings don't really look that different. > > [ 62.220322] WARNING: st

Re: linux-next: Tree for May 2 (objtool bug!)

2018-05-02 Thread Josh Poimboeuf
On Wed, May 02, 2018 at 08:37:53AM -0700, Randy Dunlap wrote: > On 05/01/2018 11:59 PM, Stephen Rothwell wrote: > > Hi all, > > > > Changes since 20180501: > > > > on x86_64 randconfig: > > CC fs/cifs/smbencrypt.o > drivers/char/ipmi/ipmi_ssif.o: warning: objtool: return_hosed_msg()+0x0:

Re: perf: fuzzer causes stack going in wrong direction warnings

2018-05-02 Thread Josh Poimboeuf
On Tue, May 01, 2018 at 05:04:58PM -0500, Josh Poimboeuf wrote: > On Tue, May 01, 2018 at 03:59:31PM -0400, Vince Weaver wrote: > > On Tue, 1 May 2018, Josh Poimboeuf wrote: > > > > > Can you try the following patch? > > > > I applied the patch, but the warni

Re: linux-next: Tree for May 2 (objtool bug!)

2018-05-02 Thread Josh Poimboeuf
On Wed, May 02, 2018 at 08:59:38AM -0700, Randy Dunlap wrote: > On 05/02/2018 08:43 AM, Josh Poimboeuf wrote: > > On Wed, May 02, 2018 at 08:37:53AM -0700, Randy Dunlap wrote: > >> On 05/01/2018 11:59 PM, Stephen Rothwell wrote: > >>> Hi all, > >>> > &

Re: [PATCH] scripts/faddr2line: show the code context

2018-05-29 Thread Josh Poimboeuf
On Tue, May 29, 2018 at 06:26:36PM +0200, Peter Zijlstra wrote: > On Tue, May 29, 2018 at 06:03:32PM +0200, Peter Zijlstra wrote: > > On Mon, Mar 19, 2018 at 03:23:25PM +0800, changbin...@intel.com wrote: > > > From: Changbin Du > > > > > > Inspired by gdb command 'list', show the code context of

Re: [PATCH] module: exclude SHN_UNDEF symbols from kallsyms api

2018-06-04 Thread Josh Poimboeuf
On Mon, Jun 04, 2018 at 03:01:31PM +0200, Jessica Yu wrote: > +++ Jessica Yu [04/06/18 11:54 +0200]: > > +++ Jessica Yu [04/06/18 10:05 +0200]: > > > +++ Josh Poimboeuf [02/06/18 12:32 -0500]: > > > > Hi Jessica, > > > > > > > > I found a

Re: [PATCH] module: exclude SHN_UNDEF symbols from kallsyms api

2018-06-04 Thread Josh Poimboeuf
On Mon, Jun 04, 2018 at 04:05:11PM +0200, Jessica Yu wrote: > +++ Josh Poimboeuf [04/06/18 08:16 -0500]: > > On Mon, Jun 04, 2018 at 03:01:31PM +0200, Jessica Yu wrote: > > > +++ Jessica Yu [04/06/18 11:54 +0200]: > > > > +++ Jessica Yu [04/06/18 10:05 +0200]: >

Re: [PATCH 00/29] objtool sync up for the stable 4.9.y tree

2018-06-04 Thread Josh Poimboeuf
14.47, I'm pretty comfortable dropping this big change in here in > 4.9.y. Hopefully all goes well... > > If anyone has any objections to this patch series, or finds anything I > messed up on, please let me know. Thanks Greg. Looks good to me. Acked-by: Josh Poimboeuf -- Josh

Re: [PATCH 1/2] livepatch: Send a fake signal periodically

2018-06-04 Thread Josh Poimboeuf
On Mon, Jun 04, 2018 at 04:16:35PM +0200, Miroslav Benes wrote: > An administrator may send a fake signal to all remaining blocking tasks > of a running transition by writing to > /sys/kernel/livepatch//signal attribute. Let's do it > automatically after 10 seconds. The timeout is chosen deliberate

[PATCH 0/2] faddr2line fix and MAINTAINERS update

2018-06-04 Thread Josh Poimboeuf
r, so get_maintainer.pl will actually CC me on future patches. Josh Poimboeuf (1): MAINTAINERS: add Josh Poimboeuf as faddr2line maintainer Peter Zijlstra (Intel) (1): scripts/faddr2line: make the new code listing format optional MAINTAINERS| 5 + scripts/faddr2line

[PATCH 1/2] scripts/faddr2line: make the new code listing format optional

2018-06-04 Thread Josh Poimboeuf
t;) Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Josh Poimboeuf --- scripts/faddr2line | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/faddr2line b/scripts/faddr2line index 1876a741087c..a0149db00be7 100755 --- a/scripts/faddr2line +++ b/scri

[PATCH 2/2] MAINTAINERS: add Josh Poimboeuf as faddr2line maintainer

2018-06-04 Thread Josh Poimboeuf
... so I finally get credit for my greatest accomplishment. And, less importantly, so get_maintainer.pl will actually CC me on future patches. Signed-off-by: Josh Poimboeuf --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ca4afd68530c

Re: [PATCH v2 2/9] x86: objtool: use asm macro for better compiler decisions

2018-06-04 Thread Josh Poimboeuf
on > +.endm > +#else /* CONFIG_STACK_VALIDATION */ > +.macro ANNOTATE_UNREACHABLE counter:req > +.endm > + > +.macro ANNOTATE_UNREACHABLE counter:req > +.endm > + > +.macro ASM_UNREACHABLE > +.endm /* CONFIG_STACK_VALIDATION */ > +#endif The '/* CONFIG_STACK_VALIDATION */' comment is on the wrong line. Otherwise: Reviewed-by: Josh Poimboeuf -- Josh

Re: [PATCH] module: exclude SHN_UNDEF symbols from kallsyms api

2018-06-04 Thread Josh Poimboeuf
On Mon, Jun 04, 2018 at 09:54:12AM -0500, Josh Poimboeuf wrote: > On Mon, Jun 04, 2018 at 04:05:11PM +0200, Jessica Yu wrote: > > +++ Josh Poimboeuf [04/06/18 08:16 -0500]: > > > On Mon, Jun 04, 2018 at 03:01:31PM +0200, Jessica Yu wrote: > > > > +++ Je

Re: [PATCH] module: exclude SHN_UNDEF symbols from kallsyms api

2018-06-04 Thread Josh Poimboeuf
On Mon, Jun 04, 2018 at 05:56:05PM -0500, Josh Poimboeuf wrote: > On Mon, Jun 04, 2018 at 09:54:12AM -0500, Josh Poimboeuf wrote: > > On Mon, Jun 04, 2018 at 04:05:11PM +0200, Jessica Yu wrote: > > > +++ Josh Poimboeuf [04/06/18 08:16 -0500]: > > > > On Mon, Ju

Re: [PATCH] module: exclude SHN_UNDEF symbols from kallsyms api

2018-06-05 Thread Josh Poimboeuf
dules anyway as we cut down their > symbol tables to just the core (non-undefined) symbols, so this should > really just affect livepatch modules. Note that this patch doesn't > affect the display of undefined symbols in /proc/kallsyms. > > Reported-by: Josh Poimboeuf > Test

Re: [PATCH 1/2] livepatch: Send a fake signal periodically

2018-06-05 Thread Josh Poimboeuf
On Tue, Jun 05, 2018 at 09:17:52AM +0200, Miroslav Benes wrote: > On Mon, 4 Jun 2018, Josh Poimboeuf wrote: > > > On Mon, Jun 04, 2018 at 04:16:35PM +0200, Miroslav Benes wrote: > > > An administrator may send a fake signal to all remaining blocking tasks > > > of a

Re: include/linux/string.h:246:9: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length

2018-06-05 Thread Josh Poimboeuf
On Tue, Jun 05, 2018 at 06:19:07PM +0300, Andy Shevchenko wrote: > On Tue, May 29, 2018 at 4:35 AM, kbuild test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > master > > head: 786b71f5b754273ccef6d9462e52062b3e1f9877 > > commit: 854e55ad289ef

Re: [lkp-robot] [x86/asm] 51bad67ffb: int3:#[##]

2018-05-15 Thread Josh Poimboeuf
On Wed, May 16, 2018 at 12:43:37AM +0300, Alexey Dobriyan wrote: > On Tue, May 15, 2018 at 09:25:53PM +, Anvin, H Peter wrote: > > Why is that a problem? > > Code: 00 00 00 eb e6 cc cc cc cc cc cc cc cc cc cc cc cc cc fa 8d b6 00 00 > > 00 00 e8 5d e8 8f ff 8b 44 24 34 83 e0 03 83 f8 03 72 28

Re: [lkp-robot] [x86/asm] 51bad67ffb: int3:#[##]

2018-05-15 Thread Josh Poimboeuf
On Tue, May 15, 2018 at 03:28:19PM -0700, Linus Torvalds wrote: > On Tue, May 15, 2018 at 3:22 PM Josh Poimboeuf wrote: > > > The padding isn't needed there, and the resume_userspace symbol is never > > used, so wouldn't this fix it? > > This looks like the cor

Re: [lkp-robot] [x86/asm] 51bad67ffb: int3:#[##]

2018-05-15 Thread Josh Poimboeuf
On Tue, May 15, 2018 at 04:05:33PM -0700, Linus Torvalds wrote: > I wonder if there's some way to add a test for "ENTRY only works in a code > section"? I suppose we could add a discardable annotation to the ENTRY macro and have objtool validate that it's in a text section. I'm not sure whether i

Re: [RFC 0/8] Improving compiler inlining decisions

2018-05-15 Thread Josh Poimboeuf
On Tue, May 15, 2018 at 07:11:07AM -0700, Nadav Amit wrote: > This patch-set deals with an interesting yet stupid problem: code that > does not get inlined despite its simplicity. I got the 0/8 patch twice, and didn't get the 1/8 patch. Was there an issue with the sending of the patches? -- Jos

Re: [PATCH v2 6/8] modpost: Add modinfo flag to livepatch modules

2019-02-27 Thread Josh Poimboeuf
On Wed, Feb 20, 2019 at 04:50:08PM +0100, Miroslav Benes wrote: > Adding CCs... Where was this posted? I don't see it on lkml. It would be good to be able to see the whole series for review. > > On Wed, 30 Jan 2019, Joao Moreira wrote: > > > From: Miroslav Benes > > > > Currently, livepatch

Re: BUG: unable to handle kernel NULL pointer dereference in __generic_file_write_iter

2019-02-28 Thread Josh Poimboeuf
On Thu, Feb 21, 2019 at 11:36:24AM -0800, Andrew Morton wrote: > On Thu, 21 Feb 2019 06:52:04 -0800 syzbot > wrote: > > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit:4aa9fc2a435a Revert "mm, memory_hotplug: initialize struct.. > > git tree: upstream > > co

Re: [PATCH 1/2] x86/unwind: handle NULL pointer calls better in frame unwinder

2019-02-28 Thread Josh Poimboeuf
On Fri, Mar 01, 2019 at 04:12:00AM +0100, Jann Horn wrote: > When the frame unwinder is invoked for an oops caused by a call to NULL, > it currently skips the parent function because BP still points to the > parent's stack frame; the (nonexistent) current function only has the first > half of a sta

Re: [PATCH 1/2] x86/unwind: handle NULL pointer calls better in frame unwinder

2019-03-01 Thread Josh Poimboeuf
0x6f0 > ? __ia32_sys_prctl+0x750/0x750 > do_syscall_64+0x72/0x160 > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > After this patch, the trace is: > > Call Trace: > prctl_set_seccomp+0x3a/0x50 > __x64_sys_prctl+0x457/0x6f0 > ? __ia32_sys_prctl+0x750/0x750 > do_syscall_64+0

Re: [PATCH 2/2] x86/unwind: add hardcoded ORC entry for NULL

2019-03-01 Thread Josh Poimboeuf
t; reason, tail call optimization is only disabled in builds that use the > frame pointer unwinder. > > Signed-off-by: Jann Horn Thanks for the patches! Acked-by: Josh Poimboeuf > Is there a reason why the top-level Makefile only sets > -fno-optimize-sibling-calls if CONFIG

Re: [PATCH 2/2] x86/unwind: add hardcoded ORC entry for NULL

2019-03-01 Thread Josh Poimboeuf
On Fri, Mar 01, 2019 at 10:24:18AM -0600, Josh Poimboeuf wrote: > > Is there a reason why the top-level Makefile only sets > > -fno-optimize-sibling-calls if CONFIG_FRAME_POINTER is set? > > I suspect that this is just a historical thing, because reliable > > unwinding d

[PATCH] cpu/hotplug: Create SMT sysfs interface for all arches

2019-03-01 Thread Josh Poimboeuf
Make the /sys/devices/system/cpu/smt/* files available on all arches, so user space has a consistent way to detect whether SMT is enabled. The 'control' file now shows 'notsupported' for architectures which don't yet have CONFIG_HOTPLUG_SMT. Signed-off-by: Josh Poimbo

Re: [PATCH] livepatch: Enforce reliable stack trace as config dependency

2019-04-16 Thread Josh Poimboeuf
On Tue, Apr 16, 2019 at 01:47:30PM +0200, Jiri Kosina wrote: > On Tue, 12 Feb 2019, Petr Mladek wrote: > > > > I think I'd rather go in the opposite direction: allow the patches to be > > > loaded. Then they can be forced, if needed. That enables both compile > > > and runtime testing. That way

Re: [PATCH v2 1/5] cpu/speculation: Add 'mitigations=' cmdline option

2019-04-16 Thread Josh Poimboeuf
On Tue, Apr 16, 2019 at 04:13:35PM +0200, Borislav Petkov wrote: > On Fri, Apr 12, 2019 at 03:39:28PM -0500, Josh Poimboeuf wrote: > > diff --git a/kernel/cpu.c b/kernel/cpu.c > > index 38890f62f9a8..aed9083f8eac 100644 > > --- a/kernel/cpu.c > > +++ b/kernel/cpu.c >

Re: [RFC PATCH v2] perf/x86: make perf callchain work without CONFIG_FRAME_POINTER

2019-04-16 Thread Josh Poimboeuf
On Wed, Apr 17, 2019 at 01:39:19AM +0800, Kairui Song wrote: > On Tue, Apr 16, 2019 at 7:30 PM Kairui Song wrote: > > > > On Tue, Apr 16, 2019 at 12:59 AM Josh Poimboeuf wrote: > > > > > > On Mon, Apr 15, 2019 at 05:36:22PM +0200, Peter Zijlstra wrote: > >

Re: [RFC PATCH v2] perf/x86: make perf callchain work without CONFIG_FRAME_POINTER

2019-04-17 Thread Josh Poimboeuf
On Wed, Apr 17, 2019 at 09:07:35AM +0200, Peter Zijlstra wrote: > On Tue, Apr 16, 2019 at 03:15:59PM -0500, Josh Poimboeuf wrote: > > If you do the regs->eflags thing to mark the regs as fake in > > (perf_arch_fetch_caller_regs()), then I don't think skip_sp would be >

<    4   5   6   7   8   9   10   11   12   13   >