This is a note to let you know that I've just added the patch titled sparc64: Handle 32-bit tasks properly in compute_effective_address(). to the 3.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: sparc64-handle-32-bit-tasks-properly-in-compute_effective_address.patch and it can be found in the queue-3.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Fri Aug 8 08:50:32 PDT 2014 From: "David S. Miller" <davem@xxxxxxxxxxxxx> Date: Mon, 28 Apr 2014 23:50:08 -0700 Subject: sparc64: Handle 32-bit tasks properly in compute_effective_address(). From: "David S. Miller" <davem@xxxxxxxxxxxxx> [ Upstream commit d037d16372bbe4d580342bebbb8826821ad9edf0 ] If we have a 32-bit task we must chop off the top 32-bits of the 64-bit value just as the cpu would. Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/sparc/kernel/unaligned_64.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/arch/sparc/kernel/unaligned_64.c +++ b/arch/sparc/kernel/unaligned_64.c @@ -163,17 +163,23 @@ static unsigned long *fetch_reg_addr(uns unsigned long compute_effective_address(struct pt_regs *regs, unsigned int insn, unsigned int rd) { + int from_kernel = (regs->tstate & TSTATE_PRIV) != 0; unsigned int rs1 = (insn >> 14) & 0x1f; unsigned int rs2 = insn & 0x1f; - int from_kernel = (regs->tstate & TSTATE_PRIV) != 0; + unsigned long addr; if (insn & 0x2000) { maybe_flush_windows(rs1, 0, rd, from_kernel); - return (fetch_reg(rs1, regs) + sign_extend_imm13(insn)); + addr = (fetch_reg(rs1, regs) + sign_extend_imm13(insn)); } else { maybe_flush_windows(rs1, rs2, rd, from_kernel); - return (fetch_reg(rs1, regs) + fetch_reg(rs2, regs)); + addr = (fetch_reg(rs1, regs) + fetch_reg(rs2, regs)); } + + if (!from_kernel && test_thread_flag(TIF_32BIT)) + addr &= 0xffffffff; + + return addr; } /* This is just to make gcc think die_if_kernel does return... */ Patches currently in stable-queue which might be from davem@xxxxxxxxxxxxx are queue-3.10/sctp-fix-possible-seqlock-seadlock-in-sctp_packet_transmit.patch queue-3.10/net-sendmsg-fix-null-pointer-dereference.patch queue-3.10/sparc64-ldc_connect-should-not-return-einval-when-handshake-is-in-progress.patch queue-3.10/sparc64-do-not-insert-non-valid-ptes-into-the-tsb-hash-table.patch queue-3.10/iovec-make-sure-the-caller-actually-wants-anything-in-memcpy_fromiovecend.patch queue-3.10/sparc64-don-t-bark-so-loudly-about-32-bit-tasks-generating-64-bit-fault-addresses.patch queue-3.10/sparc64-fix-argument-sign-extension-for-compat_sys_futex.patch queue-3.10/arch-sparc-math-emu-math_32.c-drop-stray-break-operator.patch queue-3.10/net-correctly-set-segment-mac_len-in-skb_segment.patch queue-3.10/ip-make-ip-identifiers-less-predictable.patch queue-3.10/sparc64-fix-top-level-fault-handling-bugs.patch queue-3.10/sparc64-fix-huge-tsb-mapping-on-pre-ultrasparc-iii-cpus.patch queue-3.10/bnx2x-fix-crash-during-tso-tunneling.patch queue-3.10/sparc64-make-itc_sync_lock-raw.patch queue-3.10/bbc-i2c-fix-bbc-i2c-envctrl-on-sunblade-2000.patch queue-3.10/sparc64-handle-32-bit-tasks-properly-in-compute_effective_address.patch queue-3.10/sunsab-fix-detection-of-break-on-sunsab-serial-console.patch queue-3.10/net-sctp-inherit-auth_capable-on-init-collisions.patch queue-3.10/macvlan-initialize-vlan_features-to-turn-on-offload-support.patch queue-3.10/tcp-fix-integer-overflow-in-tcp-vegas.patch queue-3.10/inetpeer-get-rid-of-ip_id_count.patch queue-3.10/sparc64-add-membar-to-niagara2-memcpy-code.patch queue-3.10/sparc64-guard-against-flushing-openfirmware-mappings.patch queue-3.10/tcp-fix-integer-overflows-in-tcp-veno.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html