15 Nov, 2014

40 commits

  • Greg Kroah-Hartman
     
  • commit abe5f972912d086c080be4bde67750630b6fb38b upstream.

    The zone allocation batches can easily underflow due to higher-order
    allocations or spills to remote nodes. On SMP that's fine, because
    underflows are expected from concurrency and dealt with by returning 0.
    But on UP, zone_page_state will just return a wrapped unsigned long,
    which will get past the
    Reported-by: Leon Romanovsky
    Signed-off-by: Johannes Weiner
    Acked-by: Mel Gorman
    Cc: [3.12+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Johannes Weiner
     
  • commit 6e5aafb27419f32575b27ef9d6a31e5d54661aca upstream.

    If we hit any errors in btrfs_lookup_csums_range, we'll loop through all
    the csums we allocate and free them. But the code was using list_entry
    incorrectly, and ended up trying to free the on-stack list_head instead.

    This bug came from commit 0678b6185

    btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range()

    Signed-off-by: Chris Mason
    Reported-by: Erik Berg
    Signed-off-by: Greg Kroah-Hartman

    Chris Mason
     
  • commit a87fa1d81a9fb5e9adca9820e16008c40ad09f33 upstream.

    The string property read helpers will run off the end of the buffer if
    it is handed a malformed string property. Rework the parsers to make
    sure that doesn't happen. At the same time add new test cases to make
    sure the functions behave themselves.

    The original implementations of of_property_read_string_index() and
    of_property_count_strings() both open-coded the same block of parsing
    code, each with it's own subtly different bugs. The fix here merges
    functions into a single helper and makes the original functions static
    inline wrappers around the helper.

    One non-bugfix aspect of this patch is the addition of a new wrapper,
    of_property_read_string_array(). The new wrapper is needed by the
    device_properties feature that Rafael is working on and planning to
    merge for v3.19. The implementation is identical both with and without
    the new static inline wrapper, so it just got left in to reduce the
    churn on the header file.

    Signed-off-by: Grant Likely
    Cc: Rafael J. Wysocki
    Cc: Mika Westerberg
    Cc: Rob Herring
    Cc: Arnd Bergmann
    Cc: Darren Hart
    Signed-off-by: Greg Kroah-Hartman

    Grant Likely
     
  • commit e4a60d139060975eb956717e4f63ae348d4d8cc5 upstream.

    There is a race condition when removing glue directory.
    It can be reproduced in following test:

    path 1: Add first child device
    device_add()
    get_device_parent()
    /*find parent from glue_dirs.list*/
    list_for_each_entry(k, &dev->class->p->glue_dirs.list, entry)
    if (k->parent == parent_kobj) {
    kobj = kobject_get(k);
    break;
    }
    ....
    class_dir_create_and_add()

    path2: Remove last child device under glue dir
    device_del()
    cleanup_device_parent()
    cleanup_glue_dir()
    kobject_put(glue_dir);

    If path2 has been called cleanup_glue_dir(), but not
    call kobject_put(glue_dir), the glue dir is still
    in parent's kset list. Meanwhile, path1 find the glue
    dir from the glue_dirs.list. Path2 may release glue dir
    before path1 call kobject_get(). So kernel will report
    the warning and bug_on.

    This is a "classic" problem we have of a kref in a list
    that can be found while the last instance could be removed
    at the same time.

    This patch reuse gdp_mutex to fix this race condition.

    The following calltrace is captured in kernel 3.4, but
    the latest kernel still has this bug.

    -----------------------------------------------------
    [ 3965.441471] WARNING: at ...include/linux/kref.h:41 kobject_get+0x33/0x40()
    [ 3965.441474] Hardware name: Romley
    [ 3965.441475] Modules linked in: isd_iop(O) isd_xda(O)...
    ...
    [ 3965.441605] Call Trace:
    [ 3965.441611] [] warn_slowpath_common+0x7a/0xb0
    [ 3965.441615] [] warn_slowpath_null+0x15/0x20
    [ 3965.441618] [] kobject_get+0x33/0x40
    [ 3965.441624] [] get_device_parent.isra.11+0x135/0x1f0
    [ 3965.441627] [] device_add+0xd4/0x6d0
    [ 3965.441631] [] ? dev_set_name+0x3c/0x40
    ....
    [ 3965.441912] kernel BUG at ..../fs/sysfs/group.c:65!
    [ 3965.441915] invalid opcode: 0000 [#1] SMP
    ...
    [ 3965.686743] [] sysfs_create_group+0xe/0x10
    [ 3965.686748] [] blk_trace_init_sysfs+0x14/0x20
    [ 3965.686753] [] blk_register_queue+0x3b/0x120
    [ 3965.686756] [] add_disk+0x1cc/0x490
    ....
    -------------------------------------------------------

    Signed-off-by: Yijing Wang
    Signed-off-by: Weng Meiling
    Signed-off-by: Greg Kroah-Hartman

    Yijing Wang
     
  • commit 11cfbfb098b22d3e57f1f2be217cad20e2d48463 upstream.

    iowait is for blkio [1]. I2C shouldn't use it.

    [1] https://lkml.org/lkml/2014/11/3/317

    Signed-off-by: Wolfram Sang
    Acked-by: Ludovic Desroches
    Signed-off-by: Greg Kroah-Hartman

    Wolfram Sang
     
  • commit ca0c37a0b489bb14bf3e1549e7a8d0c9a17f4919 upstream.

    Driver allocated on stack struct regulator_config but didn't initialize
    it fully. Few fields (driver_data, ena_gpio) were left untouched. This
    lead to using random ena_gpio values as GPIOs for max77693 regulators.

    On occasion these values could match real GPIO numbers leading to
    interfering with other drivers and to unsuccessful enable/disable of
    regulator.

    Signed-off-by: Krzysztof Kozlowski
    Fixes: 80b022e29bfd ("regulator: max77693: Add max77693 regualtor driver.")
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Krzysztof Kozlowski
     
  • commit 10ccaf178b2b961d8bca252d647ed7ed8aae2a20 upstream.

    In powerpc pseries platform dlpar operations, use device_online() and
    device_offline() instead of cpu_up() and cpu_down().

    Calling cpu_up/down() directly does not update the cpu device offline
    field, which is used to online/offline a cpu from sysfs. Calling
    device_online/offline() instead keeps the sysfs cpu online value
    correct. The hotplug lock, which is required to be held when calling
    device_online/offline(), is already held when dlpar_online/offline_cpu()
    are called, since they are called only from cpu_probe|release_store().

    This patch fixes errors on phyp (PowerVM) systems that have cpu(s)
    added/removed using dlpar operations; without this patch, the
    /sys/devices/system/cpu/cpuN/online nodes do not correctly show the
    online state of added/removed cpus.

    Signed-off-by: Dan Streetman
    Cc: Nathan Fontenot
    Fixes: 0902a9044fa5 ("Driver core: Use generic offline/online for CPU offline/online")
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Dan Streetman
     
  • commit d90c33818967c5e5371961604ad98b4dea4fa3f4 upstream.

    Even if a gpio pin is set to output, we still need to set INPUT_EN
    functionality (by clearing INPUT_EN bit) to be able to read the pin's
    level.

    E.g. without this change, we'll always read low level state from sysfs.

    Cc: Mathias Nyman
    Signed-off-by: David Cohen
    Reviewed-by: Felipe Balbi
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    David Cohen
     
  • commit 183fd8fcd7f8afb7ac5ec68f83194872f9fecc84 upstream.

    The acpi-video backlight interface on the Acer KAV80 is broken, and worse
    it causes the entire machine to slow down significantly after a suspend/resume.

    Blacklist it, and use the acer-wmi backlight interface instead. Note that
    the KAV80 is somewhat unique in that it is the only Acer model where we
    fall back to acer-wmi after blacklisting, rather then using the native
    (e.g. intel) backlight driver. This is done because there is no native
    backlight interface on this model.

    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1128309
    Signed-off-by: Hans de Goede
    Signed-off-by: Darren Hart
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • commit a8d4205623ae965e36c68629db306ca0695a2771 upstream.

    When we fail to allocate page vector in rbd_obj_read_sync() we just
    basically ignore the problem and continue which will result in an oops
    later. Fix the problem by returning proper error.

    CC: Yehuda Sadeh
    CC: Sage Weil
    CC: ceph-devel@vger.kernel.org
    Coverity-id: 1226882
    Signed-off-by: Jan Kara
    Signed-off-by: Ilya Dryomov
    Signed-off-by: Greg Kroah-Hartman

    Jan Kara
     
  • commit 8c3e434769b1707fd2d24de5a2eb25fedc634c4a upstream.

    0x4c6e is a secondary device id so should not be used
    by the driver.

    Noticed-by: Mark Kettenis
    Signed-off-by: Alex Deucher
    Signed-off-by: Greg Kroah-Hartman

    Alex Deucher
     
  • commit 6fa455935ab956248b165f150ec6ae9106210077 upstream.

    Causes problems on some boards.

    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=82889

    Signed-off-by: Alex Deucher
    Signed-off-by: Greg Kroah-Hartman

    Alex Deucher
     
  • commit 9a72384d86b26cb8a2b25106677e1197f606668f upstream.

    When screen objects are enabled, the bpp is assumed to be 32, otherwise
    it is set to 16.

    v2:
    * Use u32 instead of u64 for assumed_bpp.
    * Fixed mechanism to check for screen objects
    * Limit the back buffer size to VRAM.

    Signed-off-by: Sinclair Yeh
    Reviewed-by: Thomas Hellstrom
    Signed-off-by: Greg Kroah-Hartman

    Sinclair Yeh
     
  • commit f1e3a0932f3a9554371792a7daaf1e0eb19f66d5 upstream.

    Probability of use-after-free isn't zero in this place.

    Signed-off-by: Kirill Tkhai
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Paul E. McKenney
    Cc: Linus Torvalds
    Link: http://lkml.kernel.org/r/20140922183636.11015.83611.stgit@localhost
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Kirill Tkhai
     
  • [ Upstream commit a3058a5d82e296daaca07411c3738a9ddd79f302 ]

    During FunctionFS bind, ffs_data_get() function was called twice
    (in functionfs_bind() and in ffs_do_functionfs_bind()), while on unbind
    ffs_data_put() was called once (in functionfs_unbind() function).
    In result refcount never reached value 0, and ffs memory resources has
    been never released.

    Since ffs_data_get() call in ffs_do_functionfs_bind() is redundant
    and not neccessary, we remove it to have equal number of gets ans puts,
    and free allocated memory after refcount reach 0.

    Fixes: 5920cda (usb: gadget: FunctionFS: convert to new function
    interface with backward compatibility)
    Signed-off-by: Robert Baldyga
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Robert Baldyga
     
  • [ Upstream commit bfa6b18c680450c17512c741ed1d818695747621 ]

    Currently, there's no guarantee that udc->driver
    will be valid when using soft_connect sysfs
    interface. In fact, we can very easily trigger
    a NULL pointer dereference by trying to disconnect
    when a gadget driver isn't loaded.

    Fix this bug:

    ~# echo disconnect > soft_connect
    [ 33.685743] Unable to handle kernel NULL pointer dereference at virtual address 00000014
    [ 33.694221] pgd = ed0cc000
    [ 33.697174] [00000014] *pgd=ae351831, *pte=00000000, *ppte=00000000
    [ 33.703766] Internal error: Oops: 17 [#1] SMP ARM
    [ 33.708697] Modules linked in: xhci_plat_hcd xhci_hcd snd_soc_davinci_mcasp snd_soc_tlv320aic3x snd_soc_edma snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd lis3lv02d_i2c matrix_keypad lis3lv02d dwc3_omap input_polldev soundcore
    [ 33.734372] CPU: 0 PID: 1457 Comm: bash Not tainted 3.17.0-09740-ga93416e-dirty #345
    [ 33.742457] task: ee71ce00 ti: ee68a000 task.ti: ee68a000
    [ 33.748116] PC is at usb_udc_softconn_store+0xa4/0xec
    [ 33.753416] LR is at mark_held_locks+0x78/0x90
    [ 33.758057] pc : [] lr : [] psr: 20000013
    [ 33.758057] sp : ee68bec8 ip : c0c00008 fp : ee68bee4
    [ 33.770050] r10: ee6b394c r9 : ee68bf80 r8 : ee6062c0
    [ 33.775508] r7 : 00000000 r6 : ee6062c0 r5 : 0000000b r4 : ee739408
    [ 33.782346] r3 : 00000000 r2 : 00000000 r1 : ee71d390 r0 : ee664170
    [ 33.789168] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    [ 33.796636] Control: 10c5387d Table: ad0cc059 DAC: 00000015
    [ 33.802638] Process bash (pid: 1457, stack limit = 0xee68a248)
    [ 33.808740] Stack: (0xee68bec8 to 0xee68c000)
    [ 33.813299] bec0: 0000000b c0411284 ee6062c0 00000000 ee68bef4 ee68bee8
    [ 33.821862] bee0: c04112ac c04df090 ee68bf14 ee68bef8 c01c2868 c0411290 0000000b ee6b3940
    [ 33.830419] bf00: 00000000 00000000 ee68bf4c ee68bf18 c01c1a24 c01c2818 00000000 00000000
    [ 33.838990] bf20: ee61b940 ee2f47c0 0000000b 000ce408 ee68bf80 c000f304 ee68a000 00000000
    [ 33.847544] bf40: ee68bf7c ee68bf50 c0152dd8 c01c1960 ee68bf7c c0170af8 ee68bf7c ee2f47c0
    [ 33.856099] bf60: ee2f47c0 000ce408 0000000b c000f304 ee68bfa4 ee68bf80 c0153330 c0152d34
    [ 33.864653] bf80: 00000000 00000000 0000000b 000ce408 b6e7fb50 00000004 00000000 ee68bfa8
    [ 33.873204] bfa0: c000f080 c01532e8 0000000b 000ce408 00000001 000ce408 0000000b 00000000
    [ 33.881763] bfc0: 0000000b 000ce408 b6e7fb50 00000004 0000000b 00000000 000c5758 00000000
    [ 33.890319] bfe0: 00000000 bec2c924 b6de422d b6e1d226 40000030 00000001 75716d2f 00657565
    [ 33.898890] [] (usb_udc_softconn_store) from [] (dev_attr_store+0x28/0x34)
    [ 33.907920] [] (dev_attr_store) from [] (sysfs_kf_write+0x5c/0x60)
    [ 33.916200] [] (sysfs_kf_write) from [] (kernfs_fop_write+0xd0/0x194)
    [ 33.924773] [] (kernfs_fop_write) from [] (vfs_write+0xb0/0x1bc)
    [ 33.932874] [] (vfs_write) from [] (SyS_write+0x54/0xb0)
    [ 33.940247] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x48)
    [ 33.948160] Code: e1a01007 e12fff33 e5140004 e5143008 (e5933014)
    [ 33.954625] ---[ end trace f849bead94eab7ea ]---

    Fixes: 2ccea03 (usb: gadget: introduce UDC Class)
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Felipe Balbi
     
  • [ Upstream commit 52ec49a5e56a27c5b6f8217708783eff39f24c16 ]

    During Halt Endpoint Test, our interrupt endpoint
    will be disabled, which will clear out ep->desc
    to NULL. Unless we call config_ep_by_speed() again,
    we will not be able to enable this endpoint which
    will make us fail that test.

    Fixes: f9c56cd (usb: gadget: Clear usb_endpoint_descriptor
    inside the struct usb_ep on disable)
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Felipe Balbi
     
  • [ Upstream commit 7a60855972f0d3c014093046cb6f013a1ee5bb19 ]

    According to our Gadget Framework API documentation,
    ->set_halt() *must* return -EAGAIN if we have pending
    transfers (on either direction) or FIFO isn't empty (on
    TX endpoints).

    Fix this bug so that the mass storage gadget can be used
    without stall=0 parameter.

    This patch should be backported to all kernels since v3.2.

    Suggested-by: Alan Stern
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Felipe Balbi
     
  • commit e2cffb5f493a8b431dc87124388ea59b79f0bccb upstream.

    On archs with PAGE_SIZE >= 64 KiB the function skcipher_alloc_sgl()
    fails with -ENOMEM no matter what user space actually requested.
    This is caused by the fact sock_kmalloc call inside the function tried
    to allocate more memory than allowed by the default kernel socket buffer
    size (kernel param net.core.optmem_max).

    Signed-off-by: Ondrej Kozina
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Ondrej Kozina
     
  • commit f55fefd1a5a339b1bd08c120b93312d6eb64a9fb upstream.

    The WARN_ON checking whether i_mutex is held in
    pagecache_isize_extended() was wrong because some filesystems (e.g.
    XFS) use different locks for serialization of truncates / writes. So
    just remove the check.

    Signed-off-by: Jan Kara
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner
    Signed-off-by: Greg Kroah-Hartman

    Jan Kara
     
  • commit b47dcbdc5161d3d5756f430191e2840d9b855492 upstream.

    If the TSC is unusable or disabled, then this patch fixes:

    - Confusion while trying to clear old APIC interrupts.
    - Division by zero and incorrect programming of the TSC deadline
    timer.

    This fixes boot if the CPU has a TSC deadline timer but a missing or
    broken TSC. The failure to boot can be observed with qemu using
    -cpu qemu64,-tsc,+tsc-deadline

    This also happens to me in nested KVM for unknown reasons.
    With this patch, I can boot cleanly (although without a TSC).

    Signed-off-by: Andy Lutomirski
    Cc: Bandan Das
    Link: http://lkml.kernel.org/r/e2fa274e498c33988efac0ba8b7e3120f7f92d78.1413393027.git.luto@amacapital.net
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Andy Lutomirski
     
  • commit 6891c4509c792209c44ced55a60f13954cb50ef4 upstream.

    If userland creates a timer without specifying a sigevent info, we'll
    create one ourself, using a stack local variable. Particularly will we
    use the timer ID as sival_int. But as sigev_value is a union containing
    a pointer and an int, that assignment will only partially initialize
    sigev_value on systems where the size of a pointer is bigger than the
    size of an int. On such systems we'll copy the uninitialized stack bytes
    from the timer_create() call to userland when the timer actually fires
    and we're going to deliver the signal.

    Initialize sigev_value with 0 to plug the stack info leak.

    Found in the PaX patch, written by the PaX Team.

    Fixes: 5a9fa7307285 ("posix-timers: kill ->it_sigev_signo and...")
    Signed-off-by: Mathias Krause
    Cc: Oleg Nesterov
    Cc: Brad Spengler
    Cc: PaX Team
    Link: http://lkml.kernel.org/r/1412456799-32339-1-git-send-email-minipli@googlemail.com
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Mathias Krause
     
  • commit c7abf25af0f41be4b50d44c5b185d52eea360cb8 upstream.

    It affects non-(V)HT rates and can lead to selecting an rts_cts rate
    that is not a basic rate or way superior to the reference rate (ATM
    rates[0] used for the 1st attempt of the protected frame data).

    E.g, assuming drivers register growing (bitrate) sorted tables of
    ieee80211_rate-s, having :
    - rates[0].idx == d'2 and basic_rates == b'10100
    will select rts_cts idx b'10011 & ~d'(BIT(2)-1), i.e. 1, likewise
    - rates[0].idx == d'2 and basic_rates == b'10001
    will select rts_cts idx b'10000
    The first is not a basic rate and the second is > rates[0].

    Also, wrt severity of the addressed misbehavior, ATM we only have one
    rts_cts_rate_idx rather than one per rate table entry, so this idx might
    still point to bitrates > rates[1..MAX_RATES].

    Fixes: 5253ffb8c9e1 ("mac80211: always pick a basic rate to tx RTS/CTS for pre-HT rates")
    Signed-off-by: Karl Beldan
    Signed-off-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Karl Beldan
     
  • commit 94fb823fcb4892614f57e59601bb9d4920f24711 upstream.

    If a device's dev_pm_ops::freeze callback fails during the QUIESCE
    phase, we don't rollback things correctly calling the thaw and complete
    callbacks. This could leave some devices in a suspended state in case of
    an error during resuming from hibernation.

    Signed-off-by: Imre Deak
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Imre Deak
     
  • commit 37b164578826406a173ca7c20d9ba7430134d23e upstream.

    Kernel oops can cause the tty to be unreleaseable (for example, if
    n_tty_read() crashes while on the read_wait queue). This will cause
    tty_release() to endlessly loop without sleeping.

    Use a killable sleep timeout which grows by 2n+1 jiffies over the interval
    [0, 120 secs.) and then jumps to forever (but still killable).

    NB: killable just allows for the task to be rewoken manually, not
    to be terminated.

    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     
  • commit 5ef828c4152726f56751c78ea844f08d2b2a4fa3 upstream.

    The commit

    83e782e xfs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD

    added a new function xfs_sb_quota_from_disk() which swaps
    on-disk XFS_OQUOTA_* flags for in-core XFS_GQUOTA_* and XFS_PQUOTA_*
    flags after the superblock is read.

    However, if log recovery is required, the superblock is read again,
    and the modified in-core flags are re-read from disk, so we have
    XFS_OQUOTA_* flags in memory again. This causes the
    XFS_QM_NEED_QUOTACHECK() test to be true, because the XFS_OQUOTA_CHKD
    is still set, and not XFS_GQUOTA_CHKD or XFS_PQUOTA_CHKD.

    Change xfs_sb_from_disk to call xfs_sb_quota_from disk and always
    convert the disk flags to in-memory flags.

    Add a lower-level function which can be called with "false" to
    not convert the flags, so that the sb verifier can verify
    exactly what was on disk, per Brian Foster's suggestion.

    Reported-by: Cyril B.
    Signed-off-by: Eric Sandeen
    Cc: Arkadiusz Miśkiewicz
    Signed-off-by: Greg Kroah-Hartman

    Eric Sandeen
     
  • commit 474d2605d119479e5aa050f738632e63589d4bb5 upstream.

    Due to a switched left and right side of an assignment,
    dquot_writeback_dquots() never returned error. This could result in
    errors during quota writeback to not be reported to userspace properly.
    Fix it.

    Coverity-id: 1226884
    Signed-off-by: Jan Kara
    Signed-off-by: Greg Kroah-Hartman

    Jan Kara
     
  • commit d8e7d53a2fc14e0830ab728cb84ee19933d3ac8d upstream.

    Back in commit 5136b2da770d ("PCI: convert bus code to use dev_groups"),
    I misstyped the 'enable' sysfs filename as 'enabled', which broke the
    userspace API. This patch fixes that issue by renaming the file back.

    Fixes: 5136b2da770d ("PCI: convert bus code to use dev_groups")
    Reported-by: Jeff Epler
    Tested-by: Jeff Epler # on v3.14-rt
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Bjorn Helgaas

    Greg Kroah-Hartman
     
  • commit 7938db449bbc55bbeb164bec7af406212e7e98f1 upstream.

    The check whether quota format is set even though there are no
    quota files with journalled quota is pointless and it actually
    makes it impossible to turn off journalled quotas (as there's
    no way to unset journalled quota format). Just remove the check.

    Signed-off-by: Jan Kara
    Signed-off-by: Greg Kroah-Hartman

    Jan Kara
     
  • commit 1ffde699aae127e7abdb98dbdedc2cc6a973a1a1 upstream.

    This reverts commit aa11bbf3df026d6b1c6b528bef634fd9de7c2619.
    This commit was causing connection issues and is not needed
    if IWL_MVM_RS_RSSI_BASED_INIT_RATE is set to false by default.

    Regardless of the issues mentioned above, this patch added the
    following WARNING:

    WARNING: CPU: 0 PID: 3946 at drivers/net/wireless/iwlwifi/mvm/tx.c:190 iwl_mvm_set_tx_params+0x60a/0x6f0 [iwlmvm]()
    Got an HT rate for a non data frame 0x8
    CPU: 0 PID: 3946 Comm: wpa_supplicant Tainted: G O 3.17.0+ #6
    Hardware name: LENOVO 20ANCTO1WW/20ANCTO1WW, BIOS GLET71WW (2.25 ) 07/02/2014
    0000000000000009 ffffffff814fa911 ffff8804288db8f8 ffffffff81064f52
    0000000000001808 ffff8804288db948 ffff88040add8660 ffff8804291b5600
    0000000000000000 ffffffff81064fb7 ffffffffa07b73d0 0000000000000020
    Call Trace:
    [] ? dump_stack+0x41/0x51
    [] ? warn_slowpath_common+0x72/0x90
    [] ? warn_slowpath_fmt+0x47/0x50
    [] ? iwl_mvm_set_tx_params+0x60a/0x6f0 [iwlmvm]
    [] ? iwl_mvm_tx_skb+0x48/0x3c0 [iwlmvm]
    [] ? iwl_mvm_mac_tx+0x7b/0x180 [iwlmvm]
    [] ? __ieee80211_tx+0x2b9/0x3c0 [mac80211]
    [] ? ieee80211_tx+0xb3/0x100 [mac80211]
    [] ? ieee80211_subif_start_xmit+0x459/0xca0 [mac80211]
    [] ? dev_hard_start_xmit+0x337/0x5f0
    [] ? sch_direct_xmit+0x96/0x1f0
    [] ? __dev_queue_xmit+0x203/0x4f0
    [] ? ether_setup+0x70/0x70
    [] ? packet_sendmsg+0xf81/0x1110
    [] ? skb_free_datagram+0xc/0x40
    [] ? sock_sendmsg+0x88/0xc0
    [] ? move_addr_to_kernel.part.20+0x14/0x60
    [] ? __inode_wait_for_writeback+0x62/0xb0
    [] ? SYSC_sendto+0xf1/0x180
    [] ? __sys_recvmsg+0x39/0x70
    [] ? system_call_fastpath+0x1a/0x1f
    ---[ end trace cc19a150d311fc63 ]---

    which was reported here: https://bugzilla.kernel.org/show_bug.cgi?id=85691

    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Greg Kroah-Hartman

    Emmanuel Grumbach
     
  • commit 51904b08072a8bf2b9ed74d1bd7a5300a614471d upstream.

    Unknown operation numbers are caught in nfsd4_decode_compound() which
    sets op->opnum to OP_ILLEGAL and op->status to nfserr_op_illegal. The
    error causes the main loop in nfsd4_proc_compound() to skip most
    processing. But nfsd4_proc_compound also peeks ahead at the next
    operation in one case and doesn't take similar precautions there.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Greg Kroah-Hartman

    J. Bruce Fields
     
  • commit fa19ac4b92bc2b5024af3e868f41f81fa738567a upstream.

    Fix UE event being reported as HW_EVENT_ERR_CORRECTED.

    Signed-off-by: Jason Baron
    Link: http://lkml.kernel.org/r/8beb13803500076fef827eab33d523e355d83759.1413405053.git.jbaron@akamai.com
    Signed-off-by: Borislav Petkov
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     
  • commit 8030122a9ccf939186f8db96c318dbb99b5463f6 upstream.

    Fix CE event being reported as HW_EVENT_ERR_UNCORRECTED.

    Signed-off-by: Jason Baron
    Link: http://lkml.kernel.org/r/e6dd616f2cd51583a7e77af6f639b86313c74144.1413405053.git.jbaron@akamai.com
    Signed-off-by: Borislav Petkov
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     
  • commit 8a3f075d6c9b3612b4a5fb2af8db82b38b20caf0 upstream.

    Fix CE event being reported as HW_EVENT_ERR_UNCORRECTED.

    Signed-off-by: Jason Baron
    Link: http://lkml.kernel.org/r/d02465b4f30314b390c12c061502eda5e9d29c52.1413405053.git.jbaron@akamai.com
    Signed-off-by: Borislav Petkov
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     
  • commit ab0543de6ff0877474f57a5aafbb51a61e88676f upstream.

    Fix CE event being reported as HW_EVENT_ERR_UNCORRECTED.

    Signed-off-by: Jason Baron
    Link: http://lkml.kernel.org/r/7aee8e244a32ff86b399a8f966c4aae70296aae0.1413405053.git.jbaron@akamai.com
    Signed-off-by: Borislav Petkov
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     
  • commit 84ce0f0e94ac97217398b3b69c21c7a62ebeed05 upstream.

    When sg_scsi_ioctl() fails to prepare request to submit in
    blk_rq_map_kern() we jump to a label where we just end up copying
    (luckily zeroed-out) kernel buffer to userspace instead of reporting
    error. Fix the problem by jumping to the right label.

    CC: Jens Axboe
    CC: linux-scsi@vger.kernel.org
    Coverity-id: 1226871
    Signed-off-by: Jan Kara
    Signed-off-by: Greg Kroah-Hartman

    Fixed up the, now unused, out label.

    Signed-off-by: Jens Axboe

    Jan Kara
     
  • commit ea5d05b34aca25c066e0699512d0ffbd8ee6ac3e upstream.

    If __bitmap_shift_left() or __bitmap_shift_right() are asked to shift by
    a multiple of BITS_PER_LONG, they will try to shift a long value by
    BITS_PER_LONG bits which is undefined. Change the functions to avoid
    the undefined shift.

    Coverity id: 1192175
    Coverity id: 1192174
    Signed-off-by: Jan Kara
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Jan Kara
     
  • commit 2f7dd7a4100ad4affcb141605bef178ab98ccb18 upstream.

    The cgroup iterators yield css objects that have not yet gone through
    css_online(), but they are not complete memcgs at this point and so the
    memcg iterators should not return them. Commit d8ad30559715 ("mm/memcg:
    iteration skip memcgs not yet fully initialized") set out to implement
    exactly this, but it uses CSS_ONLINE, a cgroup-internal flag that does
    not meet the ordering requirements for memcg, and so the iterator may
    skip over initialized groups, or return partially initialized memcgs.

    The cgroup core can not reasonably provide a clear answer on whether the
    object around the css has been fully initialized, as that depends on
    controller-specific locking and lifetime rules. Thus, introduce a
    memcg-specific flag that is set after the memcg has been initialized in
    css_online(), and read before mem_cgroup_iter() callers access the memcg
    members.

    Signed-off-by: Johannes Weiner
    Cc: Tejun Heo
    Acked-by: Michal Hocko
    Cc: Hugh Dickins
    Cc: Peter Zijlstra
    Cc: [3.12+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Johannes Weiner
     
  • commit 401507d67d5c2854f5a88b3f93f64fc6f267bca5 upstream.

    Commit ff7ee93f4715 ("cgroup/kmemleak: Annotate alloc_page() for cgroup
    allocations") introduces kmemleak_alloc() for alloc_page_cgroup(), but
    corresponding kmemleak_free() is missing, which makes kmemleak be
    wrongly disabled after memory offlining. Log is pasted at the end of
    this commit message.

    This patch add kmemleak_free() into free_page_cgroup(). During page
    offlining, this patch removes corresponding entries in kmemleak rbtree.
    After that, the freed memory can be allocated again by other subsystems
    without killing kmemleak.

    bash # for x in 1 2 3 4; do echo offline > /sys/devices/system/memory/memory$x/state ; sleep 1; done ; dmesg | grep leak

    Offlined Pages 32768
    kmemleak: Cannot insert 0xffff880016969000 into the object search tree (overlaps existing)
    CPU: 0 PID: 412 Comm: sleep Not tainted 3.17.0-rc5+ #86
    Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    Call Trace:
    dump_stack+0x46/0x58
    create_object+0x266/0x2c0
    kmemleak_alloc+0x26/0x50
    kmem_cache_alloc+0xd3/0x160
    __sigqueue_alloc+0x49/0xd0
    __send_signal+0xcb/0x410
    send_signal+0x45/0x90
    __group_send_sig_info+0x13/0x20
    do_notify_parent+0x1bb/0x260
    do_exit+0x767/0xa40
    do_group_exit+0x44/0xa0
    SyS_exit_group+0x17/0x20
    system_call_fastpath+0x16/0x1b

    kmemleak: Kernel memory leak detector disabled
    kmemleak: Object 0xffff880016900000 (size 524288):
    kmemleak: comm "swapper/0", pid 0, jiffies 4294667296
    kmemleak: min_count = 0
    kmemleak: count = 0
    kmemleak: flags = 0x1
    kmemleak: checksum = 0
    kmemleak: backtrace:
    log_early+0x63/0x77
    kmemleak_alloc+0x4b/0x50
    init_section_page_cgroup+0x7f/0xf5
    page_cgroup_init+0xc5/0xd0
    start_kernel+0x333/0x408
    x86_64_start_reservations+0x2a/0x2c
    x86_64_start_kernel+0xf5/0xfc

    Fixes: ff7ee93f4715 (cgroup/kmemleak: Annotate alloc_page() for cgroup allocations)
    Signed-off-by: Wang Nan
    Acked-by: Johannes Weiner
    Acked-by: Michal Hocko
    Cc: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Wang Nan