From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753108AbcEJQKm (ORCPT ); Tue, 10 May 2016 12:10:42 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:35540 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753056AbcEJQKk (ORCPT ); Tue, 10 May 2016 12:10:40 -0400 MIME-Version: 1.0 In-Reply-To: References: <25b7bea4-e319-99b8-ac4b-019f5b2a1904@kernel.org> From: Andy Lutomirski Date: Tue, 10 May 2016 09:10:19 -0700 Message-ID: Subject: Re: Is it really correct to check for breakpoint in kernel space against ptracer's address space? To: Ruslan Kabatsayev Cc: Andy Lutomirski , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 10, 2016 at 8:40 AM, Ruslan Kabatsayev wrote: > On Tue, May 10, 2016 at 6:23 PM, Andy Lutomirski wrote: >> Anyway, what kernel are you on? I think I fixed your specific issue in: >> >> commit 27747f8bc355a2808ca9e490ab6866acd85b4c16 >> Author: Andy Lutomirski >> Date: Thu Jul 30 20:32:42 2015 -0700 >> >> perf/x86/hw_breakpoints: Fix check for kernel-space breakpoints >> >> If that does fix it and it's a problem for you on older kernels, you >> could ask for a backport. > > Indeed, I was using a 3.12 kernel. This should indeed fix it, thanks. > > BTW, in that commit, why isn't va>=TASK_SIZE_MAX redundant with the > second operand of ||? If va is aligned to a multiple of len (so > va+len-1 doesn't overflow), then in what cases would the first > condition be true with the second being false? An excellent question :) I think that, when I wrote that, I wasn't 100% convinced that len couldn't be zero. --Andy -- Andy Lutomirski AMA Capital Management, LLC