Linux 3.0.49

commit d9ee258b13506301b6da6450cf7a1692826b471e
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Sun Oct 28 10:03:00 2012 -0700

    Linux 3.0.49

commit 29b3f4e6bcede9f46132ea1dd52592a9a80a6849
Author: Elric Fu <elricfu1@gmail.com>
Date:   Wed Jun 27 16:55:43 2012 +0800

    xHCI: handle command after aborting the command ring

    commit b63f4053cc8aa22a98e3f9a97845afe6c15d0a0d upstream.

    According to xHCI spec section 4.6.1.1 and section 4.6.1.2,
    after aborting a command on the command ring, xHC will
    generate a command completion event with its completion
    code set to Command Ring Stopped at least. If a command is
    currently executing at the time of aborting a command, xHC
    also generate a command completion event with its completion
    code set to Command Abort. When the command ring is stopped,
    software may remove, add, or rearrage Command Descriptors.

    To cancel a command, software will initialize a command
    descriptor for the cancel command, and add it into a
    cancel_cmd_list of xhci. When the command ring is stopped,
    software will find the command trbs described by command
    descriptors in cancel_cmd_list and modify it to No Op
    command. If software can't find the matched trbs, we can
    think it had been finished.

    This patch should be backported to kernels as old as 3.0, that contain
    the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
    assertion to check for virt_dev=0 bug." That commit papers over a NULL
    pointer dereference, and this patch fixes the underlying issue that
    caused the NULL pointer dereference.

    Note from Sarah: The TRB_TYPE_LINK_LE32 macro is not in the 3.0 stable
    kernel, so I added it to this patch.

    Signed-off-by: Elric Fu <elricfu1@gmail.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4b360f4937e646f777a3049c65124056c84c6977
Author: Elric Fu <elricfu1@gmail.com>
Date:   Wed Jun 27 16:31:52 2012 +0800

    xHCI: cancel command after command timeout

    commit 6e4468b9a0793dfb53eb80d9fe52c739b13b27fd upstream.

    The patch is used to cancel command when the command isn't
    acknowledged and a timeout occurs.

    This patch should be backported to kernels as old as 3.0, that contain
    the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
    assertion to check for virt_dev=0 bug." That commit papers over a NULL
    pointer dereference, and this patch fixes the underlying issue that
    caused the NULL pointer dereference.

    Signed-off-by: Elric Fu <elricfu1@gmail.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bc47204b268516ae4085ebdc81a34ddda71b77c4
Author: Elric Fu <elricfu1@gmail.com>
Date:   Wed Jun 27 16:31:12 2012 +0800

    xHCI: add aborting command ring function

    commit b92cc66c047ff7cf587b318fe377061a353c120f upstream.

    Software have to abort command ring and cancel command
    when a command is failed or hang. Otherwise, the command
    ring will hang up and can't handle the others. An example
    of a command that may hang is the Address Device Command,
    because waiting for a SET_ADDRESS request to be acknowledged
    by a USB device is outside of the xHC's ability to control.

    To cancel a command, software will initialize a command
    descriptor for the cancel command, and add it into a
    cancel_cmd_list of xhci.

    Sarah: Fixed missing newline on "Have the command ring been stopped?"
    debugging statement.

    This patch should be backported to kernels as old as 3.0, that contain
    the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
    assertion to check for virt_dev=0 bug." That commit papers over a NULL
    pointer dereference, and this patch fixes the underlying issue that
    caused the NULL pointer dereference.

    Signed-off-by: Elric Fu <elricfu1@gmail.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c76e4de05c23fea3d6ad6df63876a9397dd7c85a
Author: Elric Fu <elricfu1@gmail.com>
Date:   Wed Jun 27 16:30:57 2012 +0800

    xHCI: add cmd_ring_state

    commit c181bc5b5d5c79b71203cd10cef97f802fb6f9c1 upstream.

    Adding cmd_ring_state for command ring. It helps to verify
    the current command ring state for controlling the command
    ring operations.

    This patch should be backported to kernels as old as 3.0.  The commit
    7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an assertion to
    check for virt_dev=0 bug." papers over the NULL pointer dereference that
    I now believe is related to a timed out Set Address command.  This (and
    the four patches that follow it) contain the real fix that also allows
    VIA USB 3.0 hubs to consistently re-enumerate during the plug/unplug
    stress tests.

    Signed-off-by: Elric Fu <elricfu1@gmail.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 63d9249d5fa183605153928e9f19881fb86e9e81
