public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Cyril Hrubis <chrubis@suse.cz>, Peter Zijlstra <peterz@infradead.org>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Alexandre Chartre <alexandre.chartre@oracle.com>,
	kernel test robot <rong.a.chen@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	lkp@lists.01.org, Andy Lutomirski <luto@kernel.org>,
	ltp@lists.linux.it
Subject: Re: [LTP] [x86/entry] 2bbc68f837: ltp.ptrace08.fail
Date: Thu, 18 Jun 2020 22:02:30 +0200	[thread overview]
Message-ID: <87r1ucb0rt.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20200617131742.GD8389@yuki.lan>

Cyril Hrubis <chrubis@suse.cz> writes:
> What is does is to write:
>
> 	(void*)1 to u_debugreg[0]
> 	(void*)1 to u_debugreg[7]
> 	do_debug addr to u_debugreg[0]
>
> Looking at the kernel code the write to register 7 enables the breakpoints and
> what we attempt here is to change an invalid address to a valid one after we
> enabled the breakpoint but that's as far I can go.
>
> So does anyone has an idea how to trigger the bug without the do_debug function
> address? Would any valid kernel function address suffice?

According to https://www.openwall.com/lists/oss-security/2018/05/01/3
the trigger is to set the breakpoint to do_debug() and then execute
INT1, aka. ICEBP which ends up in do_debug() ....

In principle each kernel address is ok, but do_debug() is interesting
due to the recursion issue because user space can reach it by executing
INT1.

So you might check for exc_debug() if do_debug() is not available and
make the whole thing fail gracefully with a usefu error message.

Thanks,

        tglx

  parent reply	other threads:[~2020-06-18 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200616075533.GL5653@shao2-debian>
2020-06-16  8:44 ` [x86/entry] 2bbc68f837: ltp.ptrace08.fail Thomas Gleixner
2020-06-16 12:24   ` [LKP] " Rong Chen
     [not found]   ` <8E41B15F-D567-4C52-94E9-367015480345@amacapital.net>
2020-06-16 13:27     ` Peter Zijlstra
2020-06-17 13:17       ` [LTP] " Cyril Hrubis
2020-06-18 18:20         ` Andy Lutomirski
2020-08-12  9:31           ` Cyril Hrubis
2020-08-14 14:58             ` Cyril Hrubis
2020-08-14 16:42               ` Andy Lutomirski
2020-06-18 20:02         ` Thomas Gleixner [this message]
2020-06-22 10:16           ` [LKP] " Naresh Kamboju
2020-06-16 14:57     ` Thomas Gleixner

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=87r1ucb0rt.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=alexandre.chartre@oracle.com \
    --cc=chrubis@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@lists.01.org \
    --cc=ltp@lists.linux.it \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rong.a.chen@intel.com \
    /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