From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x225aOQ79qYWaPWl5b3GAQ6VE6PCAr9c2Xunid9R6F1G9OSIDqCC3X0cOI7BhG9KWl4pcdsFQ ARC-Seal: i=1; a=rsa-sha256; t=1516610931; cv=none; d=google.com; s=arc-20160816; b=AgVnV7+iwOvcayc0aymf5tDPyYI4FZ13IwWjYsmvIsheCcDllcbpngrLsLL5DQEKVk 4njyNod167Cd8Eee/NYsvsLYzXr3+Ebe+MkIqP1Eshr+WrmXewl9Z6xWV6d5sPqbM3LA dO5hAlsXdiC6XUjhjA563weyIj1EMnrXcECR50DaCfrP7IjDv6p4gQL726wKLe/568Xp Vas+SrTUnm1pM2bVfCjAm3TGw0VpXf8KeXmtQyNzQeW8q2Gfqx+0oeelT8IlYaID+n0I T+TANDw3KTjzBZSZDhyfUfI6MI8NaidrpwlnCM+U+MY9OlinvOIwSHhKcd2WYOsiulGF DHhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=gq6d4CdFpvS9VpgWp89SKMLSXXEpZonHP28gQTVUbzM=; b=rDN0XwEuheNi0iUaNdQfxG82INPL5s7Ncx58kpWzK+fcvia6nAdHBE1tEvmnx/suZP pqcqnWW5u59LQpRA/EEBymXquKchONJCc1vQYmcHYq90N4LJuyVf2KXc8YPBI//WSQbS fRPJCwLLtDCWqf6lPS7IBrPvTZGyn3S94nwzmUuS6uwW31Z3/hTJqX98CwGM+d3l+wfc te8AKNq0CDIVLycuySbtt4Od/P8NqwSCLsE8bic/E3s3Eyp8HbC2zwunxqlfCoXXeXWz cKgbyCR11107fQtE4tnvChyXQgxuvrOOTirEa1f+CFx0sUE7Iy+VFN7rn4D3niJCfL63 mKJw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xi Kangjie , Jan Kiszka , Kieran Bingham , Andrew Morton , Linus Torvalds Subject: [PATCH 4.9 33/47] scripts/gdb/linux/tasks.py: fix get_thread_info Date: Mon, 22 Jan 2018 09:45:44 +0100 Message-Id: <20180122083928.182004820@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083925.568134913@linuxfoundation.org> References: <20180122083925.568134913@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281823867956992?= X-GMAIL-MSGID: =?utf-8?q?1590281823867956992?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xi Kangjie commit 883d50f56d263f70fd73c0d96b09eb36c34e9305 upstream. Since kernel 4.9, the thread_info has been moved into task_struct, no longer locates at the bottom of kernel stack. See commits c65eacbe290b ("sched/core: Allow putting thread_info into task_struct") and 15f4eae70d36 ("x86: Move thread_info into task_struct"). Before fix: (gdb) set $current = $lx_current() (gdb) p $lx_thread_info($current) $1 = {flags = 1470918301} (gdb) p $current.thread_info $2 = {flags = 2147483648} After fix: (gdb) p $lx_thread_info($current) $1 = {flags = 2147483648} (gdb) p $current.thread_info $2 = {flags = 2147483648} Link: http://lkml.kernel.org/r/20180118210159.17223-1-imxikangjie@gmail.com Fixes: 15f4eae70d36 ("x86: Move thread_info into task_struct") Signed-off-by: Xi Kangjie Acked-by: Jan Kiszka Acked-by: Kieran Bingham Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- scripts/gdb/linux/tasks.py | 2 ++ 1 file changed, 2 insertions(+) --- a/scripts/gdb/linux/tasks.py +++ b/scripts/gdb/linux/tasks.py @@ -96,6 +96,8 @@ def get_thread_info(task): thread_info_addr = task.address + ia64_task_size thread_info = thread_info_addr.cast(thread_info_ptr_type) else: + if task.type.fields()[0].type == thread_info_type.get_type(): + return task['thread_info'] thread_info = task['stack'].cast(thread_info_ptr_type) return thread_info.dereference()