From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.8 39/49] sparc64: Convert copy_in_user to accurate exception reporting.
Date: Sat, 19 Nov 2016 10:23:31 +0100 [thread overview]
Message-ID: <20161119092042.832608018@linuxfoundation.org> (raw)
In-Reply-To: <20161119092036.698705716@linuxfoundation.org>
4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit 0096ac9f47b1a2e851b3165d44065d18e5f13d58 ]
Report the exact number of bytes which have not been successfully
copied when an exception occurs, using the running remaining length.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/sparc/lib/copy_in_user.S | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
--- a/arch/sparc/lib/copy_in_user.S
+++ b/arch/sparc/lib/copy_in_user.S
@@ -8,18 +8,33 @@
#define XCC xcc
-#define EX(x,y) \
+#define EX(x,y,z) \
98: x,y; \
.section __ex_table,"a";\
.align 4; \
- .word 98b, __retl_mone; \
+ .word 98b, z; \
.text; \
.align 4;
+#define EX_O4(x,y) EX(x,y,__retl_o4_plus_8)
+#define EX_O2_4(x,y) EX(x,y,__retl_o2_plus_4)
+#define EX_O2_1(x,y) EX(x,y,__retl_o2_plus_1)
+
.register %g2,#scratch
.register %g3,#scratch
.text
+__retl_o4_plus_8:
+ add %o4, %o2, %o4
+ retl
+ add %o4, 8, %o0
+__retl_o2_plus_4:
+ retl
+ add %o2, 4, %o0
+__retl_o2_plus_1:
+ retl
+ add %o2, 1, %o0
+
.align 32
/* Don't try to get too fancy here, just nice and
@@ -44,8 +59,8 @@ ENTRY(___copy_in_user) /* %o0=dst, %o1=s
andn %o2, 0x7, %o4
and %o2, 0x7, %o2
1: subcc %o4, 0x8, %o4
- EX(ldxa [%o1] %asi, %o5)
- EX(stxa %o5, [%o0] %asi)
+ EX_O4(ldxa [%o1] %asi, %o5)
+ EX_O4(stxa %o5, [%o0] %asi)
add %o1, 0x8, %o1
bgu,pt %XCC, 1b
add %o0, 0x8, %o0
@@ -53,8 +68,8 @@ ENTRY(___copy_in_user) /* %o0=dst, %o1=s
be,pt %XCC, 1f
nop
sub %o2, 0x4, %o2
- EX(lduwa [%o1] %asi, %o5)
- EX(stwa %o5, [%o0] %asi)
+ EX_O2_4(lduwa [%o1] %asi, %o5)
+ EX_O2_4(stwa %o5, [%o0] %asi)
add %o1, 0x4, %o1
add %o0, 0x4, %o0
1: cmp %o2, 0
@@ -70,8 +85,8 @@ ENTRY(___copy_in_user) /* %o0=dst, %o1=s
82:
subcc %o2, 4, %o2
- EX(lduwa [%o1] %asi, %g1)
- EX(stwa %g1, [%o0] %asi)
+ EX_O2_4(lduwa [%o1] %asi, %g1)
+ EX_O2_4(stwa %g1, [%o0] %asi)
add %o1, 4, %o1
bgu,pt %XCC, 82b
add %o0, 4, %o0
@@ -82,8 +97,8 @@ ENTRY(___copy_in_user) /* %o0=dst, %o1=s
.align 32
90:
subcc %o2, 1, %o2
- EX(lduba [%o1] %asi, %g1)
- EX(stba %g1, [%o0] %asi)
+ EX_O2_1(lduba [%o1] %asi, %g1)
+ EX_O2_1(stba %g1, [%o0] %asi)
add %o1, 1, %o1
bgu,pt %XCC, 90b
add %o0, 1, %o0
next prev parent reply other threads:[~2016-11-19 9:25 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20161119092339epcas3p4464a1a8a19f9171b12871d8cfef3ea16@epcas3p4.samsung.com>
2016-11-19 9:22 ` [PATCH 4.8 00/49] 4.8.10-stable review Greg Kroah-Hartman
2016-11-19 9:22 ` [PATCH 4.8 01/49] dctcp: avoid bogus doubling of cwnd after loss Greg Kroah-Hartman
2016-11-19 9:22 ` [PATCH 4.8 02/49] net: clear sk_err_soft in sk_clone_lock() Greg Kroah-Hartman
2016-11-19 9:22 ` [PATCH 4.8 04/49] bgmac: stop clearing DMA receive control register right after it is set Greg Kroah-Hartman
2016-11-19 9:22 ` [PATCH 4.8 05/49] ip6_tunnel: Clear IP6CB in ip6tunnel_xmit() Greg Kroah-Hartman
2016-11-19 9:22 ` [PATCH 4.8 07/49] ipv4: allow local fragmentation in ip_finish_output_gso() Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 08/49] tcp: fix return value for partial writes Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 09/49] dccp: do not release listeners too soon Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 10/49] dccp: do not send reset to already closed sockets Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 11/49] dccp: fix out of bound access in dccp_v4_err() Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 12/49] ipv6: dccp: fix out of bound access in dccp_v6_err() Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 13/49] ipv6: dccp: add missing bind_conflict to dccp_ipv6_mapped Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 14/49] sctp: assign assoc_id earlier in __sctp_connect Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 15/49] bpf: fix htab map destruction when extra reserve is in use Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 16/49] net: icmp6_send should use dst dev to determine L3 domain Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 17/49] fib_trie: Correct /proc/net/route off by one error Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 19/49] net: icmp_route_lookup should use rt dev to determine L3 domain Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 20/49] net: __skb_flow_dissect() must cap its return value Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 21/49] ipv4: use new_gw for redirect neigh lookup Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 22/49] tcp: take care of truncations done by sk_filter() Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 24/49] mlxsw: spectrum: Fix refcount bug on span entries Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 25/49] mlxsw: spectrum_router: Correctly dump neighbour activity Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 26/49] Revert "bnx2: Reset device during driver initialization" Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 27/49] bnx2: Wait for in-flight DMA to complete at probe stage Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 28/49] sctp: change sk state only when it has assocs in sctp_shutdown Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 29/49] net: stmmac: Fix lack of link transition for fixed PHYs Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 31/49] sparc: Handle negative offsets in arch_jump_label_transform Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 32/49] sparc64: Handle extremely large kernel TSB range flushes sanely Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 33/49] sparc64: Fix illegal relative branches in hypervisor patched TLB code Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 34/49] sparc64: Fix instruction count in comment for __hypervisor_flush_tlb_pending Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 35/49] sparc64: Fix illegal relative branches in hypervisor patched TLB cross-call code Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 36/49] sparc64: Handle extremely large kernel TLB range flushes more gracefully Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 37/49] sparc64: Delete __ret_efault Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 38/49] sparc64: Prepare to move to more saner user copy exception handling Greg Kroah-Hartman
2016-11-19 9:23 ` Greg Kroah-Hartman [this message]
2016-11-19 9:23 ` [PATCH 4.8 40/49] sparc64: Convert GENcopy_{from,to}_user to accurate exception reporting Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 41/49] sparc64: Convert U1copy_{from,to}_user " Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 42/49] sparc64: Convert NG4copy_{from,to}_user " Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 43/49] sparc64: Convert NGcopy_{from,to}_user " Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 44/49] sparc64: Convert NG2copy_{from,to}_user " Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 45/49] sparc64: Convert U3copy_{from,to}_user " Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 46/49] sparc64: Delete now unused user copy assembler helpers Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 47/49] sparc64: Delete now unused user copy fixup functions Greg Kroah-Hartman
2016-11-19 9:23 ` [PATCH 4.8 48/49] usb: gadget: f_fs: edit epfile->ep under lock Greg Kroah-Hartman
2016-11-19 16:21 ` [PATCH 4.8 00/49] 4.8.10-stable review Guenter Roeck
2016-11-19 16:58 ` Greg Kroah-Hartman
2016-11-21 16:32 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161119092042.832608018@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).