1. 03 Jun, 2015 28 commits
    • Lukas Czerner's avatar
      ext4: fix NULL pointer dereference when journal restart fails · d9923656
      Lukas Czerner authored
      commit 9d506594 upstream.
      
      Currently when journal restart fails, we'll have the h_transaction of
      the handle set to NULL to indicate that the handle has been effectively
      aborted. We handle this situation quietly in the jbd2_journal_stop() and just
      free the handle and exit because everything else has been done before we
      attempted (and failed) to restart the journal.
      
      Unfortunately there are a number of problems with that approach
      introduced with commit
      
      41a5b913 "jbd2: invalidate handle if jbd2_journal_restart()
      fails"
      
      First of all in ext4 jbd2_journal_stop() will be called through
      __ext4_journal_stop() where we would try to get a hold of the superblock
      by dereferencing h_transaction which in this case would lead to NULL
      pointer dereference and crash.
      
      In addition we're going to free the handle regardless of the refcount
      which is bad as well, because others up the call chain will still
      reference the handle so we might potentially reference already freed
      memory.
      
      Moreover it's expected that we'll get aborted handle as well as detached
      handle in some of the journalling function as the error propagates up
      the stack, so it's unnecessary to call WARN_ON every time we get
      detached handle.
      
      And finally we might leak some memory by forgetting to free reserved
      handle in jbd2_journal_stop() in the case where handle was detached from
      the transaction (h_transaction is NULL).
      
      Fix the NULL pointer dereference in __ext4_journal_stop() by just
      calling jbd2_journal_stop() quietly as suggested by Jan Kara. Also fix
      the potential memory leak in jbd2_journal_stop() and use proper
      handle refcounting before we attempt to free it to avoid use-after-free
      issues.
      
      And finally remove all WARN_ON(!transaction) from the code so that we do
      not get random traces when something goes wrong because when journal
      restart fails we will get to some of those functions.
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d9923656
    • Ludovic Desroches's avatar
      mmc: atmel-mci: fix bad variable type for clkdiv · f52659df
      Ludovic Desroches authored
      commit 60c8f783 upstream.
      
      clkdiv is declared as an u32 but it can be set to a negative value
      causing a huge divisor value. Change its type to int to avoid this case.
      Signed-off-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f52659df
    • Anton Blanchard's avatar
      powerpc: Align TOC to 256 bytes · 57399323
      Anton Blanchard authored
      commit 5e95235c upstream.
      
      Recent toolchains force the TOC to be 256 byte aligned. We need
      to enforce this alignment in our linker script, otherwise pointers
      to our TOC variables (__toc_start, __prom_init_toc_start) could
      be incorrect.
      
      If they are bad, we die a few hundred instructions into boot.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      57399323
    • Krzysztof Opasiak's avatar
      usb: gadget: configfs: Fix interfaces array NULL-termination · 4623c6e3
      Krzysztof Opasiak authored
      commit 903124fe upstream.
      
      memset() to 0 interfaces array before reusing
      usb_configuration structure.
      
      This commit fix bug:
      
      ln -s functions/acm.1 configs/c.1
      ln -s functions/acm.2 configs/c.1
      ln -s functions/acm.3 configs/c.1
      echo "UDC name" > UDC
      echo "" > UDC
      rm configs/c.1/acm.*
      rmdir functions/*
      mkdir functions/ecm.usb0
      ln -s functions/ecm.usb0 configs/c.1
      echo "UDC name" > UDC
      
      [   82.220969] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      [   82.229009] pgd = c0004000
      [   82.231698] [00000000] *pgd=00000000
      [   82.235260] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
      [   82.240638] Modules linked in:
      [   82.243681] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.0.0-rc2 #39
      [   82.249926] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
      [   82.256003] task: c07cd2f0 ti: c07c8000 task.ti: c07c8000
      [   82.261393] PC is at composite_setup+0xe3c/0x1674
      [   82.266073] LR is at composite_setup+0xf20/0x1674
      [   82.270760] pc : [<c03510d4>]    lr : [<c03511b8>]    psr: 600001d3
      [   82.270760] sp : c07c9df0  ip : c0806448  fp : ed8c9c9c
      [   82.282216] r10: 00000001  r9 : 00000000  r8 : edaae918
      [   82.287425] r7 : ed551cc0  r6 : 00007fff  r5 : 00000000  r4 : ed799634
      [   82.293934] r3 : 00000003  r2 : 00010002  r1 : edaae918  r0 : 0000002e
      [   82.300446] Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
      [   82.307910] Control: 10c5387d  Table: 6bc1804a  DAC: 00000015
      [   82.313638] Process swapper/0 (pid: 0, stack limit = 0xc07c8210)
      [   82.319627] Stack: (0xc07c9df0 to 0xc07ca000)
      [   82.323969] 9de0:                                     00000000 c06e65f4 00000000 c07c9f68
      [   82.332130] 9e00: 00000067 c07c59ac 000003f7 edaae918 ed8c9c98 ed799690 eca2f140 200001d3
      [   82.340289] 9e20: ee79a2d8 c07c9e88 c07c5304 ffff55db 00010002 edaae810 edaae860 eda96d50
      [   82.348448] 9e40: 00000009 ee264510 00000007 c07ca444 edaae860 c0340890 c0827a40 ffff55e0
      [   82.356607] 9e60: c0827a40 eda96e40 ee264510 edaae810 00000000 edaae860 00000007 c07ca444
      [   82.364766] 9e80: edaae860 c0354170 c03407dc c033db4c edaae810 00000000 00000000 00000010
      [   82.372925] 9ea0: 00000032 c0341670 00000000 00000000 00000001 eda96e00 00000000 00000000
      [   82.381084] 9ec0: 00000000 00000032 c0803a23 ee1aa840 00000001 c005d54c 249e2450 00000000
      [   82.389244] 9ee0: 200001d3 ee1aa840 ee1aa8a0 ed84f4c0 00000000 c07c9f68 00000067 c07c59ac
      [   82.397403] 9f00: 00000000 c005d688 ee1aa840 ee1aa8a0 c07db4b4 c006009c 00000032 00000000
      [   82.405562] 9f20: 00000001 c005ce20 c07c59ac c005cf34 f002000c c07ca780 c07c9f68 00000057
      [   82.413722] 9f40: f0020000 413fc090 00000001 c00086b4 c000f804 60000053 ffffffff c07c9f9c
      [   82.421880] 9f60: c0803a20 c0011fc0 00000000 00000000 c07c9fb8 c001bee0 c07ca4f0 c057004c
      [   82.430040] 9f80: c07ca4fc c0803a20 c0803a20 413fc090 00000001 00000000 01000000 c07c9fb0
      [   82.438199] 9fa0: c000f800 c000f804 60000053 ffffffff 00000000 c0050e70 c0803bc0 c0783bd8
      [   82.446358] 9fc0: ffffffff ffffffff c0783664 00000000 00000000 c07b13e8 00000000 c0803e54
      [   82.454517] 9fe0: c07ca480 c07b13e4 c07ce40c 4000406a 00000000 40008074 00000000 00000000
      [   82.462689] [<c03510d4>] (composite_setup) from [<c0340890>] (s3c_hsotg_complete_setup+0xb4/0x418)
      [   82.471626] [<c0340890>] (s3c_hsotg_complete_setup) from [<c0354170>] (usb_gadget_giveback_request+0xc/0x10)
      [   82.481429] [<c0354170>] (usb_gadget_giveback_request) from [<c033db4c>] (s3c_hsotg_complete_request+0xcc/0x12c)
      [   82.491583] [<c033db4c>] (s3c_hsotg_complete_request) from [<c0341670>] (s3c_hsotg_irq+0x4fc/0x558)
      [   82.500614] [<c0341670>] (s3c_hsotg_irq) from [<c005d54c>] (handle_irq_event_percpu+0x50/0x150)
      [   82.509291] [<c005d54c>] (handle_irq_event_percpu) from [<c005d688>] (handle_irq_event+0x3c/0x5c)
      [   82.518145] [<c005d688>] (handle_irq_event) from [<c006009c>] (handle_fasteoi_irq+0xd4/0x18c)
      [   82.526650] [<c006009c>] (handle_fasteoi_irq) from [<c005ce20>] (generic_handle_irq+0x20/0x30)
      [   82.535242] [<c005ce20>] (generic_handle_irq) from [<c005cf34>] (__handle_domain_irq+0x6c/0xdc)
      [   82.543923] [<c005cf34>] (__handle_domain_irq) from [<c00086b4>] (gic_handle_irq+0x2c/0x6c)
      [   82.552256] [<c00086b4>] (gic_handle_irq) from [<c0011fc0>] (__irq_svc+0x40/0x74)
      [   82.559716] Exception stack(0xc07c9f68 to 0xc07c9fb0)
      [   82.564753] 9f60:                   00000000 00000000 c07c9fb8 c001bee0 c07ca4f0 c057004c
      [   82.572913] 9f80: c07ca4fc c0803a20 c0803a20 413fc090 00000001 00000000 01000000 c07c9fb0
      [   82.581069] 9fa0: c000f800 c000f804 60000053 ffffffff
      [   82.586113] [<c0011fc0>] (__irq_svc) from [<c000f804>] (arch_cpu_idle+0x30/0x3c)
      [   82.593491] [<c000f804>] (arch_cpu_idle) from [<c0050e70>] (cpu_startup_entry+0x128/0x1a4)
      [   82.601740] [<c0050e70>] (cpu_startup_entry) from [<c0783bd8>] (start_kernel+0x350/0x3bc)
      [   82.609890] Code: 0a000002 e3530005 05975010 15975008 (e5953000)
      [   82.615965] ---[ end trace f57d5f599a5f1bfa ]---
      
      Most of kernel code assume that interface array in
      struct usb_configuration is NULL terminated.
      
      When gadget is composed with configfs configuration
      structure may be reused for different functions set.
      
      This bug happens because purge_configs_funcs() sets
      only next_interface_id to 0. Interface array still
      contains pointers to already freed interfaces. If in
      second try we add less interfaces than earlier we
      may access unallocated memory when trying to get
      interface descriptors.
      Signed-off-by: default avatarKrzysztof Opasiak <k.opasiak@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      4623c6e3
    • Hans de Goede's avatar
      usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices · 7bf8bb8b
      Hans de Goede authored
      commit 17211509 upstream.
      
      Without this flag some versions of these enclosures do not work.
      Reported-and-tested-by: default avatarChristian Schaller <cschalle@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      7bf8bb8b
    • Mark Edwards's avatar
      USB: cp210x: add ID for KCF Technologies PRN device · b707e13c
      Mark Edwards authored
      commit c735ed74 upstream.
      
      Added the USB serial console device ID for KCF Technologies PRN device
      which has a USB port for its serial console.
      Signed-off-by: default avatarMark Edwards <sonofaforester@gmail.com>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      b707e13c
    • Jason A. Donenfeld's avatar
      USB: pl2303: Remove support for Samsung I330 · 65c67580
      Jason A. Donenfeld authored
      commit 48ef23a4 upstream.
      
      This phone is already supported by the visor driver.
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      65c67580
    • Jason A. Donenfeld's avatar
      USB: visor: Match I330 phone more precisely · de778848
      Jason A. Donenfeld authored
      commit 82ee3aeb upstream.
      
      Samsung has just released a portable USB3 SSD, coming in a very small
      and nice form factor. It's USB ID is 04e8:8001, which unfortunately is
      already used by the Palm Visor driver for the Samsung I330 phone cradle.
      Having pl2303 or visor pick up this device ID results in conflicts with
      the usb-storage driver, which handles the newly released portable USB3
      SSD.
      
      To work around this conflict, I've dug up a mailing list post [1] from a
      long time ago, in which a user posts the full USB descriptor
      information. The most specific value in this appears to be the interface
      class, which has value 255 (0xff). Since usb-storage requires an
      interface class of 0x8, I believe it's correct to disambiguate the two
      devices by matching on 0xff inside visor.
      
      [1] http://permalink.gmane.org/gmane.linux.usb.user/4264Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      de778848
    • Joe Lawrence's avatar
      xhci: gracefully handle xhci_irq dead device · 245ac1a1
      Joe Lawrence authored
      commit 948fa135 upstream.
      
      If the xHCI host controller has died (ie, device removed) or suffered
      other serious fatal error (STS_FATAL), then xhci_irq should handle this
      condition with IRQ_HANDLED instead of -ESHUTDOWN.
      Signed-off-by: default avatarJoe Lawrence <joe.lawrence@stratus.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      245ac1a1
    • Mathias Nyman's avatar
      xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256 · ef4a3593
      Mathias Nyman authored
      commit 18cc2f4c upstream.
      
      Our event ring consists of only one segment, and we risk filling
      the event ring in case we get isoc transfers with short intervals
      such as webcams that fill a TD every microframe (125us)
      
      With 64 TRB segment size one usb camera could fill the event ring in 8ms.
      A setup with several cameras and other devices can fill up the
      event ring as it is shared between all devices.
      This has occurred when uvcvideo queues 5 * 32TD URBs which then
      get cancelled when the video mode changes. The cancelled URBs are returned
      in the xhci interrupt context and blocks the interrupt handler from
      handling the new events.
      
      A full event ring will block xhci from scheduling traffic and affect all
      devices conneted to the xhci, will see errors such as Missed Service
      Intervals for isoc devices, and  and Split transaction errors for LS/FS
      interrupt devices.
      
      Increasing the TRB_PER_SEGMENT will also increase the default endpoint ring
      size, which is welcome as for most isoc transfer we had to dynamically
      expand the endpoint ring anyway to be able to queue the 5 * 32TDs uvcvideo
      queues.
      
      The default size used to be 64 TRBs per segment
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ef4a3593
    • Mathias Nyman's avatar
      xhci: fix isoc endpoint dequeue from advancing too far on transaction error · eb536420
      Mathias Nyman authored
      commit d104d015 upstream.
      
      Isoc TDs usually consist of one TRB, sometimes two. When all goes well we
      receive only one success event for a TD, and move the dequeue pointer to
      the next TD.
      
      This fails if the TD consists of two TRBs and we get a transfer error
      on the first TRB, we will then see two events for that TD.
      
      Fix this by making sure the event we get is for the last TRB in that TD
      before moving the dequeue pointer to the next TD. This will resolve some
      of the uvc and dvb issues with the
      "ERROR Transfer event TRB DMA ptr not part of current TD" error message
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      eb536420
    • Andy Grover's avatar
      target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST · c9b036ca
      Andy Grover authored
      commit 5a7125c6 upstream.
      
      See https://bugzilla.redhat.com/show_bug.cgi?id=1025672
      
      We need to put() the reference to the scsi host that we got in
      pscsi_configure_device(). In VIRTUAL_HOST mode it is associated with
      the dev_virt, not the hba_virt.
      Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c9b036ca
    • Zidan Wang's avatar
      ASoC: wm8994: correct BCLK DIV 348 to 384 · 7e99e685
      Zidan Wang authored
      commit 17fc2e0a upstream.
      
      According to the RM of wm8958, BCLK DIV 348 doesn't exist, correct it
      to 384.
      Signed-off-by: default avatarZidan Wang <zidan.wang@freescale.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      7e99e685
    • Zidan Wang's avatar
      ASoC: wm8960: fix "RINPUT3" audio route error · 6ed3f9d0
      Zidan Wang authored
      commit 85e36a1f upstream.
      
      It should be "RINPUT3" instead of "LINPUT3" route to "Right Input
      Mixer".
      Signed-off-by: default avatarZidan Wang <zidan.wang@freescale.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6ed3f9d0
    • Axel Lin's avatar
      ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() calls · 3d17fe52
      Axel Lin authored
      commit 545774bd upstream.
      
      mc13xxx_reg_rmw() won't change any bit if passing 0 to the mask field.
      Pass AUDIO_SSI_SEL instead of 0 for the mask field to set AUDIO_SSI_SEL
      bit.
      Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3d17fe52
    • Takashi Iwai's avatar
      ALSA: hda - Add headphone quirk for Lifebook E752 · e638b75d
      Takashi Iwai authored
      commit 88776f36 upstream.
      
      Fujitsu Lifebook E752 laptop needs a similar quirk done for Lifebook
      T731.  Otherwise the headphone is always muted.
      Reported-and-tested-by: default avatarChristian Weber <we_chris@hotmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e638b75d
    • David Henningsson's avatar
      ALSA: hda - Add Conexant codecs CX20721, CX20722, CX20723 and CX20724 · 9bf5b2bd
      David Henningsson authored
      commit 6ffc0898 upstream.
      
      This patch adds support for Conexant HD Audio codecs
      CX20721, CX20722, CX20723 and CX20724.
      
      BugLink: https://bugs.launchpad.net/bugs/1454656Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9bf5b2bd
    • Al Viro's avatar
      d_walk() might skip too much · 7ab65a19
      Al Viro authored
      commit 2159184e upstream.
      
      when we find that a child has died while we'd been trying to ascend,
      we should go into the first live sibling itself, rather than its sibling.
      
      Off-by-one in question had been introduced in "deal with deadlock in
      d_walk()" and the fix needs to be backported to all branches this one
      has been backported to.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      7ab65a19
    • Jan Kara's avatar
      lib: Fix strnlen_user() to not touch memory after specified maximum · 1a3b1408
      Jan Kara authored
      commit f18c34e4 upstream.
      
      If the specified maximum length of the string is a multiple of unsigned
      long, we would load one long behind the specified maximum.  If that
      happens to be in a next page, we can hit a page fault although we were
      not expected to.
      
      Fix the off-by-one bug in the test whether we are at the end of the
      specified range.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1a3b1408
    • Guenter Roeck's avatar
      hwmon: (nct6775) Add missing sysfs attribute initialization · ddafeade
      Guenter Roeck authored
      commit 1b63bf61 upstream.
      
      The following error message is seen when loading the nct6775 driver
      with DEBUG_LOCK_ALLOC enabled.
      
      BUG: key ffff88040b2f0030 not in .data!
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 186 at kernel/locking/lockdep.c:2988
      				lockdep_init_map+0x469/0x630()
      DEBUG_LOCKS_WARN_ON(1)
      
      Caused by a missing call to sysfs_attr_init() when initializing
      sysfs attributes.
      Reported-by: default avatarAlexey Orishko <alexey.orishko@gmail.com>
      Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ddafeade
    • Chris Lesiak's avatar
      hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE · 6ca3b824
      Chris Lesiak authored
      commit adba6575 upstream.
      
      When configured via device tree, the associated iio device needs to be
      measuring voltage for the conversion to resistance to be correct.
      Return -EINVAL if that is not the case.
      Signed-off-by: default avatarChris Lesiak <chris.lesiak@licor.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6ca3b824
    • David Vrabel's avatar
      xen/events: don't bind non-percpu VIRQs with percpu chip · db020773
      David Vrabel authored
      commit 77bb3dfd upstream.
      
      A non-percpu VIRQ (e.g., VIRQ_CONSOLE) may be freed on a different
      VCPU than it is bound to.  This can result in a race between
      handle_percpu_irq() and removing the action in __free_irq() because
      handle_percpu_irq() does not take desc->lock.  The interrupt handler
      sees a NULL action and oopses.
      
      Only use the percpu chip/handler for per-CPU VIRQs (like VIRQ_TIMER).
      
        # cat /proc/interrupts | grep virq
         40:      87246          0  xen-percpu-virq      timer0
         44:          0          0  xen-percpu-virq      debug0
         47:          0      20995  xen-percpu-virq      timer1
         51:          0          0  xen-percpu-virq      debug1
         69:          0          0   xen-dyn-virq      xen-pcpu
         74:          0          0   xen-dyn-virq      mce
         75:         29          0   xen-dyn-virq      hvc_console
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      db020773
    • Ilya Dryomov's avatar
      libceph: request a new osdmap if lingering request maps to no osd · 74b65e99
      Ilya Dryomov authored
      commit b0494532 upstream.
      
      This commit does two things.  First, if there are any homeless
      lingering requests, we now request a new osdmap even if the osdmap that
      is being processed brought no changes, i.e. if a given lingering
      request turned homeless in one of the previous epochs and remained
      homeless in the current epoch.  Not doing so leaves us with a stale
      osdmap and as a result we may miss our window for reestablishing the
      watch and lose notifies.
      
      MON=1 OSD=1:
      
          # cat linger-needmap.sh
          #!/bin/bash
          rbd create --size 1 test
          DEV=$(rbd map test)
          ceph osd out 0
          rbd map dne/dne # obtain a new osdmap as a side effect (!)
          sleep 1
          ceph osd in 0
          rbd resize --size 2 test
          # rbd info test | grep size -> 2M
          # blockdev --getsize $DEV -> 1M
      
      N.B.: Not obtaining a new osdmap in between "osd out" and "osd in"
      above is enough to make it miss that resize notify, but that is a
      bug^Wlimitation of ceph watch/notify v1.
      
      Second, homeless lingering requests are now kicked just like those
      lingering requests whose mapping has changed.  This is mainly to
      recognize that a homeless lingering request makes no sense and to
      preserve the invariant that a registered lingering request is not
      sitting on any of r_req_lru_item lists.  This spares us a WARN_ON,
      which commit ba9d114e ("libceph: clear r_req_lru_item in
      __unregister_linger_request()") tried to fix the _wrong_ way.
      Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: default avatarSage Weil <sage@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      74b65e99
    • Rusty Russell's avatar
      lguest: fix out-by-one error in address checking. · cbcba3e4
      Rusty Russell authored
      commit 83a35114 upstream.
      
      This bug has been there since day 1; addresses in the top guest physical
      page weren't considered valid.  You could map that page (the check in
      check_gpte() is correct), but if a guest tried to put a pagetable there
      we'd check that address manually when walking it, and kill the guest.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      cbcba3e4
    • Sasha Levin's avatar
      fs, omfs: add NULL terminator in the end up the token list · 1f6a5cfb
      Sasha Levin authored
      commit dcbff39d upstream.
      
      match_token() expects a NULL terminator at the end of the token list so
      that it would know where to stop.  Not having one causes it to overrun
      to invalid memory.
      
      In practice, passing a mount option that omfs didn't recognize would
      sometimes panic the system.
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarBob Copeland <me@bobcopeland.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1f6a5cfb
    • Junling Zheng's avatar
      net: socket: Fix the wrong returns for recvmsg and sendmsg · af0cc4dc
      Junling Zheng authored
      Based on 08adb7da upstream.
      
      We found that after v3.10.73, recvmsg might return -EFAULT while -EINVAL
      was expected.
      
      We tested it through the recvmsg01 testcase come from LTP testsuit. It set
      msg->msg_namelen to -1 and the recvmsg syscall returned errno 14, which is
      unexpected (errno 22 is expected):
      
      recvmsg01    4  TFAIL  :  invalid socket length ; returned -1 (expected -1),
      errno 14 (expected 22)
      
      Linux mainline has no this bug for commit 08adb7da fixes it accidentally.
      However, it is too large and complex to be backported to LTS 3.10.
      
      Commit 281c9c36 (net: compat: Update get_compat_msghdr() to match
      copy_msghdr_from_user() behaviour) made get_compat_msghdr() return
      error if msg_sys->msg_namelen was negative, which changed the behaviors
      of recvmsg and sendmsg syscall in a lib32 system:
      
      Before commit 281c9c36, get_compat_msghdr() wouldn't fail and it would
      return -EINVAL in move_addr_to_user() or somewhere if msg_sys->msg_namelen
      was invalid and then syscall returned -EINVAL, which is correct.
      
      And now, when msg_sys->msg_namelen is negative, get_compat_msghdr() will
      fail and wants to return -EINVAL, however, the outer syscall will return
      -EFAULT directly, which is unexpected.
      
      This patch gets the return value of get_compat_msghdr() as well as
      copy_msghdr_from_user(), then returns this expected value if
      get_compat_msghdr() fails.
      
      Fixes: 281c9c36 (net: compat: Update get_compat_msghdr() to match copy_msghdr_from_user() behaviour)
      Signed-off-by: default avatarJunling Zheng <zhengjunling@huawei.com>
      Signed-off-by: default avatarHanbing Xu <xuhanbing@huawei.com>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      af0cc4dc
    • Paolo Bonzini's avatar
      KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages · ea294409
      Paolo Bonzini authored
      commit 89876115 upstream.
      
      smep_andnot_wp is initialized in kvm_init_shadow_mmu and shadow pages
      should not be reused for different values of it.  Thus, it has to be
      added to the mask in kvm_mmu_pte_write.
      Reviewed-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ea294409
    • Mel Gorman's avatar
      mm: numa: initialise numa balancing after jump label initialisation · 1a6d0d97
      Mel Gorman authored
      commit c297663c upstream.
      
      The command line parsing takes place before jump labels are initialised
      which generates a warning if numa_balancing= is specified and
      CONFIG_JUMP_LABEL is set.
      
      On older kernels before commit c4b2c0c5 ("static_key: WARN on usage
      before jump_label_init was called") the kernel would have crashed.  This
      patch enables automatic numa balancing later in the initialisation
      process if numa_balancing= is specified.
      Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
      Acked-by: default avatarRik van Riel <riel@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1a6d0d97
  2. 02 Jun, 2015 10 commits
  3. 26 May, 2015 2 commits
    • Chen Gang's avatar
      qla2xxx: remove redundant declaration in 'qla_gbl.h' · c4f02d54
      Chen Gang authored
      commit 9493c242 upstream.
      
      Remove 2 redundant extern inline functions: qla8044_set_qsnt_ready() and
      qla8044_need_reset_handler(). At present, within upstream next kernel
      source code, they are only used within "drivers/scsi/qla2xxx/qla_nx2.c".
      
      The related error and warnings (with allmodconfig under tile):
      
          CC [M]  drivers/scsi/qla2xxx/qla_nx2.o
        drivers/scsi/qla2xxx/qla_nx2.c:1633:1: error: static declaration of 'qla8044_need_reset_handler' follows non-static declaration
         qla8044_need_reset_handler(struct scsi_qla_host *vha)
         ^
        In file included from drivers/scsi/qla2xxx/qla_def.h:3706:0,
                         from drivers/scsi/qla2xxx/qla_nx2.c:11:
        drivers/scsi/qla2xxx/qla_gbl.h:756:20: note: previous declaration of 'qla8044_need_reset_handler' was here
         extern inline void qla8044_need_reset_handler(struct scsi_qla_host *vha);
                            ^
        drivers/scsi/qla2xxx/qla_gbl.h:756:20: warning: inline function 'qla8044_need_reset_handler' declared but never defined
        make[3]: *** [drivers/scsi/qla2xxx/qla_nx2.o] Error 1
        make[2]: *** [drivers/scsi/qla2xxx] Error 2
        make[1]: *** [drivers/scsi] Error 2
        make: *** [drivers] Error 2
      
          CC [M]  drivers/scsi/qla2xxx/qla_tmpl.o
        In file included from drivers/scsi/qla2xxx/qla_def.h:3706:0,
                         from drivers/scsi/qla2xxx/qla_tmpl.c:7:
        drivers/scsi/qla2xxx/qla_gbl.h:755:20: warning: inline function 'qla8044_set_qsnt_ready' declared but never defined
         extern inline void qla8044_set_qsnt_ready(struct scsi_qla_host *vha);
                          ^
      Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
      Acked-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c4f02d54
    • Kirill A. Shutemov's avatar
      kernel: use the gnu89 standard explicitly · d87c4481
      Kirill A. Shutemov authored
      commit 51b97e35 upstream.
      
      Sasha Levin reports:
       "gcc5 changes the default standard to c11, which makes kernel build
        unhappy
      
        Explicitly define the kernel standard to be gnu89 which should keep
        everything working exactly like it was before gcc5"
      
      There are multiple small issues with the new default, but the biggest
      issue seems to be that the old - and very useful - GNU extension to
      allow a cast in front of an initializer has gone away.
      
      Patch updated by Kirill:
       "I'm pretty sure all gcc versions you can build kernel with supports
        -std=gnu89.  cc-option is redunrant.
      
        We also need to adjust HOSTCFLAGS otherwise allmodconfig fails for me"
      
      Note by Andrew Pinski:
       "Yes it was reported and both problems relating to this extension has
        been added to gnu99 and gnu11.  Though there are other issues with the
        kernel dealing with extern inline have different semantics between
        gnu89 and gnu99/11"
      
      End result: we may be able to move up to a newer stdc model eventually,
      but right now the newer models have some annoying deficiencies, so the
      traditional "gnu89" model ends up being the preferred one.
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Singed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d87c4481