Author: David S. Miller <davem@davemloft.net>
Date:   Wed Aug 15 00:37:29 2012 -0700

    sparc64: Be less verbose during vmemmap population.

    [ Upstream commit 2856cc2e4d0852c3ddaae9dcb19cb9396512eb08 ]

    On a 2-node machine with 256GB of ram we get 512 lines of
    console output, which is just too much.

    This mimicks Yinghai Lu's x86 commit c2b91e2eec9678dbda274e906cc32ea8f711da3b
    (x86_64/mm: check and print vmemmap allocation continuous) except that
    we aren't ever going to get contiguous block pointers in between calls
    so just print when the virtual address or node changes.

    This decreases the output by an order of 16.

    Also demote this to KERN_DEBUG.

    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6c2bbdc7f87008e15161cb5cbbb49c1292e906e2
Author: Jiri Kosina <jkosina@suse.cz>
Date:   Wed Aug 1 21:10:51 2012 +0200

    sparc64: do not clobber personality flags in sys_sparc64_personality()

    [ Upstream commit a27032eee8cb6e16516f13c8a9752e9d5d4cc430 ]

    There are multiple errors in how sys_sparc64_personality() handles
    personality flags stored in top three bytes.

    - directly comparing current->personality against PER_LINUX32 doesn't work
      in cases when any of the personality flags stored in the top three bytes
      are used.
    - directly forcefully setting personality to PER_LINUX32 or PER_LINUX
      discards any flags stored in the top three bytes

    Fix the first one by properly using personality() macro to compare only
    PER_MASK bytes.
    Fix the second one by setting only the bits that should be set, instead of
    overwriting the whole value.

    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7583ffeee9912de7313b9e3d75b5c9304c664e54
Author: David S. Miller <davem@davemloft.net>
Date:   Tue Oct 16 13:05:25 2012 -0700

    sparc64: Fix bit twiddling in sparc_pmu_enable_event().

    [ Upstream commit e793d8c6740f8fe704fa216e95685f4d92c4c4b9 ]

    There was a serious disconnect in the logic happening in
    sparc_pmu_disable_event() vs. sparc_pmu_enable_event().

    Event disable is implemented by programming a NOP event into the PCR.

    However, event enable was not reversing this operation.  Instead, it
    was setting the User/Priv/Hypervisor trace enable bits.

    That's not sparc_pmu_enable_event()'s job, that's what
    sparc_pmu_enable() and sparc_pmu_disable() do .

    The intent of sparc_pmu_enable_event() is clear, since it first clear
    out the event type encoding field.  So fix this by OR'ing in the event
    encoding rather than the trace enable bits.

    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7f6df60755431d12897da745980316ad900d8b56
Author: David S. Miller <davem@davemloft.net>
Date:   Sun Oct 14 17:59:40 2012 -0700

    sparc64: Like x86 we should check current->mm during perf backtrace generation.

    [ Upstream commit 08280e6c4c2e8049ac61d9e8e3536ec1df629c0d ]

    If the MM is not active, only report the top-level PC.  Do not try to
    access the address space.

    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ad88238990a8e05db4c2d393372bb95bc4be5d99
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Wed Oct 10 17:25:00 2012 -0700

    sparc64: fix ptrace interaction with force_successful_syscall_return()

    [ Upstream commit 55c2770e413e96871147b9406a9c41fe9bc5209c ]

    we want syscall_trace_leave() called on exit from any syscall;
    skipping its call in case we'd done force_successful_syscall_return()
    is broken...

    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4d306c27d6032f5b666e187a8d02bdd288025031
