From: Andy Lutomirski <luto@kernel.org>
To: Ruslan Kabatsayev <b7.10110111@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: Is it really correct to check for breakpoint in kernel space against ptracer's address space?
Date: Mon, 9 May 2016 20:33:19 -0700 [thread overview]
Message-ID: <25b7bea4-e319-99b8-ac4b-019f5b2a1904@kernel.org> (raw)
In-Reply-To: <CAHEcG95-rGs3wWzd5BJ8NanUoiBQbEPRotJZoJH1ONZwvsRN8w@mail.gmail.com>
On 05/09/2016 01:43 AM, Ruslan Kabatsayev wrote:
> Hello all.
>
> Currently a 32-bit ptracer can't set HW breakpoints in tracee over
> address space limitations of _tracer_. Even if the tracee is 64-bit,
> doing PTRACE_POKEUSER into u_debugreg[n] with value>=0xffffe000 leads
> to EINVAL (below is a test tracer program to reproduce this). At the
> same time, if tracer is 64-bit, then for both 32- and 64-bit tracees
> the PTRACE_POKEUSER call will succeed even if violates address space
> constraints for tracee.
>
> I've traced this to arch_check_bp_in_kernel_space() in
> arch/x86/kernel/hw_breakpoint.c, which checks the address against
> TASK_SIZE, which as I understood refers to the current task, i.e.
> caller of the syscall, instead of the tracee (at least tracing this in
> Bochs leads me to this conclusion).
Is there any reason at all for TASK_SIZE to be different from TASK_SIZE_MAX?
/me needs to audit this stuff.
--Andy
next prev parent reply other threads:[~2016-05-10 3:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-09 8:43 Ruslan Kabatsayev
2016-05-10 3:33 ` Andy Lutomirski [this message]
2016-05-10 11:50 ` Ruslan Kabatsayev
2016-05-10 15:23 ` Andy Lutomirski
2016-05-10 15:40 ` Ruslan Kabatsayev
2016-05-10 16:10 ` Andy Lutomirski
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=25b7bea4-e319-99b8-ac4b-019f5b2a1904@kernel.org \
--to=luto@kernel.org \
--cc=b7.10110111@gmail.com \
--cc=linux-kernel@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
Powered by JetHome