Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
char: random: Workaround the Illegal unaligned access
In extract_buf(), hash will be copied to out. Compiler optimizes memcpy() aggresively and does not test the unaligned destination address. Specify aligned attributes to workaound it. crash log: KERNEL: fault at 0x080872a0 [pc=0x080872a0, sp=0x9004bdb8] Illegal unaligned access Pid: 1, comm: swapper CPU: 0 Not tainted (2.6.33-arm1 #70) pc : [<080872a0>] lr : [<00000000>] psr: 2100000b sp : 9004bdb8 ip : 00000000 fp : 00000000 Code dump at pc [080872a0]: 60696028 a801812b f7f02114 b066fbe7 r10: 00000000 r9 : 9004a008 r8 : 90017ba0 r7 : 00000000 r6 : 90013950 r5 : 9004bf66 r4 : 00000020 r3 : 00005f10 r2 : 6183a03c r1 : 31f8a394 r0 : 8ddee099 Flags: nzCv IRQs on FIQs on Mode UK11_26 ISA unknown Segment kernel Kernel panic - not syncing: disassembly: 08087230 <extract_buf>: ... 8087238: 460d mov r5, r1 ... 80872a0: 6028 str r0, [r5, #0] 80872a2: 6069 str r1, [r5, #4] 80872a4: 812b strh r3, [r5, EmcraftSystems#8] ... Signed-off-by: Jim Huang <[email protected]>
- Loading branch information