signals, ptrace, sched: Fix a misaligned load inside ptrace_attach()
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 <f4b28e76227655e2f75926a7939b12f4960b40e7@dabbelt.com>
Signed-off-by: Peter Zijlstra (Intel) <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Reviewed-by: Chris Metcalf <074881f6f5da4d3b5278870ff234d1077ee622c0@ezchip.com>
Cc: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Cc: Borislav Petkov <0691a664b24b6f15b20cd5aee64b72271db08be1@alien8.de>
Cc: H. Peter Anvin <8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com>
Cc: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>
Cc: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Cc: 99f39d96f0d0b011d351b608fe7e2870596fa4a9@gmail.com
Cc: 20b70f0af00562e63758b9ee42012ecc96c58590@redhat.com
Cc: 1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com
Cc: 320bca71fc381a4a025636043ca86e734e31cf8b@nod.at
Cc: 0d62248ee021b6e01c0ee596a62a5b145b996974@parallels.com
Link: http://lkml.kernel.org/r/1430453997-32459-2-git-send-email-f4b28e76227655e2f75926a7939b12f4960b40e7@dabbelt.com
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs