[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-e7cc4173115347bcdaa5de2824dd46ef2c58425f@git.kernel.org>
Date: Fri, 8 May 2015 06:21:22 -0700
From: tip-bot for Palmer Dabbelt <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: torvalds@...ux-foundation.org, hpa@...or.com,
akpm@...ux-foundation.org, bp@...en8.de, cmetcalf@...hip.com,
mingo@...nel.org, linux-kernel@...r.kernel.org,
peterz@...radead.org, palmer@...belt.com, tglx@...utronix.de
Subject: [tip:sched/core] signals, ptrace, sched:
Fix a misaligned load inside ptrace_attach()
Commit-ID: e7cc4173115347bcdaa5de2824dd46ef2c58425f
Gitweb: http://git.kernel.org/tip/e7cc4173115347bcdaa5de2824dd46ef2c58425f
Author: Palmer Dabbelt <palmer@...belt.com>
AuthorDate: Thu, 30 Apr 2015 21:19:55 -0700
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 8 May 2015 12:06:57 +0200
signals, ptrace, sched: Fix a misaligned load inside ptrace_attach()
The misaligned load exception arises when running ptrace_attach() on
the RISC-V (which hasn't been upstreamed yet). The problem is that
wait_on_bit() takes a void* but then proceeds to call test_bit(),
which takes a long*. This allows an int-aligned pointer to be passed
to test_bit(), which promptly fails. This will manifest on any other
asm-generic port where unaligned loads trap, where sizeof(long) >
sizeof(int), and where task_struct.jobctl ends up not being
long-aligned.
This patch changes task_struct.jobctl to be a long, which ensures it
has the correct alignment.
Signed-off-by: Palmer Dabbelt <palmer@...belt.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Chris Metcalf <cmetcalf@...hip.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: bobby.prani@...il.com
Cc: oleg@...hat.com
Cc: paulmck@...ux.vnet.ibm.com
Cc: richard@....at
Cc: vdavydov@...allels.com
Link: http://lkml.kernel.org/r/1430453997-32459-2-git-send-email-palmer@dabbelt.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
include/linux/sched.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4f066cb..fb650a2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1374,7 +1374,7 @@ struct task_struct {
int exit_state;
int exit_code, exit_signal;
int pdeath_signal; /* The signal sent when the parent dies */
- unsigned int jobctl; /* JOBCTL_*, siglock protected */
+ unsigned long jobctl; /* JOBCTL_*, siglock protected */
/* Used for emulating ABI behavior of previous Linux versions */
unsigned int personality;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists