This is a note to let you know that I've just added the patch titled

    sparc64: Don't bark so loudly about 32-bit tasks generating 64-bit fault 
addresses.

to the 3.4-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-don-t-bark-so-loudly-about-32-bit-tasks-generating-64-bit-fault-addresses.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From foo@baz Thu Aug  7 22:33:35 PDT 2014
From: "David S. Miller" <[email protected]>
Date: Tue, 6 May 2014 21:27:37 -0700
Subject: sparc64: Don't bark so loudly about 32-bit tasks generating 64-bit 
fault addresses.

From: "David S. Miller" <[email protected]>

[ Upstream commit e5c460f46ae7ee94831cb55cb980f942aa9e5a85 ]

This was found using Dave Jone's trinity tool.

When a user process which is 32-bit performs a load or a store, the
cpu chops off the top 32-bits of the effective address before
translating it.

This is because we run 32-bit tasks with the PSTATE_AM (address
masking) bit set.

We can't run the kernel with that bit set, so when the kernel accesses
userspace no address masking occurs.

Since a 32-bit process will have no mappings in that region we will
properly fault, so we don't try to handle this using access_ok(),
which can safely just be a NOP on sparc64.

Real faults from 32-bit processes should never generate such addresses
so a bug check was added long ago, and it barks in the logs if this
happens.

But it also barks when a kernel user access causes this condition, and
that _can_ happen.  For example, if a pointer passed into a system call
is "0xfffffffc" and the kernel access 4 bytes offset from that pointer.

Just handle such faults normally via the exception entries.

Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 arch/sparc/mm/fault_64.c |   16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

--- a/arch/sparc/mm/fault_64.c
+++ b/arch/sparc/mm/fault_64.c
@@ -282,18 +282,6 @@ static void noinline __kprobes bogus_32b
        show_regs(regs);
 }
 
-static void noinline __kprobes bogus_32bit_fault_address(struct pt_regs *regs,
-                                                        unsigned long addr)
-{
-       static int times;
-
-       if (times++ < 10)
-               printk(KERN_ERR "FAULT[%s:%d]: 32-bit process "
-                      "reports 64-bit fault address [%lx]\n",
-                      current->comm, current->pid, addr);
-       show_regs(regs);
-}
-
 asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
 {
        struct mm_struct *mm = current->mm;
@@ -322,10 +310,8 @@ asmlinkage void __kprobes do_sparc64_fau
                                goto intr_or_no_mm;
                        }
                }
-               if (unlikely((address >> 32) != 0)) {
-                       bogus_32bit_fault_address(regs, address);
+               if (unlikely((address >> 32) != 0))
                        goto intr_or_no_mm;
-               }
        }
 
        if (regs->tstate & TSTATE_PRIV) {


Patches currently in stable-queue which might be from [email protected] are

queue-3.4/sparc64-add-membar-to-niagara2-memcpy-code.patch
queue-3.4/ip-make-ip-identifiers-less-predictable.patch
queue-3.4/sunsab-fix-detection-of-break-on-sunsab-serial-console.patch
queue-3.4/tcp-fix-integer-overflow-in-tcp-vegas.patch
queue-3.4/tcp-fix-integer-overflows-in-tcp-veno.patch
queue-3.4/sparc64-fix-huge-tsb-mapping-on-pre-ultrasparc-iii-cpus.patch
queue-3.4/sparc64-handle-32-bit-tasks-properly-in-compute_effective_address.patch
queue-3.4/macvlan-initialize-vlan_features-to-turn-on-offload-support.patch
queue-3.4/inetpeer-get-rid-of-ip_id_count.patch
queue-3.4/arch-sparc-math-emu-math_32.c-drop-stray-break-operator.patch
queue-3.4/sparc64-do-not-insert-non-valid-ptes-into-the-tsb-hash-table.patch
queue-3.4/sparc64-fix-argument-sign-extension-for-compat_sys_futex.patch
queue-3.4/bbc-i2c-fix-bbc-i2c-envctrl-on-sunblade-2000.patch
queue-3.4/sparc64-guard-against-flushing-openfirmware-mappings.patch
queue-3.4/sparc64-ldc_connect-should-not-return-einval-when-handshake-is-in-progress.patch
queue-3.4/sparc64-fix-top-level-fault-handling-bugs.patch
queue-3.4/sparc64-don-t-bark-so-loudly-about-32-bit-tasks-generating-64-bit-fault-addresses.patch
queue-3.4/net-sendmsg-fix-null-pointer-dereference.patch
queue-3.4/net-sctp-inherit-auth_capable-on-init-collisions.patch
queue-3.4/sparc64-make-itc_sync_lock-raw.patch
queue-3.4/sctp-fix-possible-seqlock-seadlock-in-sctp_packet_transmit.patch
queue-3.4/iovec-make-sure-the-caller-actually-wants-anything-in-memcpy_fromiovecend.patch
queue-3.4/net-correctly-set-segment-mac_len-in-skb_segment.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to