From 662ae2169a16004700cc18c1898aead2e5e944d5 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Sat, 4 Aug 2007 13:39:21 +0900 Subject: sh: Fix PTRACE_PEEKTEXT/PEEKDATA fallout from generic_ptrace_peekdata(). When generic_ptrace_peekdata() was merged, the break for these cases ended up getting dropped, which lead to each PEEKTEXT/PEEKDATA op leaking in to PEEKUSR and get_user_pages() always -EFAULTing. Add the break back in. Signed-off-by: Paul Mundt --- arch/sh/kernel/ptrace.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c index 891d1d46c902..f64a2d2416d4 100644 --- a/arch/sh/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace.c @@ -93,6 +93,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) case PTRACE_PEEKTEXT: /* read word at location addr. */ case PTRACE_PEEKDATA: ret = generic_ptrace_peekdata(child, addr, data); + break; /* read the word at location addr in the USER area. */ case PTRACE_PEEKUSR: { -- cgit v1.2.3 From 5556410e2203877e7606bb1008f2e024fe87953a Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Tue, 7 Aug 2007 19:13:23 +0900 Subject: sh: panic on machvec section misalignment. Now that __initmv references the machvec section unconditionally there have been cases where folks have been mistakenly flagging non-machvec structures with the machvec section attribute (presumably to shut up modpost). This leads to obscure breakage in earlyprintk amongst other places and is rather non-obvious. Add a simple sanity check to try and catch __initmv misuse and panic early. Reported-by: Markus Brunner Signed-off-by: Paul Mundt --- arch/sh/kernel/machvec.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch') diff --git a/arch/sh/kernel/machvec.c b/arch/sh/kernel/machvec.c index 23c5948f0124..129b2cfd18a8 100644 --- a/arch/sh/kernel/machvec.c +++ b/arch/sh/kernel/machvec.c @@ -90,6 +90,13 @@ void __init sh_mv_setup(void) machvec_size = ((unsigned long)&__machvec_end - (unsigned long)&__machvec_start); + /* + * Sanity check for machvec section alignment. Ensure + * __initmv hasn't been misused. + */ + if (machvec_size % sizeof(struct sh_machine_vector)) + panic("machvec misaligned, invalid __initmv use?"); + /* * If the machvec hasn't been preselected, use the first * vector (usually the only one) from .machvec.init. -- cgit v1.2.3 From 96989d9d754ef1fa55e71beff6a076f79cc1717e Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Fri, 17 Aug 2007 01:25:34 +0900 Subject: sh: remove extraneous ; on scif_sercon_putc wait loop It seems we have gained an extraneous trailing ';' on one of the wait loops in scif_sercon_putc(). Although this is completely benign as the apparent payload is also the empty statement, it invites error in the future. Clean it up now. Signed-off-by: Andy Whitcroft Signed-off-by: Paul Mundt --- arch/sh/kernel/early_printk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c index 9833493d8867..80b637c30203 100644 --- a/arch/sh/kernel/early_printk.c +++ b/arch/sh/kernel/early_printk.c @@ -76,7 +76,7 @@ static void scif_sercon_putc(int c) sci_in(&scif_port, SCxSR); sci_out(&scif_port, SCxSR, 0xf3 & ~(0x20 | 0x40)); - while ((sci_in(&scif_port, SCxSR) & 0x40) == 0); + while ((sci_in(&scif_port, SCxSR) & 0x40) == 0) ; if (c == '\n') -- cgit v1.2.3