Author: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Date:   Fri Oct 12 04:34:17 2012 +0000

    tcp: resets are misrouted

    [ Upstream commit 4c67525849e0b7f4bd4fab2487ec9e43ea52ef29 ]

    After commit e2446eaa ("tcp_v4_send_reset: binding oif to iif in no
    sock case").. tcp resets are always lost, when routing is asymmetric.
    Yes, backing out that patch will result in misrouting of resets for
    dead connections which used interface binding when were alive, but we
    actually cannot do anything here.  What's died that's died and correct
    handling normal unbound connections is obviously a priority.

    Comment to comment:
    > This has few benefits:
    >   1. tcp_v6_send_reset already did that.

    It was done to route resets for IPv6 link local addresses. It was a
    mistake to do so for global addresses. The patch fixes this as well.

    Actually, the problem appears to be even more serious than guaranteed
    loss of resets.  As reported by Sergey Soloviev <sol@eqv.ru>, those
    misrouted resets create a lot of arp traffic and huge amount of
    unresolved arp entires putting down to knees NAT firewalls which use
    asymmetric routing.

    Signed-off-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 445b290bd3c3470a220049648150eefaec64937a
Author: jeff.liu <jeff.liu@oracle.com>
Date:   Mon Oct 8 18:57:27 2012 +0000

    RDS: fix rds-ping spinlock recursion

    [ Upstream commit 5175a5e76bbdf20a614fb47ce7a38f0f39e70226 ]

    This is the revised patch for fixing rds-ping spinlock recursion
    according to Venkat's suggestions.

    RDS ping/pong over TCP feature has been broken for years(2.6.39 to
    3.6.0) since we have to set TCP cork and call kernel_sendmsg() between
    ping/pong which both need to lock "struct sock *sk". However, this
    lock has already been hold before rds_tcp_data_ready() callback is
    triggerred. As a result, we always facing spinlock resursion which
    would resulting in system panic.

    Given that RDS ping is only used to test the connectivity and not for
    serious performance measurements, we can queue the pong transmit to
    rds_wq as a delayed response.

    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    CC: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
    CC: David S. Miller <davem@davemloft.net>
    CC: James Morris <james.l.morris@oracle.com>
    Signed-off-by: Jie Liu <jeff.liu@oracle.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 17989e50c56ce6873ef3c6abe76aaced1cdbfe7e
Author: Graham Gower <graham.gower@gmail.com>
Date:   Mon Oct 8 08:34:50 2012 +0000

    skge: Add DMA mask quirk for Marvell 88E8001 on ASUS P5NSLI motherboard

    [ Upstream commit a2af139ff1cd85df586690ff626619ab1ee88b0a ]

    Marvell 88E8001 on an ASUS P5NSLI motherboard is unable to send/receive
    packets on a system with >4gb ram unless a 32bit DMA mask is used.

    This issue has been around for years and a fix was sent 3.5 years ago, but
    there was some debate as to whether it should instead be fixed as a PCI quirk.
    http://www.spinics.net/lists/netdev/msg88670.html

    However, 18 months later a similar workaround was introduced for another
    chipset exhibiting the same problem.
    http://www.spinics.net/lists/netdev/msg142287.html

    Signed-off-by: Graham Gower <graham.gower@gmail.com>
    Signed-off-by: Jan Ceuleers <jan.ceuleers@computer.org>
    Acked-by: Stephen Hemminger <shemminger@vyatta.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5891cb7c82658d26ca323639553b94b7272ebb68
Author: ramesh.nagappa@gmail.com <ramesh.nagappa@gmail.com>
Date:   Fri Oct 5 19:10:15 2012 +0000

    net: Fix skb_under_panic oops in neigh_resolve_output

    [ Upstream commit e1f165032c8bade3a6bdf546f8faf61fda4dd01c ]

    The retry loop in neigh_resolve_output() and neigh_connected_output()
    call dev_hard_header() with out reseting the skb to network_header.
    This causes the retry to fail with skb_under_panic. The fix is to
    reset the network_header within the retry loop.

    Signed-off-by: Ramesh Nagappa <ramesh.nagappa@ericsson.com>
    Reviewed-by: Shawn Lu <shawn.lu@ericsson.com>
    Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
    Reviewed-by: Billie Alsup <billie.alsup@ericsson.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 06d96e5711b5e416d9ada181a988631b5e4cc089
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Jul 27 11:51:40 2011 -0700

    drm/i915: apply timing generator bug workaround on CPT and PPT

    commit 3bcf603f6d5d18bd9d076dc280de71f48add4101 upstream.

    On CougarPoint and PantherPoint PCH chips, the timing generator may fail
    to start after DP training completes.  This is due to a bug in the
    FDI autotraining detect logic (which will stall the timing generator and
    re-enable it once training completes), so disable it to avoid silent DP
    mode setting failures.

    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>

commit 6613dbb3a2126a2ef4c5763e496afb7975eaa3de
Author: Devin Heitmueller <dheitmueller@kernellabs.com>
Date:   Mon Aug 6 22:47:03 2012 -0300

    media: au0828: fix case where STREAMOFF being called on stopped stream causes BUG()

    commit a595c1ce4c9d572cf53513570b9f1a263d7867f2 upstream.

    We weren't checking whether the resource was in use before calling
    res_free(), so applications which called STREAMOFF on a v4l2 device that
    wasn't already streaming would cause a BUG() to be hit (MythTV).

    Reported-by: Larry Finger <larry.finger@lwfinger.net>
    Reported-by: Jay Harbeston <jharbestonus@gmail.com>
    Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

commit a322f9a0799883553a0898c7062a944ff64a3056
Author: Andrew Morton <akpm@linux-foundation.org>
Date:   Tue Oct 23 14:09:39 2012 -0700

    amd64_edac:__amd64_set_scrub_rate(): avoid overindexing scrubrates[]

    commit 168bfeef7bba3f9784f7540b053e4ac72b769ce9 upstream.

    If none of the elements in scrubrates[] matches, this loop will cause
    __amd64_set_scrub_rate() to incorrectly use the n+1th element.

    As the function is designed to use the final scrubrates[] element in the
    case of no match, we can fix this bug by simply terminating the array
    search at the n-1th element.

    Boris: this code is fragile anyway, see here why:
    http://marc.info/?l=linux-kernel&m=135102834131236&w=2

    It will be rewritten more robustly soonish.

    Reported-by: Denis Kirjanov <kirjanov@gmail.com>
    Cc: Doug Thompson <dougthompson@xmission.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f0c76f5fa97e436cf24cb57a4aeceb7c83835704
Author: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Date:   Thu Oct 4 16:37:16 2012 +0900

    cgroup: notify_on_release may not be triggered in some cases

    commit 1f5320d5972aa50d3e8d2b227b636b370e608359 upstream.

    notify_on_release must be triggered when the last process in a cgroup is
    move to another. But if the first(and only) process in a cgroup is moved to
    another, notify_on_release is not triggered.

    	# mkdir /cgroup/cpu/SRC
    	# mkdir /cgroup/cpu/DST
    	#
    	# echo 1 >/cgroup/cpu/SRC/notify_on_release
    	# echo 1 >/cgroup/cpu/DST/notify_on_release
    	#
    	# sleep 300 &
    	[1] 8629
    	#
    	# echo 8629 >/cgroup/cpu/SRC/tasks
    	# echo 8629 >/cgroup/cpu/DST/tasks
    	-> notify_on_release for /SRC must be triggered at this point,
    	   but it isn't.

    This is because put_css_set() is called before setting CGRP_RELEASABLE
    in cgroup_task_migrate(), and is a regression introduce by the
    commit:74a1166d(cgroups: make procs file writable), which was merged
    into v3.0.

    Acked-by: Li Zefan <lizefan@huawei.com>
    Cc: Ben Blum <bblum@andrew.cmu.edu>
    Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 68e919c11e940d2d2d34a6a6beae28d62a439f55
Author: Bjørn Mork <bjorn@mork.no>
Date:   Thu Oct 18 17:14:17 2012 +0200

    USB: option: add more ZTE devices

    commit 4b35f1c52943851b310afb09047bfe991ac8f5ae upstream.

    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c01321d80e0c031e39aafc87bf4f94c6da0eab70
Author: Bjørn Mork <bjorn@mork.no>
Date:   Thu Oct 18 17:19:53 2012 +0200

    USB: option: blacklist net interface on ZTE devices

    commit 1452df6f1b7e396d89c2a1fdbdc0e0e839f97671 upstream.

    Based on information from the ZTE Windows drivers.

    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 24d76b99f3422973490ce436776978e419d46c16
Author: Nicolas Boullis <nboullis@debian.org>
Date:   Tue Oct 16 00:06:23 2012 +0200

    usb: acm: fix the computation of the number of data bits

    commit 301a29da6e891e7eb95c843af0ecdbe86d01f723 upstream.

    The current code assumes that CSIZE is 0000060, which appears to be
    wrong on some arches (such as powerpc).

    Signed-off-by: Nicolas Boullis <nboullis@debian.org>
    Acked-by: Oliver Neukum <oneukum@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1468380b7f96472fc03cf7c9459323cdc9d7d405
Author: Ming Lei <ming.lei@canonical.com>
Date:   Tue Oct 16 21:21:21 2012 +0800

    USB: cdc-acm: fix pipe type of write endpoint

    commit c5211187f7ff8e8dbff4ebf7c011ac4c0ffe319c upstream.

    If the write endpoint is interrupt type, usb_sndintpipe() should
    be passed to usb_fill_int_urb() instead of usb_sndbulkpipe().

    Signed-off-by: Ming Lei <ming.lei@canonical.com>
    Cc: Oliver Neukum <oneukum@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1ad744c68166cb1825ce5df7ebbc2a2cfa61eb13
Author: David Vrabel <david.vrabel@citrix.com>
Date:   Fri Oct 19 17:29:07 2012 +0100

    xen/x86: don't corrupt %eip when returning from a signal handler

    commit a349e23d1cf746f8bdc603dcc61fae9ee4a695f6 upstream.

    In 32 bit guests, if a userspace process has %eax == -ERESTARTSYS
    (-512) or -ERESTARTNOINTR (-513) when it is interrupted by an event
    /and/ the process has a pending signal then %eip (and %eax) are
    corrupted when returning to the main process after handling the
    signal.  The application may then crash with SIGSEGV or a SIGILL or it
    may have subtly incorrect behaviour (depending on what instruction it
    returned to).

    The occurs because handle_signal() is incorrectly thinking that there
    is a system call that needs to restarted so it adjusts %eip and %eax
    to re-execute the system call instruction (even though user space had
    not done a system call).

    If %eax == -514 (-ERESTARTNOHAND (-514) or -ERESTART_RESTARTBLOCK
    (-516) then handle_signal() only corrupted %eax (by setting it to
    -EINTR).  This may cause the application to crash or have incorrect
    behaviour.

    handle_signal() assumes that regs->orig_ax >= 0 means a system call so
    any kernel entry point that is not for a system call must push a
    negative value for orig_ax.  For example, for physical interrupts on
    bare metal the inverse of the vector is pushed and page_fault() sets
    regs->orig_ax to -1, overwriting the hardware provided error code.

    xen_hypervisor_callback() was incorrectly pushing 0 for orig_ax
    instead of -1.

    Classic Xen kernels pushed %eax which works as %eax cannot be both
    non-negative and -RESTARTSYS (etc.), but using -1 is consistent with
    other non-system call entry points and avoids some of the tests in
    handle_signal().

    There were similar bugs in xen_failsafe_callback() of both 32 and
    64-bit guests. If the fault was corrected and the normal return path
    was used then 0 was incorrectly pushed as the value for orig_ax.

    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Jan Beulich <JBeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bd7bca8d191425ff8ad7e0f3a30abdb652aff77f
Author: Jacob Shin <jacob.shin@amd.com>
Date:   Thu Oct 20 16:15:26 2011 -0500

    x86: Exclude E820_RESERVED regions and memory holes above 4 GB from direct mapping.

    commit 1bbbbe779aabe1f0768c2bf8f8c0a5583679b54a upstream.

    On systems with very large memory (1 TB in our case), BIOS may report a
    reserved region or a hole in the E820 map, even above the 4 GB range. Exclude
    these from the direct mapping.

    [ hpa: this should be done not just for > 4 GB but for everything above the legacy
      region (1 MB), at the very least.  That, however, turns out to require significant
      restructuring.  That work is well underway, but is not suitable for rc/stable. ]

    Signed-off-by: Jacob Shin <jacob.shin@amd.com>
    Link: http://lkml.kernel.org/r/1319145326-13902-1-git-send-email-jacob.shin@amd.com
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2f3dc85d233fce3345eb1880ec44349d7b290211
Author: Kees Cook <keescook@chromium.org>
Date:   Fri Oct 19 18:45:53 2012 -0700

    use clamp_t in UNAME26 fix

    commit 31fd84b95eb211d5db460a1dda85e004800a7b52 upstream.

    The min/max call needed to have explicit types on some architectures
    (e.g. mn10300). Use clamp_t instead to avoid the warning:

      kernel/sys.c: In function 'override_release':
      kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a cast [enabled by default]

    Reported-by: Fengguang Wu <fengguang.wu@intel.com>
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 58793e9b6ba06d22ce9cf444d190568157c858c9
Author: Kees Cook <keescook@chromium.org>
Date:   Fri Oct 19 13:56:51 2012 -0700

    kernel/sys.c: fix stack memory content leak via UNAME26

    commit 2702b1526c7278c4d65d78de209a465d4de2885e upstream.

    Calling uname() with the UNAME26 personality set allows a leak of kernel
    stack contents.  This fixes it by defensively calculating the length of
    copy_to_user() call, making the len argument unsigned, and initializing
    the stack buffer to zero (now technically unneeded, but hey, overkill).

    CVE-2012-0957

    Reported-by: PaX Team <pageexec@freemail.hu>
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: PaX Team <pageexec@freemail.hu>
    Cc: Brad Spengler <spender@grsecurity.net>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7b48126837ed4804b9f6c1807a21d803cc35172d
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Mon Apr 30 13:50:56 2012 +0000

    pcmcia: sharpsl: don't discard sharpsl_pcmcia_ops

    commit fdc858a466b738d35d3492bc7cf77b1dac98bf7c upstream.

    The sharpsl_pcmcia_ops structure gets passed into
    sa11xx_drv_pcmcia_probe, where it gets accessed at run-time,
    unlike all other pcmcia drivers that pass their structures
    into platform_device_add_data, which makes a copy.

    This means the gcc warning is valid and the structure
    must not be marked as __initdata.

    Without this patch, building collie_defconfig results in:

    drivers/pcmcia/pxa2xx_sharpsl.c:22:31: fatal error: mach-pxa/hardware.h: No such file or directory
    compilation terminated.
    make[3]: *** [drivers/pcmcia/pxa2xx_sharpsl.o] Error 1
    make[2]: *** [drivers/pcmcia] Error 2
    make[1]: *** [drivers] Error 2
    make: *** [sub-make] Error 2

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Cc: Dominik Brodowski <linux@dominikbrodowski.net>
    Cc: Russell King <rmk+kernel@arm.linux.org.uk>
    Cc: Pavel Machek <pavel@suse.cz>
    Cc: linux-pcmcia@lists.infradead.org
    Cc: Jochen Friedrich <jochen@scram.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0fc01fa3b5f98b7add96834efc56a09b398429b3
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Tue Sep 18 13:37:18 2012 +0400

    Revert: lockd: use rpc client's cl_nodename for id encoding

    This reverts 12d63702c53bc2230dfc997e91ca891f39cb6446 which was commit
    303a7ce92064c285a04c870f2dc0192fdb2968cb upstream.

    Taking hostname from uts namespace if not safe, because this cuold be
    performind during umount operation on child reaper death. And in this case
    current->nsproxy is NULL already.

    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
    Cc: Trond Myklebust <Trond.Myklebust@netapp.com>

commit 7a104fcedf491fe1470dab36605f1b1d55ad893d
Author: Sasha Levin <levinsasha928@gmail.com>
Date:   Tue Jul 17 00:01:26 2012 +0200

    SUNRPC: Prevent kernel stack corruption on long values of flush

    commit 212ba90696ab4884e2025b0b13726d67aadc2cd4 upstream.

    The buffer size in read_flush() is too small for the longest possible values
    for it. This can lead to a kernel stack corruption:

    [   43.047329] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: ffffffff833e64b4
    [   43.047329]
    [   43.049030] Pid: 6015, comm: trinity-child18 Tainted: G        W    3.5.0-rc7-next-20120716-sasha #221
    [   43.050038] Call Trace:
    [   43.050435]  [<ffffffff836c60c2>] panic+0xcd/0x1f4
    [   43.050931]  [<ffffffff833e64b4>] ? read_flush.isra.7+0xe4/0x100
    [   43.051602]  [<ffffffff810e94e6>] __stack_chk_fail+0x16/0x20
    [   43.052206]  [<ffffffff833e64b4>] read_flush.isra.7+0xe4/0x100
    [   43.052951]  [<ffffffff833e6500>] ? read_flush_pipefs+0x30/0x30
    [   43.053594]  [<ffffffff833e652c>] read_flush_procfs+0x2c/0x30
    [   43.053596]  [<ffffffff812b9a8c>] proc_reg_read+0x9c/0xd0
    [   43.053596]  [<ffffffff812b99f0>] ? proc_reg_write+0xd0/0xd0
    [   43.053596]  [<ffffffff81250d5b>] do_loop_readv_writev+0x4b/0x90
    [   43.053596]  [<ffffffff81250fd6>] do_readv_writev+0xf6/0x1d0
    [   43.053596]  [<ffffffff812510ee>] vfs_readv+0x3e/0x60
    [   43.053596]  [<ffffffff812511b8>] sys_readv+0x48/0xb0
    [   43.053596]  [<ffffffff8378167d>] system_call_fastpath+0x1a/0x1f

    Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ef9fccff2f6108bd5128113d64d260d3f075eb16
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Wed Oct 10 10:18:35 2012 +0300

    oprofile, x86: Fix wrapping bug in op_x86_get_ctrl()

    commit 44009105081b51417f311f4c3be0061870b6b8ed upstream.

    The "event" variable is a u16 so the shift will always wrap to zero
    making the line a no-op.

    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Robert Richter <robert.richter@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c303f82bbe250dc60ef94d1f282a49118fabcaed
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
Date:   Sat Oct 13 00:30:28 2012 -0400

    NLM: nlm_lookup_file() may return NLMv4-specific error codes

    commit cd0b16c1c3cda12dbed1f8de8f1a9b0591990724 upstream.

    If the filehandle is stale, or open access is denied for some reason,
    nlm_fopen() may return one of the NLMv4-specific error codes nlm4_stale_fh
    or nlm4_failed. These get passed right through nlm_lookup_file(),
    and so when nlmsvc_retrieve_args() calls the latter, it needs to filter
    the result through the cast_status() machinery.

    Failure to do so, will trigger the BUG_ON() in encode_nlm_stat...

    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
    Reported-by: Larry McVoy <lm@bitmover.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e114f9effa5cf00565b5b051d9e96a8df2c8a4b3
Author: Chris Metcalf <cmetcalf@tilera.com>
Date:   Fri Oct 19 11:43:11 2012 -0400

    arch/tile: avoid generating .eh_frame information in modules

    commit 627072b06c362bbe7dc256f618aaa63351f0cfe6 upstream.

    The tile tool chain uses the .eh_frame information for backtracing.
    The vmlinux build drops any .eh_frame sections at link time, but when
    present in kernel modules, it causes a module load failure due to the
    presence of unsupported pc-relative relocations.  When compiling to
    use compiler feedback support, the compiler by default omits .eh_frame
    information, so we don't see this problem.  But when not using feedback,
    we need to explicitly suppress the .eh_frame.

    Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>