Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5556410e2203877e7606bb1008f2e024fe87953a
Commit:     5556410e2203877e7606bb1008f2e024fe87953a
Parent:     662ae2169a16004700cc18c1898aead2e5e944d5
Author:     Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Tue Aug 7 19:13:23 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Tue Aug 7 19:13:23 2007 +0900

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh/kernel/machvec.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/sh/kernel/machvec.c b/arch/sh/kernel/machvec.c
index 23c5948..129b2cf 100644
--- a/arch/sh/kernel/machvec.c
+++ b/arch/sh/kernel/machvec.c
@@ -91,6 +91,13 @@ void __init sh_mv_setup(void)
                                (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.
                 */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to