26 Jan, 2012

40 commits

  • commit c10076c4304083af15a41f6bc5e657e781c1f9a6 upstream.

    Tracepoints are disabled for tainted modules, which is usually because the
    module is either proprietary or was forced, and we don't want either of them
    using kernel tracepoints.

    But, a module can also be tainted by being in the staging directory or
    compiled out of tree. Either is fine for use with tracepoints, no need
    to punish them. I found this out when I noticed that my sample trace event
    module, when done out of tree, stopped working.

    Cc: Mathieu Desnoyers
    Cc: Ben Hutchings
    Cc: Dave Jones
    Cc: Greg Kroah-Hartman
    Cc: Rusty Russell
    Signed-off-by: Steven Rostedt
    Signed-off-by: Greg Kroah-Hartman

    Steven Rostedt
     
  • commit cd4ca7afc61d3b18fcd635002459fb6b1d701099 upstream.

    Update xc4000 tuner definition, number 81 is already in use by
    TUNER_PARTSNIC_PTI_5NF05.

    Signed-off-by: Miroslav Slugen
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Miroslav Slugen
     
  • commit b6854e3f31402476bcc9d2f41570389fa491de17 upstream.

    All radio tuners in cx88 driver using same address for radio and tuner,
    so there is no need to probe it twice for same tuner and we can use
    radio_type UNSET, this also fix broken radio since kernel 2.6.39-rc1
    for those tuners.

    Signed-off-by: Miroslav Slugen
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Miroslav Slugen
     
  • commit a7c8aadad39428b64d26c3971d967f8314e2397d upstream.

    Fix possible null dereference for Leadtek DTV 3200H
    XC4000 tuner when no firmware file available.

    Signed-off-by: Miroslav Slugen
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Miroslav Slugen
     
  • commit 28e7d218da975f6ae1751e293aed938952c55c98 upstream.

    This clears the currently mapped core when suspending, to force
    re-mapping after resume. Without that we were touching default core
    registers believing some other core is mapped. Such a behaviour
    resulted in lockups on some machines.

    Signed-off-by: Rafał Miłecki
    Signed-off-by: John W. Linville
    Signed-off-by: Greg Kroah-Hartman

    Rafał Miłecki
     
  • commit 895f3022523361e9b383cf48f51feb1f7d5e7e53 upstream.

    The target code was not setting the additional sense length field in the
    sense data it returned, which meant that at least the Linux stack
    ignored the ASC/ASCQ fields. For example, without this patch, on a
    tcm_loop device:

    # sg_raw -v /dev/sda 2 0 0 0 0 0

    gives

    cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
    Fixed format, current; Sense key: Illegal Request
    Raw sense data (in hex):
    70 00 05 00 00 00 00 00

    while after the patch we correctly get the following (which matches what
    a regular disk returns):

    cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
    Fixed format, current; Sense key: Illegal Request
    Additional sense: Invalid command operation code
    Raw sense data (in hex):
    70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00
    00 00

    Signed-off-by: Roland Dreier
    Signed-off-by: Nicholas Bellinger
    Signed-off-by: Greg Kroah-Hartman

    Roland Dreier
     
  • commit ce136176fea522fc8f4c16dcae7e8ed1d890ca39 upstream.

    Current SCSI specs say that the "response format" field in the standard
    INQUIRY response should be set to 2, and all the real SCSI devices I
    have do put 2 here. So let's do that too.

    Signed-off-by: Roland Dreier
    Signed-off-by: Nicholas Bellinger
    Signed-off-by: Greg Kroah-Hartman

    Roland Dreier
     
  • commit cced5041ed5a2d1352186510944b0ddfbdbe4c0b upstream.

    sym53c8xx_slave_destroy unconditionally assumes that sym53c8xx_slave_alloc has
    succesesfully allocated a sym_lcb. This can lead to a NULL pointer dereference
    (exposed by commit 4e6c82b).

    Signed-off-by: Stratos Psomadakis
    Signed-off-by: James Bottomley
    Signed-off-by: Greg Kroah-Hartman

    Stratos Psomadakis
     
  • commit d640113fe80e45ebd4a5b420b220d3f6bf37f682 upstream.

    For UP processor, it is likely that no _MAT method or MADT table defined.
    So currently acpi_get_cpuid(...) always return -1 for UP processor.
    This is wrong. It should return valid value for CPU0.

    In the other hand, BIOS may define multiple CPU handles even for UP
    processor, for example

    Scope (_PR)
    {
    Processor (CPU0, 0x00, 0x00000410, 0x06) {}
    Processor (CPU1, 0x01, 0x00000410, 0x06) {}
    Processor (CPU2, 0x02, 0x00000410, 0x06) {}
    Processor (CPU3, 0x03, 0x00000410, 0x06) {}
    }

    We should only return valid value for CPU0's acpi handle.
    And return invalid value for others.

    http://marc.info/?t=132329819900003&r=1&w=2

    Reported-and-tested-by: wallak@free.fr
    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown
    Signed-off-by: Greg Kroah-Hartman

    Lin Ming
     
  • commit da4d8b287abe783d30e968155614531a0937d090 upstream.

    The call to acpi_os_validate_address in acpi_ds_get_region_arguments was
    removed by mistake in commit 9ad19ac(ACPICA: Split large dsopcode and
    dsload.c files).

    Put it back.

    Reported-and-bisected-by: Luca Tettamanti
    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown
    Signed-off-by: Greg Kroah-Hartman

    Lin Ming
     
  • commit 9f10f6a520deb3639fac78d81151a3ade88b4e7f upstream.

    In SRAT v1, we had 8bit proximity domain (PXM) fields; SRAT v2 provides
    32bits for these. The new fields were reserved before.
    According to the ACPI spec, the OS must disregrard reserved fields.

    ia64 did handle the PXM fields almost consistently, but depending on
    sgi's sn2 platform. This patch leaves the sn2 logic in, but does also
    use 16/32 bits for PXM if the SRAT has rev 2 or higher.

    The patch also adds __init to the two pxm accessor functions, as they
    access __initdata now and are called from an __init function only anyway.

    Note that the code only uses 16 bits for the PXM field in the processor
    proximity field; the patch does not address this as 16 bits are more than
    enough.

    Signed-off-by: Kurt Garloff
    Signed-off-by: Len Brown
    Signed-off-by: Greg Kroah-Hartman

    Kurt Garloff
     
  • commit cd298f60a2451a16e0f077404bf69b62ec868733 upstream.

    In SRAT v1, we had 8bit proximity domain (PXM) fields; SRAT v2 provides
    32bits for these. The new fields were reserved before.
    According to the ACPI spec, the OS must disregrard reserved fields.

    x86/x86-64 was rather inconsistent prior to this patch; it used 8 bits
    for the pxm field in cpu_affinity, but 32 bits in mem_affinity.
    This patch makes it consistent: Either use 8 bits consistently (SRAT
    rev 1 or lower) or 32 bits (SRAT rev 2 or higher).

    cc: x86@kernel.org
    Signed-off-by: Kurt Garloff
    Signed-off-by: Len Brown
    Signed-off-by: Greg Kroah-Hartman

    Kurt Garloff
     
  • commit 8df0eb7c9d96f9e82f233ee8b74e0f0c8471f868 upstream.

    In SRAT v1, we had 8bit proximity domain (PXM) fields; SRAT v2 provides
    32bits for these. The new fields were reserved before.
    According to the ACPI spec, the OS must disregrard reserved fields.
    In order to know whether or not, we must know what version the SRAT
    table has.

    This patch stores the SRAT table revision for later consumption
    by arch specific __init functions.

    Signed-off-by: Kurt Garloff
    Signed-off-by: Len Brown
    Signed-off-by: Greg Kroah-Hartman

    Kurt Garloff
     
  • commit 39a74fdedd1c1461d6fb6d330b5266886513c98f upstream.

    smp_call_function() only lets all other CPUs execute a specific function,
    while we expect all CPUs do in intel_idle. Without the fix, we could have
    one cpu which has auto_demotion enabled or has no broadcast timer setup.
    Usually we don't see impact because auto demotion just harms power and the
    intel_idle init is called in CPU 0, where boradcast timer delivers
    interrupt, but this still could be a problem.

    Signed-off-by: Shaohua Li
    Signed-off-by: Andrew Morton
    Signed-off-by: Len Brown
    Signed-off-by: Greg Kroah-Hartman

    Shaohua Li
     
  • commit 5c2a9f06a9cd7194f884cdc88144866235dec07d upstream.

    kvm -cpu host passes the original cpuid info to the guest.

    Latest kvm version seem to return true for mwait_leaf cpuid
    function on recent Intel CPUs. But it does not return mwait
    C-states (mwait_substates), instead zero is returned.

    While real CPUs seem to always return non-zero values, the intel
    idle driver should not get active in kvm (mwait_substates == 0)
    case and bail out.
    Otherwise a Null pointer exception will happen later when the
    cpuidle subsystem tries to get active:
    [0.984807] BUG: unable to handle kernel NULL pointer dereference at (null)
    [0.984807] IP: [] (null)
    ...
    [0.984807][] ? cpuidle_idle_call+0xb4/0x340
    [0.984807][] ? __atomic_notifier_call_chain+0x4c/0x70
    [0.984807][] ? cpu_idle+0x78/0xd0

    Reference:
    https://bugzilla.novell.com/show_bug.cgi?id=726296

    Signed-off-by: Thomas Renninger
    CC: Bruno Friedmann
    Signed-off-by: Len Brown
    Signed-off-by: Greg Kroah-Hartman

    Thomas Renninger
     
  • commit 25add8cf99c9ec8b8dc0acd8b9241e963fc0d29c upstream.

    TOMOYO 2.5 in Linux 3.2 and later handles Unix domain socket's address.
    Thus, tomoyo_correct_word2() needs to accept \000 as a valid character, or
    TOMOYO 2.5 cannot handle Unix domain's abstract socket address.

    Reported-by: Steven Allen
    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    Tetsuo Handa
     
  • commit ffe535edb9a9c5b4d5fe03dfa3d89a1495580f1b upstream.

    More than one user reports that changing the model from "both" to
    "dmic" makes their Internal Mic work.

    Tested-by: Martin Ling
    BugLink: https://bugs.launchpad.net/bugs/795823
    Signed-off-by: David Henningsson
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    David Henningsson
     
  • commit f0e48b6bd4e407459715240cd241ddb6b89bdf81 upstream.

    The two DACs for the front output and the surround/center/LFE/back
    outputs are wired up out of phase, so when channels are duplicated,
    their sound can cancel out each other and result in a weaker bass
    response. To fix this, reverse the polarity of the neutron flow to
    the front output.

    Reported-any-tested-by: Daniel Hill
    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Clemens Ladisch
     
  • commit b01de4fb40137fbda7530550ff0cd37171dafb0c upstream.

    Several users have reported "choppy" audio under the 3.2 kernel,
    and that changing position_fix to 1 has resolved their problem.
    The chip is an nVidia Corporation MCP89 High Definition Audio,
    [10de:0d94] (rev a2).

    BugLink: https://bugs.launchpad.net/bugs/909419
    Signed-off-by: David Henningsson
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    David Henningsson
     
  • commit e268337dfe26dfc7efd422a804dbb27977a3cccc upstream.

    Jüri Aedla reported that the /proc//mem handling really isn't very
    robust, and it also doesn't match the permission checking of any of the
    other related files.

    This changes it to do the permission checks at open time, and instead of
    tracking the process, it tracks the VM at the time of the open. That
    simplifies the code a lot, but does mean that if you hold the file
    descriptor open over an execve(), you'll continue to read from the _old_
    VM.

    That is different from our previous behavior, but much simpler. If
    somebody actually finds a load where this matters, we'll need to revert
    this commit.

    I suspect that nobody will ever notice - because the process mapping
    addresses will also have changed as part of the execve. So you cannot
    actually usefully access the fd across a VM change simply because all
    the offsets for IO would have changed too.

    Reported-by: Jüri Aedla
    Cc: Al Viro
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Linus Torvalds
     
  • commit ec8013beddd717d1740cfefb1a9b900deef85462 upstream.

    A logical volume can map to just part of underlying physical volume.
    In this case, it must be treated like a partition.

    Based on a patch from Alasdair G Kergon.

    Cc: Alasdair G Kergon
    Cc: dm-devel@redhat.com
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Paolo Bonzini
     
  • commit 0bfc96cb77224736dfa35c3c555d37b3646ef35e upstream.

    [ Changes with respect to 3.3: return -ENOTTY from scsi_verify_blk_ioctl
    and -ENOIOCTLCMD from sd_compat_ioctl. ]

    Linux allows executing the SG_IO ioctl on a partition or LVM volume, and
    will pass the command to the underlying block device. This is
    well-known, but it is also a large security problem when (via Unix
    permissions, ACLs, SELinux or a combination thereof) a program or user
    needs to be granted access only to part of the disk.

    This patch lets partitions forward a small set of harmless ioctls;
    others are logged with printk so that we can see which ioctls are
    actually sent. In my tests only CDROM_GET_CAPABILITY actually occurred.
    Of course it was being sent to a (partition on a) hard disk, so it would
    have failed with ENOTTY and the patch isn't changing anything in
    practice. Still, I'm treating it specially to avoid spamming the logs.

    In principle, this restriction should include programs running with
    CAP_SYS_RAWIO. If for example I let a program access /dev/sda2 and
    /dev/sdb, it still should not be able to read/write outside the
    boundaries of /dev/sda2 independent of the capabilities. However, for
    now programs with CAP_SYS_RAWIO will still be allowed to send the
    ioctls. Their actions will still be logged.

    This patch does not affect the non-libata IDE driver. That driver
    however already tests for bd != bd->bd_contains before issuing some
    ioctl; it could be restricted further to forbid these ioctls even for
    programs running with CAP_SYS_ADMIN/CAP_SYS_RAWIO.

    Cc: linux-scsi@vger.kernel.org
    Cc: Jens Axboe
    Cc: James Bottomley
    Signed-off-by: Paolo Bonzini
    [ Make it also print the command name when warning - Linus ]
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Paolo Bonzini
     
  • commit 577ebb374c78314ac4617242f509e2f5e7156649 upstream.

    Introduce a wrapper around scsi_cmd_ioctl that takes a block device.

    The function will then be enhanced to detect partition block devices
    and, in that case, subject the ioctls to whitelisting.

    Cc: linux-scsi@vger.kernel.org
    Cc: Jens Axboe
    Cc: James Bottomley
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Paolo Bonzini
     
  • commit c3e0ef9a298e028a82ada28101ccd5cf64d209ee upstream.

    For 32-bit architectures using standard jiffies the idletime calculation
    in uptime_proc_show will quickly overflow. It takes (2^32 / HZ) seconds
    of idle-time, or e.g. 12.45 days with no load on a quad-core with HZ=1000.
    Switch to 64-bit calculations.

    Cc: Michael Abbott
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Greg Kroah-Hartman

    Martin Schwidefsky
     
  • commit 11576c6114c3b6505aea2e0c988bedb856a0e20c upstream.

    This patch adds support for the Xiroku Inc. panels (SPX/MPX/CSR/etc.).

    Signed-off-by: Masatoshi Hoshikawa
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Masatoshi Hoshikawa
     
  • commit c4fad877cd0efb51d8180ae2eaa791c99c92051c upstream.

    Signed-off-by: Benjamin Tissoires
    Acked-by: Henrik Rydberg
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Tissoires
     
  • commit b105712469d957cf1ab223c1ea72b7ba88edb926 upstream.

    Signed-off-by: Benjamin Tissoires
    Acked-by: Henrik Rydberg
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Tissoires
     
  • commit 545803651da8dde248eeb8ce3ed1e547e9e4ac0a upstream.

    Signed-off-by: Benjamin Tissoires
    Acked-by: Henrik Rydberg
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Tissoires
     
  • commit 66f06127f34ad6e8a1b24a2c03144b694d19f99f upstream.

    Just another eGalax device.
    Please note that adding this device to have_special_driver
    in hid-core.c is not required anymore.

    Signed-off-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Tissoires
     
  • commit bb9ff21072043634f147c05ac65dbf8185d4af6d upstream.

    This patch adds USB ID for the touchpanel in Acer Iconia W500. The panel
    supports up to five fingers, therefore the need for a new addition of panel
    types.

    Signed-off-by: Marek Vasut
    Signed-off-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Marek Vasut
     
  • commit e36f690b37945e0a9bb1554e1546eeec93f7d1f6 upstream.

    This is just a renaming of USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH{N}
    to USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_{PID} to handle more eGalax
    devices.

    Signed-off-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Tissoires
     
  • commit 1fd8f047490dd0ec4e4db710fcbc1bd4798d944c upstream.

    This allows ASUS Eee Slate touchscreens to work.

    Signed-off-by: Chris Bagwell
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Chris Bagwell
     
  • commit e76aadc572288a158ae18ae1c10fe395c7bca066 upstream.

    Backport note:
    This patch it's a full revert of commit b23b025f "mac80211: Optimize
    scans on current operating channel.". On upstrem revert e76aadc5 we
    keep some bits from that commit, which are needed for upstream version
    of mac80211.

    The on-channel work optimisations have caused a
    number of issues, and the code is unfortunately
    very complex and almost impossible to follow.
    Instead of attempting to put in more workarounds
    let's just remove those optimisations, we can
    work on them again later, after we change the
    whole auth/assoc design.

    This should fix rate_control_send_low() warnings,
    see RH bug 731365.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville
    Signed-off-by: Stanislaw Gruszka
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • commit 74a6eeb44ca6174d9cc93b9b8b4d58211c57bc80 upstream.

    One bio can have at most BIO_MAX_PAGES pages. We should limit it bec otherwise
    bio_alloc will fail when there are many pages in one read/write_pagelist.

    Signed-off-by: Peng Tao
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    Peng Tao
     
  • commit 93a3844ee0f843b05a1df4b52e1a19ff26b98d24 upstream.

    bl_free_block_dev() may sleep. We can not call it with spinlock held.
    Besides, there is no need to take bm_lock as we are last user freeing bm_devlist.

    Signed-off-by: Peng Tao
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    Peng Tao
     
  • commit 39e567ae36fe03c2b446e1b83ee3d39bea08f90b upstream.

    When calling _add_entry, we should take the im_lock to protect
    agains other modifiers.

    Signed-off-by: Peng Tao
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    Peng Tao
     
  • commit eaf5f9073533cde21c7121c136f1c3f072d9cf59 upstream.

    Two (or more) concurrent calls of shrink_dcache_parent() on the same dentry may
    cause shrink_dcache_parent() to loop forever.

    Here's what appears to happen:

    1 - CPU0: select_parent(P) finds C and puts it on dispose list, returns 1

    2 - CPU1: select_parent(P) locks P->d_lock

    3 - CPU0: shrink_dentry_list() locks C->d_lock
    dentry_kill(C) tries to lock P->d_lock but fails, unlocks C->d_lock

    4 - CPU1: select_parent(P) locks C->d_lock,
    moves C from dispose list being processed on CPU0 to the new
    dispose list, returns 1

    5 - CPU0: shrink_dentry_list() finds dispose list empty, returns

    6 - Goto 2 with CPU0 and CPU1 switched

    Basically select_parent() steals the dentry from shrink_dentry_list() and thinks
    it found a new one, causing shrink_dentry_list() to think it's making progress
    and loop over and over.

    One way to trigger this is to make udev calls stat() on the sysfs file while it
    is going away.

    Having a file in /lib/udev/rules.d/ with only this one rule seems to the trick:

    ATTR{vendor}=="0x8086", ATTR{device}=="0x10ca", ENV{PCI_SLOT_NAME}="%k", ENV{MATCHADDR}="$attr{address}", RUN+="/bin/true"

    Then execute the following loop:

    while true; do
    echo -bond0 > /sys/class/net/bonding_masters
    echo +bond0 > /sys/class/net/bonding_masters
    echo -bond1 > /sys/class/net/bonding_masters
    echo +bond1 > /sys/class/net/bonding_masters
    done

    One fix would be to check all callers and prevent concurrent calls to
    shrink_dcache_parent(). But I think a better solution is to stop the
    stealing behavior.

    This patch adds a new dentry flag that is set when the dentry is added to the
    dispose list. The flag is cleared in dentry_lru_del() in case the dentry gets a
    new reference just before being pruned.

    If the dentry has this flag, select_parent() will skip it and let
    shrink_dentry_list() retry pruning it. With select_parent() skipping those
    dentries there will not be the appearance of progress (new dentries found) when
    there is none, hence shrink_dcache_parent() will not loop forever.

    Set the flag is also set in prune_dcache_sb() for consistency as suggested by
    Linus.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Al Viro
    Signed-off-by: Greg Kroah-Hartman

    Miklos Szeredi
     
  • commit b48f03b319ba78f3abf9a7044d1f436d8d90f4f9 upstream.

    select_parent currently abuses the dentry cache LRU to provide
    cleanup features for child dentries that need to be freed. It moves
    them to the tail of the LRU, then tells shrink_dcache_parent() to
    calls __shrink_dcache_sb to unconditionally move them to a dispose
    list (as DCACHE_REFERENCED is ignored). __shrink_dcache_sb() has to
    relock the dentries to move them off the LRU onto the dispose list,
    but otherwise does not touch the dentries that select_parent() moved
    to the tail of the LRU. It then passses the dispose list to
    shrink_dentry_list() which tries to free the dentries.

    IOWs, the use of __shrink_dcache_sb() is superfluous - we can build
    exactly the same list of dentries for disposal directly in
    select_parent() and call shrink_dentry_list() instead of calling
    __shrink_dcache_sb() to do that. This means that we avoid long holds
    on the lru lock walking the LRU moving dentries to the dispose list
    We also avoid the need to relock each dentry just to move it off the
    LRU, reducing the numebr of times we lock each dentry to dispose of
    them in shrink_dcache_parent() from 3 to 2 times.

    Further, we remove one of the two callers of __shrink_dcache_sb().
    This also means that __shrink_dcache_sb can be moved into back into
    prune_dcache_sb() and we no longer have to handle referenced
    dentries conditionally, simplifying the code.

    Signed-off-by: Dave Chinner
    Signed-off-by: Linus Torvalds
    Signed-off-by: Al Viro
    Signed-off-by: Greg Kroah-Hartman

    Dave Chinner
     
  • commit 806e23e95f94a27ee445022d724060b9b45cb64a upstream.

    There is a potential integer overflow in uvc_ioctl_ctrl_map(). When a
    large xmap->menu_count is passed from the userspace, the subsequent call
    to kmalloc() will allocate a buffer smaller than expected.
    map->menu_count and map->menu_info would later be used in a loop (e.g.
    in uvc_query_v4l2_ctrl), which leads to out-of-bound access.

    The patch checks the ioctl argument and returns -EINVAL for zero or too
    large values in xmap->menu_count.

    Signed-off-by: Haogang Chen
    [laurent.pinchart@ideasonboard.com Prevent excessive memory consumption]
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Haogang Chen
     
  • commit 2e885057b7f75035f0b85e02f737891482815a81 upstream.

    In ELF64, the sh_flags field is 64-bits wide. recordmcount was
    erroneously treating it as a 32-bit wide field. For little endian
    objects this works because the flags of interest (SHF_EXECINSTR)
    reside in the lower 32 bits of the word, and you get the same result
    with either a 32-bit or 64-bit read. Big endian objects on the
    other hand do not work at all with this error.

    The fix: Correctly treat sh_flags as 64-bits wide in elf64 objects.

    The symptom I observed was that my
    __start_mcount_loc..__stop_mcount_loc was empty even though ftrace
    function tracing was enabled.

    Link: http://lkml.kernel.org/r/1324345362-12230-1-git-send-email-ddaney.cavm@gmail.com

    Signed-off-by: David Daney
    Signed-off-by: Steven Rostedt
    Signed-off-by: Greg Kroah-Hartman

    David Daney