lkml.org 
[lkml]   [2017]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.12 106/142] metag/ptrace: Preserve previous registers for short regset write
    Date
    From: Dave Martin <Dave.Martin@arm.com>

    3.12-stable review patch. If anyone has any objections, please let me know.

    ===============

    commit a78ce80d2c9178351b34d78fec805140c29c193e upstream.

    Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
    to fill all the registers, the thread's old registers are preserved.

    Signed-off-by: Dave Martin <Dave.Martin@arm.com>
    Acked-by: James Hogan <james.hogan@imgtec.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    ---
    arch/metag/kernel/ptrace.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/arch/metag/kernel/ptrace.c b/arch/metag/kernel/ptrace.c
    index 7563628822bd..ae659ba61948 100644
    --- a/arch/metag/kernel/ptrace.c
    +++ b/arch/metag/kernel/ptrace.c
    @@ -303,7 +303,7 @@ static int metag_tls_set(struct task_struct *target,
    const void *kbuf, const void __user *ubuf)
    {
    int ret;
    - void __user *tls;
    + void __user *tls = target->thread.tls_ptr;

    ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tls, 0, -1);
    if (ret)
    --
    2.12.2
    \
     
     \ /
      Last update: 2017-04-10 17:35    [W:4.101 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site