Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-23 Thread Kees Cook
On Tue, Aug 23, 2016 at 5:08 PM, Josh Poimboeuf wrote: > On Tue, Aug 23, 2016 at 01:31:20PM -0700, Andy Lutomirski wrote: >> On Aug 23, 2016 12:11 AM, "Linus Torvalds" >> So the fact that this seems to have any significant effect on >> performance suggests to me that it's being run unnecessarily >

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-23 Thread Linus Torvalds
On Mon, Aug 22, 2016 at 9:27 PM, Kees Cook wrote: > > I need to re-check the copy_*_user changes, but on several > architectures, the bounds checking is only triggered for non > built-in-const sizes, so these kinds of pointless checks shouldn't > happen. They definitely happen at least on x86. "

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-23 Thread Josh Poimboeuf
On Tue, Aug 23, 2016 at 01:31:20PM -0700, Andy Lutomirski wrote: > On Aug 23, 2016 12:11 AM, "Linus Torvalds" > So the fact that this seems to have any significant effect on > performance suggests to me that it's being run unnecessarily Yeah, I think check_object_size() is being run unnecessarily

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-23 Thread Linus Torvalds
On Tue, Aug 23, 2016 at 4:31 PM, Andy Lutomirski wrote: > > I'm a bit confused by what you're objecting to. If I write: > > char buf[123]; > > func(buf, size); > > And func eventually does some usercopy to buf, the idea is to check > that size is in bounds. That's the *IDEA*. That's not what th

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-23 Thread Andy Lutomirski
On Aug 23, 2016 12:11 AM, "Linus Torvalds" wrote: > > On Thu, Aug 18, 2016 at 6:06 AM, Josh Poimboeuf wrote: > > Convert arch_within_stack_frames() to use the new unwinder. > > Please don't do this. > > There's no real reason to unwind the stack frame. If it's not on the > current stack page, it

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-23 Thread Josh Poimboeuf
On Mon, Aug 22, 2016 at 06:27:28PM -0700, Kees Cook wrote: > On Mon, Aug 22, 2016 at 3:11 PM, Linus Torvalds > wrote: > > On Thu, Aug 18, 2016 at 6:06 AM, Josh Poimboeuf wrote: > >> Convert arch_within_stack_frames() to use the new unwinder. > > > > Please don't do this. > > > > There's no real r

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-23 Thread Josh Poimboeuf
On Mon, Aug 22, 2016 at 03:11:32PM -0700, Linus Torvalds wrote: > On Thu, Aug 18, 2016 at 6:06 AM, Josh Poimboeuf wrote: > > Convert arch_within_stack_frames() to use the new unwinder. > > Please don't do this. > > There's no real reason to unwind the stack frame. If it's not on the > current st

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-22 Thread Josh Poimboeuf
On Mon, Aug 22, 2016 at 05:59:18PM -0700, Kees Cook wrote: > On Mon, Aug 22, 2016 at 4:33 PM, Josh Poimboeuf wrote: > > On Mon, Aug 22, 2016 at 03:27:19PM -0500, Josh Poimboeuf wrote: > >> On Fri, Aug 19, 2016 at 04:55:22PM -0500, Josh Poimboeuf wrote: > >> > On Fri, Aug 19, 2016 at 11:27:18AM -07

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-22 Thread Kees Cook
On Mon, Aug 22, 2016 at 3:11 PM, Linus Torvalds wrote: > On Thu, Aug 18, 2016 at 6:06 AM, Josh Poimboeuf wrote: >> Convert arch_within_stack_frames() to use the new unwinder. > > Please don't do this. > > There's no real reason to unwind the stack frame. If it's not on the > current stack page, i

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-22 Thread Kees Cook
On Mon, Aug 22, 2016 at 4:33 PM, Josh Poimboeuf wrote: > On Mon, Aug 22, 2016 at 03:27:19PM -0500, Josh Poimboeuf wrote: >> On Fri, Aug 19, 2016 at 04:55:22PM -0500, Josh Poimboeuf wrote: >> > On Fri, Aug 19, 2016 at 11:27:18AM -0700, Kees Cook wrote: >> > > On Thu, Aug 18, 2016 at 6:06 AM, Josh P

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-22 Thread Josh Poimboeuf
On Mon, Aug 22, 2016 at 03:27:19PM -0500, Josh Poimboeuf wrote: > On Fri, Aug 19, 2016 at 04:55:22PM -0500, Josh Poimboeuf wrote: > > On Fri, Aug 19, 2016 at 11:27:18AM -0700, Kees Cook wrote: > > > On Thu, Aug 18, 2016 at 6:06 AM, Josh Poimboeuf > > > wrote: > > > > Convert arch_within_stack_fra

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-22 Thread Linus Torvalds
On Thu, Aug 18, 2016 at 6:06 AM, Josh Poimboeuf wrote: > Convert arch_within_stack_frames() to use the new unwinder. Please don't do this. There's no real reason to unwind the stack frame. If it's not on the current stack page, it shouldn't be a valid source anyway, so unwidning things just seem

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-22 Thread Josh Poimboeuf
On Fri, Aug 19, 2016 at 04:55:22PM -0500, Josh Poimboeuf wrote: > On Fri, Aug 19, 2016 at 11:27:18AM -0700, Kees Cook wrote: > > On Thu, Aug 18, 2016 at 6:06 AM, Josh Poimboeuf wrote: > > > Convert arch_within_stack_frames() to use the new unwinder. > > > > > > This also changes some existing beha

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-19 Thread Josh Poimboeuf
On Fri, Aug 19, 2016 at 11:27:18AM -0700, Kees Cook wrote: > On Thu, Aug 18, 2016 at 6:06 AM, Josh Poimboeuf wrote: > > Convert arch_within_stack_frames() to use the new unwinder. > > > > This also changes some existing behavior: > > > > - Skip checking of pt_regs frames. > > - Warn if it can't re

Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-19 Thread Kees Cook
On Thu, Aug 18, 2016 at 6:06 AM, Josh Poimboeuf wrote: > Convert arch_within_stack_frames() to use the new unwinder. > > This also changes some existing behavior: > > - Skip checking of pt_regs frames. > - Warn if it can't reach the grandparent's stack frame. > - Warn if it doesn't unwind to the e

[PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder

2016-08-18 Thread Josh Poimboeuf
Convert arch_within_stack_frames() to use the new unwinder. This also changes some existing behavior: - Skip checking of pt_regs frames. - Warn if it can't reach the grandparent's stack frame. - Warn if it doesn't unwind to the end of the stack. Signed-off-by: Josh Poimboeuf --- arch/x86/lib/u