<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/kernel/ptrace.c, branch linux-3.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-10-06T06:22:00Z</updated>
<entry>
<title>powerpc/ptrace: Fix out of bounds array access warning</title>
<updated>2016-10-06T06:22:00Z</updated>
<author>
<name>Khem Raj</name>
</author>
<published>2016-04-25T16:19:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1917f9179621548e9498b5751d6ad9fa381a60d2'/>
<id>urn:sha1:1917f9179621548e9498b5751d6ad9fa381a60d2</id>
<content type='text'>
commit 1e407ee3b21f981140491d5b8a36422979ca246f upstream.

gcc-6 correctly warns about a out of bounds access

arch/powerpc/kernel/ptrace.c:407:24: warning: index 32 denotes an offset greater than size of 'u64[32][1] {aka long long unsigned int[32][1]}' [-Warray-bounds]
        offsetof(struct thread_fp_state, fpr[32][0]));
                        ^

check the end of array instead of beginning of next element to fix this

Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Segher Boessenkool &lt;segher@kernel.crashing.org&gt;
Tested-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Acked-by: Olof Johansson &lt;olof@lixom.net&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>ptrace/powerpc: revert "hw_breakpoints: Fix racy access to ptrace breakpoints"</title>
<updated>2013-07-09T17:33:25Z</updated>
<author>
<name>Oleg Nesterov</name>
</author>
<published>2013-07-08T23:00:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6961ed96f14463d7c6e38d8c2093f5d53bd70574'/>
<id>urn:sha1:6961ed96f14463d7c6e38d8c2093f5d53bd70574</id>
<content type='text'>
This reverts commit 07fa7a0a8a58 ("hw_breakpoints: Fix racy access to
ptrace breakpoints") and removes ptrace_get/put_breakpoints() added by
other commits.

The patch was fine but we can no longer race with SIGKILL after commit
9899d11f6544 ("ptrace: ensure arch_ptrace/ptrace_request can never race
with SIGKILL"), the __TASK_TRACED tracee can't be woken up and
-&gt;ptrace_bps[] can't go away.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Michael Neuling &lt;mikey@neuling.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Jan Kratochvil &lt;jan.kratochvil@redhat.com&gt;
Cc: Paul Mundt &lt;lethal@linux-sh.org&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Prasad &lt;prasad@linux.vnet.ibm.com&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>powerpc/hw_brk: Fix setting of length for exact mode breakpoints</title>
<updated>2013-06-25T07:24:39Z</updated>
<author>
<name>Michael Neuling</name>
</author>
<published>2013-06-24T05:47:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0b0aa9c7faf94e92320eabd8a1786c7747e40a8'/>
<id>urn:sha1:b0b0aa9c7faf94e92320eabd8a1786c7747e40a8</id>
<content type='text'>
The smallest match region for both the DABR and DAWR is 8 bytes, so the
kernel needs to filter matches when users want to look at regions smaller than
this.

Currently we set the length of PPC_BREAKPOINT_MODE_EXACT breakpoints to 8.
This is wrong as in exact mode we should only match on 1 address, hence the
length should be 1.

This ensures that the kernel will filter out any exact mode hardware breakpoint
matches on any addresses other than the requested one.

Signed-off-by: Michael Neuling &lt;mikey@neuling.org&gt;
Reported-by: Edjunior Barbosa Machado &lt;emachado@linux.vnet.ibm.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc: Syscall hooks for context tracking subsystem</title>
<updated>2013-05-14T06:00:19Z</updated>
<author>
<name>Li Zhong</name>
</author>
<published>2013-05-13T16:16:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22ecbe8dcef4f6bf80ed4358600e8f6e03105c5c'/>
<id>urn:sha1:22ecbe8dcef4f6bf80ed4358600e8f6e03105c5c</id>
<content type='text'>
This is the syscall slow path hooks for context tracking subsystem,
corresponding to
[PATCH] x86: Syscall hooks for userspace RCU extended QS
  commit bf5a3c13b939813d28ce26c01425054c740d6731

TIF_MEMDIE is moved to the second 16-bits (with value 17), as it seems there
is no asm code using it. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is
better for it to be in the same 16 bits with others in the group, so in the
asm code, andi. with this group could work.

Signed-off-by: Li Zhong &lt;zhong@linux.vnet.ibm.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/ptrace: Add DAWR debug feature info for userspace</title>
<updated>2013-04-18T05:59:55Z</updated>
<author>
<name>Michael Neuling</name>
</author>
<published>2013-03-21T20:12:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=517b7314770c9247ed77bc0591dbeb362603a371'/>
<id>urn:sha1:517b7314770c9247ed77bc0591dbeb362603a371</id>
<content type='text'>
This adds new debug feature information so that the DAWR can be
identified by userspace tools like GDB.

Unfortunately the DAWR doesn't sit nicely into the current description
that ptrace provides to userspace via struct ppc_debug_info.  It doesn't
allow for specifying that only some ranges are possible or even the end
alignment constraints (DAWR only allows 512 byte wide ranges which can't
cross a 512 byte boundary).

After talking to Edjunior Machado (GDB ppc developer), it was decided
this was the best approach.  Just mark it as debug feature DAWR and
tools like GDB can internally decide the constraints.

Signed-off-by: Michael Neuling &lt;mikey@neuling.org&gt;
Signed-off-by: Michael Ellerman &lt;michael@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc: fixing ptrace_get_reg to return an error</title>
<updated>2013-04-18T03:03:57Z</updated>
<author>
<name>Alexey Kardashevskiy</name>
</author>
<published>2013-02-14T17:44:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee4a3916614829914830bc4371358f4d4a63c4d9'/>
<id>urn:sha1:ee4a3916614829914830bc4371358f4d4a63c4d9</id>
<content type='text'>
Currently ptrace_get_reg returns error as a value
what make impossible to tell whether it is a correct value or error code.

The patch adds a parameter which points to the real return data and
returns an error code.

As get_user_msr() never fails and it is used in multiple places so it has not
been changed by this patch.

Signed-off-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Acked-by: Michael Neuling &lt;mikey@neuling.org&gt;
Signed-off-by: Michael Ellerman &lt;michael@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/ptrace: Fix brk.len used uninitialised</title>
<updated>2013-03-17T01:35:06Z</updated>
<author>
<name>Michael Neuling</name>
</author>
<published>2013-03-11T16:42:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2bb78efab42cf4ee7a7184f7d2da1b7cb331b479'/>
<id>urn:sha1:2bb78efab42cf4ee7a7184f7d2da1b7cb331b479</id>
<content type='text'>
With some CONFIGS it's possible that in ppc_set_hwdebug, brk.len is
uninitialised before being used.  It has been reported that GCC 4.2 will
produce the following error in this case:

  arch/powerpc/kernel/ptrace.c:1479: warning: 'brk.len' is used uninitialized in this function
  arch/powerpc/kernel/ptrace.c:1381: note: 'brk.len' was declared here

This patch corrects this.

Signed-off-by: Michael Neuling &lt;mikey@neuling.org&gt;
Reported-by: Philippe De Muyter &lt;phdm@macqel.be&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc: Add DSCR support to ptrace</title>
<updated>2013-01-15T18:25:46Z</updated>
<author>
<name>Alexey Kardashevskiy</name>
</author>
<published>2013-01-10T20:29:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1715a826a5b72d4fb882504d0babcea9aec8a0db'/>
<id>urn:sha1:1715a826a5b72d4fb882504d0babcea9aec8a0db</id>
<content type='text'>
The DSCR (aka Data Stream Control Register) is supported on some
server PowerPC chips and allow some control over the prefetch
of data streams.

The kernel already supports DSCR value per thread but there is also
a need in a ability to change it from an external process for
the specific pid.

The patch adds new register index PT_DSCR (index=44) which can be
set/get by:
  ptrace(PTRACE_POKEUSER, traced_process, PT_DSCR &lt;&lt; 3, dscr);
  dscr = ptrace(PTRACE_PEEKUSER, traced_process, PT_DSCR &lt;&lt; 3, NULL);

The patch does not increase PT_REGS_COUNT as the pt_regs struct has not
been changed.

Signed-off-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc: Hardware breakpoints rewrite to handle non DABR breakpoint registers</title>
<updated>2013-01-10T06:01:44Z</updated>
<author>
<name>Michael Neuling</name>
</author>
<published>2012-12-20T14:06:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9422de3e953d0e60eb95f5430a9dd803eec1c6d7'/>
<id>urn:sha1:9422de3e953d0e60eb95f5430a9dd803eec1c6d7</id>
<content type='text'>
This is a rewrite so that we don't assume we are using the DABR throughout the
code.  We now use the arch_hw_breakpoint to store the breakpoint in a generic
manner in the thread_struct, rather than storing the raw DABR value.

The ptrace GET/SET_DEBUGREG interface currently passes the raw DABR in from
userspace.  We keep this functionality, so that future changes (like the POWER8
DAWR), will still fake the DABR to userspace.

Signed-off-by: Michael Neuling &lt;mikey@neuling.org&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/ptrace: Enable hardware breakpoint upon re-registering</title>
<updated>2012-11-15T02:01:13Z</updated>
<author>
<name>Aravinda Prasad</name>
</author>
<published>2012-11-04T22:15:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a53fd61ac2f411745471c1c877d5e072fbbf0e5c'/>
<id>urn:sha1:a53fd61ac2f411745471c1c877d5e072fbbf0e5c</id>
<content type='text'>
On powerpc, ptrace will disable hardware breakpoint request once the
breakpoint is hit. It is the responsibility of the caller to set it
again. However, when the caller sets the hardware breakpoint again
using ptrace(PTRACE_SET_DEBUGREG, child_pid, 0, addr), the hardware
breakpoint is not enabled.

While gdb's approach is to unregister and re-register the hardware
breakpoint every time the breakpoint is hit - which is working fine,
this could affect other programs trying to re-register hardware
breakpoint without unregistering.

This patch enables hardware breakpoint if the caller is re-registering.

Signed-off-by: Aravinda Prasad &lt;aravinda@linux.vnet.ibm.com&gt;
Acked-by: Michael Neuling &lt;mikey@neuling.org&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
</feed>
