From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224sg9ON29rk5m6GRYCdggySVGi7A8V3QPOIbf0AnkyYWIadTn8Q8rvj9RvvG+jEMU6p3jzF ARC-Seal: i=1; a=rsa-sha256; t=1516611182; cv=none; d=google.com; s=arc-20160816; b=LVgOf6SFDyGd8CgXgPzv7rEfjkQcx9Y0vuzwO4AAjdi7SeyAkjmk44N5IR1LAtxTpd 38UzdM3UhjGHWHxiIuJBEFcsnCq/xPAf/irWGEhE2PSz4uCxiFIT1hnyzJm+6CkZb/Ti u4UZ9J+w91+lVtclfFyV9qaww9bABRGJfJ0L9PgsPb96vE3EhFSxQpOUtPWIl0N5wV20 kklqnSc0f/MsxbrVAzDS3yzLrrCG90A0QSzZHkSt3BsOPtgiuHUsWuIFERzQR949sqDs blJaKOB0sL/ejm2HgP3UYIui2s9fY/f7us8sq6cEJJzjgm3XNlOBMw2Lpj8V8qblC1g4 qtUg== 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=LSMKEV3D5Ght3UOUHWwPeFBWaCI17uGfa20G7QzBmGA=; b=R7X4UmnNBz4rIwKdiLZ1L1NGh+hO8r4vqE1sdN1HAaPND1B1POvq6C60s3kD1RVZQH XTNoofbJzWbFVd23l4SrbXdwa8WNvuTsA39206lln5W1nrxkdC2A9TEAbVPUbhzEFAZq 6xvisHZ+askxAEuIP4kLEv0QExXXeG5y6Z/uPH5eAvfL0hBc+mgAJsIZzhJ3dOCtPpjl 0Ep2JtaVRDRCkYbCUC3LF0oxIcmflHV2JekcoC/pVEIKIt1JHp6uxUQFKbzbWsz3Ohoy qDVZA91poanrgGW/ZZvFByKpwT0mQvhMnerf7IHx50h+XqVL12TdFZ5glY7UDjCtcLlV NhpA== 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.14 64/89] scripts/gdb/linux/tasks.py: fix get_thread_info Date: Mon, 22 Jan 2018 09:45:44 +0100 Message-Id: <20180122084000.977649315@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083954.683903493@linuxfoundation.org> References: <20180122083954.683903493@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?1590282087197666710?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-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()