Re: Improper handling of unaligned user address access?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The first thing I tried to fix this issue was to use the
'memcpy.S' file from 2.4.7 and that actually worked, but
that was a step backwards. It was much simpler to just
add a 'nop' after the offending branch instruction. It
fixes all of my problems with 'copy_from_user'. I have
already checked these into both the 2.4 and 2.5 trees.

I do have one further question. In 'arch/mips/mm/fault.c'
when we need to do a fixup:

   fixup = search_exception_table(regs->cp0_epc);

Why do we not check to see if the EPC is a branch insn
before looking in the exception table?

-Steve
Index: memcpy.S
===================================================================
RCS file: /home/cvs/linux/arch/mips/lib/memcpy.S,v
retrieving revision 1.6.2.4
diff -u -r1.6.2.4 memcpy.S
--- memcpy.S	19 Sep 2002 14:01:24 -0000	1.6.2.4
+++ memcpy.S	4 Mar 2003 00:09:52 -0000
@@ -357,6 +357,7 @@
 	beqz	len, done
 	 and	rem, len, NBYTES-1  # rem = len % NBYTES
 	beq	rem, len, copy_bytes
+	nop
 1:
 EXC(	 LDFIRST t0, FIRST(0)(src),	l_exc)
 EXC(	LDREST	t0, REST(0)(src),	l_exc_copy)
Index: memcpy.S
===================================================================
RCS file: /home/cvs/linux/arch/mips/lib/memcpy.S,v
retrieving revision 1.11
diff -u -r1.11 memcpy.S
--- memcpy.S	19 Sep 2002 14:01:28 -0000	1.11
+++ memcpy.S	4 Mar 2003 00:10:58 -0000
@@ -357,6 +357,7 @@
 	beqz	len, done
 	 and	rem, len, NBYTES-1  # rem = len % NBYTES
 	beq	rem, len, copy_bytes
+	nop
 1:
 EXC(	 LDFIRST t0, FIRST(0)(src),	l_exc)
 EXC(	LDREST	t0, REST(0)(src),	l_exc_copy)

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux