Skip to content

Commit

Permalink
sparc32: fix a braino in fault handling in csum_and_copy_..._user()
Browse files Browse the repository at this point in the history
commit 1f36cd0 upstream.

Fault handler used to make non-trivial calls, so it needed
to set a stack frame up.  Used to be
	save ... - grab a stack frame, old %o... become %i...
	....
	ret	- go back to address originally in %o7, currently %i7
	 restore - switch to previous stack frame, in delay slot
Non-trivial calls had been gone since ab5e8b3 and that code should
have become
	retl	- go back to address in %o7
	 clr %o0 - have return value set to 0
What it had become instead was
	ret	- go back to address in %i7 - return address of *caller*
	 clr %o0 - have return value set to 0
which is not good, to put it mildly - we forcibly return 0 from
csum_and_copy_{from,to}_iter() (which is what the call of that
thing had been inlined into) and do that without dropping the
stack frame of said csum_and_copy_..._iter().  Confuses the
hell out of the caller of csum_and_copy_..._iter(), obviously...

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Fixes: ab5e8b3 "sparc32: propagate the calling conventions change down to __csum_partial_copy_sparc_generic()"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Al Viro authored and gregkh committed Nov 2, 2023
1 parent 5161778 commit d1e0391
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sparc/lib/checksum_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,5 @@ ccslow: cmp %g1, 0
* we only bother with faults on loads... */

cc_fault:
ret
retl
clr %o0

0 comments on commit d1e0391

Please sign in to comment.