From: Oleg Nesterov <oleg@redhat.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/4] x86: Fix the hw_breakpoint range check
Date: Mon, 25 Nov 2013 20:50:28 +0100 [thread overview]
Message-ID: <20131125195028.GA10127@redhat.com> (raw)
In-Reply-To: <20131124134057.GA4531@pd.tnic>
Frederic. Thanks for doing this ;)
On 11/24, Borislav Petkov wrote:
>
> On Sun, Nov 24, 2013 at 11:32:49AM +0100, Frederic Weisbecker wrote:
> >
> > - return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE);
> > + return (va >= TASK_SIZE) || ((va + len - 1) >= TASK_SIZE);
>
> Well, can't you simplify it even further?
>
> return (va + len - 1) >= TASK_SIZE;
This won't work if va + len overflows?
Perhaps we should makes this clear, and we can even check the overflow
in the generic code (iirc Linus suggested to do this).
But to me it would be better to add the generic helper, they all do
the same check. Even arch/powerpc/kernel/hw_breakpoint.c whch doesn't
look right. Or make it __weak, or turn it into
arch_check_bp_in_kernelspace(start, end).
Oleg.
next prev parent reply other threads:[~2013-11-25 19:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-24 10:32 [PATCH 0/4] hw_breakpoints: Fix a bunch of adress range fixes Frederic Weisbecker
2013-11-24 10:32 ` [PATCH 1/4] arm: Fix the hw_breakpoint range check Frederic Weisbecker
2013-11-24 10:32 ` [PATCH 2/4] x86: " Frederic Weisbecker
2013-11-24 13:40 ` Borislav Petkov
2013-11-25 19:50 ` Oleg Nesterov [this message]
2013-11-25 20:11 ` Borislav Petkov
2013-11-26 18:09 ` Oleg Nesterov
2013-11-24 10:32 ` [PATCH 3/4] arm64: " Frederic Weisbecker
2013-11-24 10:32 ` [PATCH 4/4] sh: Fix hw_breakpoint the " Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131125195028.GA10127@redhat.com \
--to=oleg@redhat.com \
--cc=bp@alien8.de \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).