1. 13 Nov, 2014 40 commits
    • Lars-Peter Clausen's avatar
      staging:iio:ade7758: Fix check if channels are enabled in prenable · 4cf866e1
      Lars-Peter Clausen authored
      commit 79fa64eb upstream.
      
      We should check if a channel is enabled, not if no channels are enabled.
      
      Fixes: 550268ca ("staging:iio: scrap scan_count and ensure all drivers use active_scan_mask")
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      4cf866e1
    • Lars-Peter Clausen's avatar
      staging:iio:ade7758: Fix NULL pointer deref when enabling buffer · ca313dd3
      Lars-Peter Clausen authored
      commit e1055473 upstream.
      
      In older versions of the IIO framework it was possible to pass a completely
      different set of channels to iio_buffer_register() as the one that is
      assigned to the IIO device. Commit 959d2952 ("staging:iio: make
      iio_sw_buffer_preenable much more general.") introduced a restriction that
      requires that the set of channels that is passed to iio_buffer_register() is
      a subset of the channels assigned to the IIO device as the IIO core will use
      the list of channels that is assigned to the device to lookup a channel by
      scan index in iio_compute_scan_bytes(). If it can not find the channel the
      function will crash. This patch fixes the issue by making sure that the same
      set of channels is assigned to the IIO device and passed to
      iio_buffer_register().
      
      Note that we need to remove the IIO_CHAN_INFO_RAW and IIO_CHAN_INFO_SCALE
      info attributes from the channels since we don't actually want those to be
      registered.
      
      Fixes the following crash:
      	Unable to handle kernel NULL pointer dereference at virtual address 00000016
      	pgd = d2094000
      	[00000016] *pgd=16e39831, *pte=00000000, *ppte=00000000
      	Internal error: Oops: 17 [#1] PREEMPT SMP ARM
      	Modules linked in:
      	CPU: 1 PID: 1695 Comm: bash Not tainted 3.17.0-06329-g29461ee #9686
      	task: d7768040 ti: d5bd4000 task.ti: d5bd4000
      	PC is at iio_compute_scan_bytes+0x38/0xc0
      	LR is at iio_compute_scan_bytes+0x34/0xc0
      	pc : [<c0316de8>]    lr : [<c0316de4>]    psr: 60070013
      	sp : d5bd5ec0  ip : 00000000  fp : 00000000
      	r10: d769f934  r9 : 00000000  r8 : 00000001
      	r7 : 00000000  r6 : c8fc6240  r5 : d769f800  r4 : 00000000
      	r3 : d769f800  r2 : 00000000  r1 : ffffffff  r0 : 00000000
      	Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      	Control: 18c5387d  Table: 1209404a  DAC: 00000015
      	Process bash (pid: 1695, stack limit = 0xd5bd4240)
      	Stack: (0xd5bd5ec0 to 0xd5bd6000)
      	5ec0: d769f800 d7435640 c8fc6240 d769f984 00000000 c03175a4 d7435690 d7435640
      	5ee0: d769f990 00000002 00000000 d769f800 d5bd4000 00000000 000b43a8 c03177f4
      	5f00: d769f810 0162b8c8 00000002 c8fc7e00 d77f1d08 d77f1da8 c8fc7e00 c01faf1c
      	5f20: 00000002 c010694c c010690c d5bd5f88 00000002 c8fc6840 c8fc684c c0105e08
      	5f40: 00000000 00000000 d20d1580 00000002 000af408 d5bd5f88 c000de84 c00b76d4
      	5f60: d20d1580 000af408 00000002 d20d1580 d20d1580 00000002 000af408 c000de84
      	5f80: 00000000 c00b7a44 00000000 00000000 00000002 b6ebea78 00000002 000af408
      	5fa0: 00000004 c000dd00 b6ebea78 00000002 00000001 000af408 00000002 00000000
      	5fc0: b6ebea78 00000002 000af408 00000004 bee96a4c 000a6094 00000000 000b43a8
      	5fe0: 00000000 bee969cc b6e2eb77 b6e6525c 40070010 00000001 00000000 00000000
      	[<c0316de8>] (iio_compute_scan_bytes) from [<c03175a4>] (__iio_update_buffers+0x248/0x438)
      	[<c03175a4>] (__iio_update_buffers) from [<c03177f4>] (iio_buffer_store_enable+0x60/0x7c)
      	[<c03177f4>] (iio_buffer_store_enable) from [<c01faf1c>] (dev_attr_store+0x18/0x24)
      	[<c01faf1c>] (dev_attr_store) from [<c010694c>] (sysfs_kf_write+0x40/0x4c)
      	[<c010694c>] (sysfs_kf_write) from [<c0105e08>] (kernfs_fop_write+0x110/0x154)
      	[<c0105e08>] (kernfs_fop_write) from [<c00b76d4>] (vfs_write+0xbc/0x170)
      	[<c00b76d4>] (vfs_write) from [<c00b7a44>] (SyS_write+0x40/0x78)
      	[<c00b7a44>] (SyS_write) from [<c000dd00>] (ret_fast_syscall+0x0/0x30)
      
      Fixes: 959d2952 ("staging:iio: make iio_sw_buffer_preenable much more general.")
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ca313dd3
    • Lars-Peter Clausen's avatar
      staging:iio:ad5933: Drop "raw" from channel names · 0a63bb30
      Lars-Peter Clausen authored
      commit 6822ee34 upstream.
      
      "raw" is the name of a channel property, but should not be part of the
      channel name itself.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0a63bb30
    • Lars-Peter Clausen's avatar
      staging:iio:ad5933: Fix NULL pointer deref when enabling buffer · 5cb3a556
      Lars-Peter Clausen authored
      commit 824269c5 upstream.
      
      In older versions of the IIO framework it was possible to pass a
      completely different set of channels to iio_buffer_register() as the one
      that is assigned to the IIO device. Commit 959d2952 ("staging:iio: make
      iio_sw_buffer_preenable much more general.") introduced a restriction that
      requires that the set of channels that is passed to iio_buffer_register() is
      a subset of the channels assigned to the IIO device as the IIO core will use
      the list of channels that is assigned to the device to lookup a channel by
      scan index in iio_compute_scan_bytes(). If it can not find the channel the
      function will crash. This patch fixes the issue by making sure that the same
      set of channels is assigned to the IIO device and passed to
      iio_buffer_register().
      
      Fixes the follow NULL pointer derefernce kernel crash:
      	Unable to handle kernel NULL pointer dereference at virtual address 00000016
      	pgd = d53d0000
      	[00000016] *pgd=1534e831, *pte=00000000, *ppte=00000000
      	Internal error: Oops: 17 [#1] PREEMPT SMP ARM
      	Modules linked in:
      	CPU: 1 PID: 1626 Comm: bash Not tainted 3.15.0-19969-g2a180eb-dirty #9545
      	task: d6c124c0 ti: d539a000 task.ti: d539a000
      	PC is at iio_compute_scan_bytes+0x34/0xa8
      	LR is at iio_compute_scan_bytes+0x34/0xa8
      	pc : [<c03052e4>]    lr : [<c03052e4>]    psr: 60070013
      	sp : d539beb8  ip : 00000001  fp : 00000000
      	r10: 00000002  r9 : 00000000  r8 : 00000001
      	r7 : 00000000  r6 : d6dc8800  r5 : d7571000  r4 : 00000002
      	r3 : d7571000  r2 : 00000044  r1 : 00000001  r0 : 00000000
      	Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      	Control: 18c5387d  Table: 153d004a  DAC: 00000015
      	Process bash (pid: 1626, stack limit = 0xd539a240)
      	Stack: (0xd539beb8 to 0xd539c000)
      	bea0:                                                       c02fc0e4 d7571000
      	bec0: d76c1640 d6dc8800 d757117c 00000000 d757112c c0305b04 d76c1690 d76c1640
      	bee0: d7571188 00000002 00000000 d7571000 d539a000 00000000 000dd1c8 c0305d54
      	bf00: d7571010 0160b868 00000002 c69d3900 d7573278 d7573308 c69d3900 c01ece90
      	bf20: 00000002 c0103fac c0103f6c d539bf88 00000002 c69d3b00 c69d3b0c c0103468
      	bf40: 00000000 00000000 d7694a00 00000002 000af408 d539bf88 c000dd84 c00b2f94
      	bf60: d7694a00 000af408 00000002 d7694a00 d7694a00 00000002 000af408 c000dd84
      	bf80: 00000000 c00b32d0 00000000 00000000 00000002 b6f1aa78 00000002 000af408
      	bfa0: 00000004 c000dc00 b6f1aa78 00000002 00000001 000af408 00000002 00000000
      	bfc0: b6f1aa78 00000002 000af408 00000004 be806a4c 000a6094 00000000 000dd1c8
      	bfe0: 00000000 be8069cc b6e8ab77 b6ec125c 40070010 00000001 22940489 154a5007
      	[<c03052e4>] (iio_compute_scan_bytes) from [<c0305b04>] (__iio_update_buffers+0x248/0x438)
      	[<c0305b04>] (__iio_update_buffers) from [<c0305d54>] (iio_buffer_store_enable+0x60/0x7c)
      	[<c0305d54>] (iio_buffer_store_enable) from [<c01ece90>] (dev_attr_store+0x18/0x24)
      	[<c01ece90>] (dev_attr_store) from [<c0103fac>] (sysfs_kf_write+0x40/0x4c)
      	[<c0103fac>] (sysfs_kf_write) from [<c0103468>] (kernfs_fop_write+0x110/0x154)
      	[<c0103468>] (kernfs_fop_write) from [<c00b2f94>] (vfs_write+0xd0/0x160)
      	[<c00b2f94>] (vfs_write) from [<c00b32d0>] (SyS_write+0x40/0x78)
      	[<c00b32d0>] (SyS_write) from [<c000dc00>] (ret_fast_syscall+0x0/0x30)
      	Code: ea00000e e1a01008 e1a00005 ebfff6fc (e5d0a016)
      
      Fixes: 959d2952 ("staging:iio: make iio_sw_buffer_preenable much more general.")
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      5cb3a556
    • Robin van der Gracht's avatar
      iio: st_sensors: Fix buffer copy · 3d375f0e
      Robin van der Gracht authored
      commit 4250c90b upstream.
      
      Use byte_for_channel as iterator to properly initialize the buffer.
      Signed-off-by: default avatarRobin van der Gracht <robin@protonic.nl>
      Acked-by: default avatarDenis Ciocca <denis.ciocca@st.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3d375f0e
    • Michal Hocko's avatar
      OOM, PM: OOM killed task shouldn't escape PM suspend · b76e0469
      Michal Hocko authored
      commit 5695be14 upstream.
      
      PM freezer relies on having all tasks frozen by the time devices are
      getting frozen so that no task will touch them while they are getting
      frozen. But OOM killer is allowed to kill an already frozen task in
      order to handle OOM situtation. In order to protect from late wake ups
      OOM killer is disabled after all tasks are frozen. This, however, still
      keeps a window open when a killed task didn't manage to die by the time
      freeze_processes finishes.
      
      Reduce the race window by checking all tasks after OOM killer has been
      disabled. This is still not race free completely unfortunately because
      oom_killer_disable cannot stop an already ongoing OOM killer so a task
      might still wake up from the fridge and get killed without
      freeze_processes noticing. Full synchronization of OOM and freezer is,
      however, too heavy weight for this highly unlikely case.
      
      Introduce and check oom_kills counter which gets incremented early when
      the allocator enters __alloc_pages_may_oom path and only check all the
      tasks if the counter changes during the freezing attempt. The counter
      is updated so early to reduce the race window since allocator checked
      oom_killer_disabled which is set by PM-freezing code. A false positive
      will push the PM-freezer into a slow path but that is not a big deal.
      
      Changes since v1
      - push the re-check loop out of freeze_processes into
        check_frozen_processes and invert the condition to make the code more
        readable as per Rafael
      
      Fixes: f660daac (oom: thaw threads if oom killed thread is frozen before deferring)
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.cz>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      b76e0469
    • Cong Wang's avatar
      freezer: Do not freeze tasks killed by OOM killer · a8b7bdea
      Cong Wang authored
      commit 51fae6da upstream.
      
      Since f660daac (oom: thaw threads if oom killed thread is frozen
      before deferring) OOM killer relies on being able to thaw a frozen task
      to handle OOM situation but a3201227 (freezer: make freezing() test
      freeze conditions in effect instead of TIF_FREEZE) has reorganized the
      code and stopped clearing freeze flag in __thaw_task. This means that
      the target task only wakes up and goes into the fridge again because the
      freezing condition hasn't changed for it. This reintroduces the bug
      fixed by f660daac.
      
      Fix the issue by checking for TIF_MEMDIE thread flag in
      freezing_slow_path and exclude the task from freezing completely. If a
      task was already frozen it would get woken by __thaw_task from OOM killer
      and get out of freezer after rechecking freezing().
      
      Changes since v1
      - put TIF_MEMDIE check into freezing_slowpath rather than in __refrigerator
        as per Oleg
      - return __thaw_task into oom_scan_process_thread because
        oom_kill_process will not wake task in the fridge because it is
        sleeping uninterruptible
      
      [mhocko@suse.cz: rewrote the changelog]
      Fixes: a3201227 (freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE)
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.cz>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      a8b7bdea
    • Libin Yang's avatar
      ALSA: hda - add codec ID for Braswell display audio codec · 64118eaa
      Libin Yang authored
      commit d1585c89 upstream.
      
      This patch adds codec ID (0x80862883) and module alias for Braswell
      display codec.
      Signed-off-by: default avatarLibin Yang <libin.yang@intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarChang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      64118eaa
    • Libin Yang's avatar
      ALSA: hda - add PCI IDs for Intel Braswell · 7e5b9724
      Libin Yang authored
      commit f31b2ffc upstream.
      
      Add HD Audio Device PCI ID for the Intel Braswell platform.
      It is an HDA Intel PCH controller.
      
      AZX_DCAPS_ALIGN_BUFSIZE is not necessary for this controller.
      Signed-off-by: default avatarLibin Yang <libin.yang@intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarChang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      7e5b9724
    • Derek Browne's avatar
      mmc: sdhci-pci: SDIO host controller support for Intel Quark X1000 · 0e5b6e1b
      Derek Browne authored
      commit 43e968ce upstream.
      
      This patch is to enable SDIO host controller for Intel Quark X1000.
      Signed-off-by: default avatarDerek Browne <Derek.Browne@intel.com>
      Signed-off-by: default avatarAlvin (Weike) Chen <alvin.chen@intel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarChang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0e5b6e1b
    • Bryan O'Donoghue's avatar
      x86: Add cpu_detect_cache_sizes to init_intel() add Quark legacy_cache() · 03ed94fd
      Bryan O'Donoghue authored
      commit aece118e upstream.
      
      Intel processors which don't report cache information via cpuid(2)
      or cpuid(4) need quirk code in the legacy_cache_size callback to
      report this data. For Intel that callback is is intel_size_cache().
      
      This patch enables calling of cpu_detect_cache_sizes() inside of
      init_intel() and hence the calling of the legacy_cache callback in
      intel_size_cache(). Adding this call will ensure that PIII Tualatin
      currently in intel_size_cache() and Quark SoC X1000 being added to
      intel_size_cache() in this patch will report their respective cache
      sizes.
      
      This model of calling cpu_detect_cache_sizes() is consistent with
      AMD/Via/Cirix/Transmeta and Centaur.
      
      Also added is a string to idenitfy the Quark as Quark SoC X1000
      giving better and more descriptive output via /proc/cpuinfo
      
      Adding cpu_detect_cache_sizes to init_intel() will enable calling
      of intel_size_cache() on Intel processors which currently no code
      can reach. Therefore this patch will also re-enable reporting
      of PIII Tualatin cache size information as well as add
      Quark SoC X1000 support.
      
      Comment text and cache flow logic suggested by Thomas Gleixner
      Signed-off-by: default avatarBryan O'Donoghue <pure.logic@nexus-software.ie>
      Cc: davej@redhat.com
      Cc: hmh@hmh.eng.br
      Link: http://lkml.kernel.org/r/1412641189-12415-3-git-send-email-pure.logic@nexus-software.ieSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarChang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      03ed94fd
    • Pali Rohár's avatar
      cpufreq: intel_pstate: Fix setting max_perf_pct in performance policy · 0d295364
      Pali Rohár authored
      commit 36b4bed5 upstream.
      
      Code which changes policy to powersave changes also max_policy_pct based on
      max_freq. Code which change max_perf_pct has upper limit base on value
      max_policy_pct. When policy is changing from powersave back to performance
      then max_policy_pct is not changed. Which means that changing max_perf_pct is
      not possible to high values if max_freq was too low in powersave policy.
      
      Test case:
      
      $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
      800000
      $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      3300000
      $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      performance
      $ cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
      100
      
      $ echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      $ echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      $ echo 20 > /sys/devices/system/cpu/intel_pstate/max_perf_pct
      
      $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      powersave
      $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      800000
      $ cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
      20
      
      $ echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      $ echo 3300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      $ echo 100 > /sys/devices/system/cpu/intel_pstate/max_perf_pct
      
      $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      performance
      $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      3300000
      $ cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
      24
      
      And now intel_pstate driver allows to set maximal value for max_perf_pct based
      on max_policy_pct which is 24 for previous powersave max_freq 800000.
      
      This patch will set default value for max_policy_pct when setting policy to
      performance so it will allow to set also max value for max_perf_pct.
      Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
      Acked-by: default avatarDirk Brandewie <dirk.j.brandewie@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0d295364
    • Dirk Brandewie's avatar
      cpufreq: expose scaling_cur_freq sysfs file for set_policy() drivers · ead5af44
      Dirk Brandewie authored
      commit c034b02e upstream.
      
      Currently the core does not expose scaling_cur_freq for set_policy()
      drivers this breaks some userspace monitoring tools.
      Change the core to expose this file for all drivers and if the
      set_policy() driver supports the get() callback use it to retrieve the
      current frequency.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=73741Signed-off-by: default avatarDirk Brandewie <dirk.j.brandewie@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ead5af44
    • Jan Kara's avatar
      ext4: fix oops when loading block bitmap failed · bf4939e2
      Jan Kara authored
      commit 599a9b77 upstream.
      
      When we fail to load block bitmap in __ext4_new_inode() we will
      dereference NULL pointer in ext4_journal_get_write_access(). So check
      for error from ext4_read_block_bitmap().
      
      Coverity-id: 989065
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      bf4939e2
    • Darrick J. Wong's avatar
      ext4: enable journal checksum when metadata checksum feature enabled · 82da3f09
      Darrick J. Wong authored
      commit 98c1a759 upstream.
      
      If metadata checksumming is turned on for the FS, we need to tell the
      journal to use checksumming too.
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      82da3f09
    • Jan Kara's avatar
      ext4: fix overflow when updating superblock backups after resize · 6eac6ac4
      Jan Kara authored
      commit 9378c676 upstream.
      
      When there are no meta block groups update_backups() will compute the
      backup block in 32-bit arithmetics thus possibly overflowing the block
      number and corrupting the filesystem. OTOH filesystems without meta
      block groups larger than 16 TB should be rare. Fix the problem by doing
      the counting in 64-bit arithmetics.
      
      Coverity-id: 741252
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6eac6ac4
    • Darrick J. Wong's avatar
      ext4: check s_chksum_driver when looking for bg csum presence · 9154dd79
      Darrick J. Wong authored
      commit 813d32f9 upstream.
      
      Convert the ext4_has_group_desc_csum predicate to look for a checksum
      driver instead of the metadata_csum flag and change the bg checksum
      calculation function to look for GDT_CSUM before taking the crc16
      path.
      
      Without this patch, if we mount with ^uninit_bg,^metadata_csum and
      later metadata_csum gets turned on by accident, the block group
      checksum functions will incorrectly assume that checksumming is
      enabled (metadata_csum) but that crc16 should be used
      (!s_chksum_driver).  This is totally wrong, so fix the predicate
      and the checksum formula selection.
      
      (Granted, if the metadata_csum feature bit gets enabled on a live FS
      then something underhanded is going on, but we could at least avoid
      writing garbage into the on-disk fields.)
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9154dd79
    • Dmitry Monakhov's avatar
      ext4: Replace open coded mdata csum feature to helper function · c8137a7d
      Dmitry Monakhov authored
      commit 9aa5d32b upstream.
      
      Besides the fact that this replacement improves code readability
      it also protects from errors caused direct EXT4_S(sb)->s_es manipulation
      which may result attempt to use uninitialized  csum machinery.
      
      #Testcase_BEGIN
      IMG=/dev/ram0
      MNT=/mnt
      mkfs.ext4 $IMG
      mount $IMG $MNT
      #Enable feature directly on disk, on mounted fs
      tune2fs -O metadata_csum  $IMG
      # Provoke metadata update, likey result in OOPS
      touch $MNT/test
      umount $MNT
      #Testcase_END
      
      # Replacement script
      @@
      expression E;
      @@
      - EXT4_HAS_RO_COMPAT_FEATURE(E, EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)
      + ext4_has_metadata_csum(E)
      
      https://bugzilla.kernel.org/show_bug.cgi?id=82201Signed-off-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c8137a7d
    • Eric Sandeen's avatar
      ext4: fix reservation overflow in ext4_da_write_begin · cc35695f
      Eric Sandeen authored
      commit 0ff8947f upstream.
      
      Delalloc write journal reservations only reserve 1 credit,
      to update the inode if necessary.  However, it may happen
      once in a filesystem's lifetime that a file will cross
      the 2G threshold, and require the LARGE_FILE feature to
      be set in the superblock as well, if it was not set already.
      
      This overruns the transaction reservation, and can be
      demonstrated simply on any ext4 filesystem without the LARGE_FILE
      feature already set:
      
      dd if=/dev/zero of=testfile bs=1 seek=2147483646 count=1 \
      	conv=notrunc of=testfile
      sync
      dd if=/dev/zero of=testfile bs=1 seek=2147483647 count=1 \
      	conv=notrunc of=testfile
      
      leads to:
      
      EXT4-fs: ext4_do_update_inode:4296: aborting transaction: error 28 in __ext4_handle_dirty_super
      EXT4-fs error (device loop0) in ext4_do_update_inode:4301: error 28
      EXT4-fs error (device loop0) in ext4_reserve_inode_write:4757: Readonly filesystem
      EXT4-fs error (device loop0) in ext4_dirty_inode:4876: error 28
      EXT4-fs error (device loop0) in ext4_da_write_end:2685: error 28
      
      Adjust the number of credits based on whether the flag is
      already set, and whether the current write may extend past the
      LARGE_FILE limit.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      cc35695f
    • Theodore Ts'o's avatar
      ext4: add ext4_iget_normal() which is to be used for dir tree lookups · bead15b5
      Theodore Ts'o authored
      commit f4bb2981 upstream.
      
      If there is a corrupted file system which has directory entries that
      point at reserved, metadata inodes, prohibit them from being used by
      treating them the same way we treat Boot Loader inodes --- that is,
      mark them to be bad inodes.  This prohibits them from being opened,
      deleted, or modified via chmod, chown, utimes, etc.
      
      In particular, this prevents a corrupted file system which has a
      directory entry which points at the journal inode from being deleted
      and its blocks released, after which point Much Hilarity Ensues.
      Reported-by: default avatarSami Liedes <sami.liedes@iki.fi>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      bead15b5
    • Dmitry Monakhov's avatar
      ext4: grab missed write_count for EXT4_IOC_SWAP_BOOT · 147261f7
      Dmitry Monakhov authored
      commit 3e67cfad upstream.
      
      Otherwise this provokes complain like follows:
      WARNING: CPU: 12 PID: 5795 at fs/ext4/ext4_jbd2.c:48 ext4_journal_check_start+0x4e/0xa0()
      Modules linked in: brd iTCO_wdt lpc_ich mfd_core igb ptp dm_mirror dm_region_hash dm_log dm_mod
      CPU: 12 PID: 5795 Comm: python Not tainted 3.17.0-rc2-00175-gae5344f #158
      Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.99.99.x028.061320111235 06/13/2011
       0000000000000030 ffff8808116cfd28 ffffffff815c7dfc 0000000000000030
       0000000000000000 ffff8808116cfd68 ffffffff8106ce8c ffff8808116cfdc8
       ffff880813b16000 ffff880806ad6ae8 ffffffff81202008 0000000000000000
      Call Trace:
       [<ffffffff815c7dfc>] dump_stack+0x51/0x6d
       [<ffffffff8106ce8c>] warn_slowpath_common+0x8c/0xc0
       [<ffffffff81202008>] ? ext4_ioctl+0x9e8/0xeb0
       [<ffffffff8106ceda>] warn_slowpath_null+0x1a/0x20
       [<ffffffff8122867e>] ext4_journal_check_start+0x4e/0xa0
       [<ffffffff81228c10>] __ext4_journal_start_sb+0x90/0x110
       [<ffffffff81202008>] ext4_ioctl+0x9e8/0xeb0
       [<ffffffff8107b0bd>] ? ptrace_stop+0x24d/0x2f0
       [<ffffffff81088530>] ? alloc_pid+0x480/0x480
       [<ffffffff8107b1f2>] ? ptrace_do_notify+0x92/0xb0
       [<ffffffff81186545>] do_vfs_ioctl+0x4e5/0x550
       [<ffffffff815cdbcb>] ? _raw_spin_unlock_irq+0x2b/0x40
       [<ffffffff81186603>] SyS_ioctl+0x53/0x80
       [<ffffffff815ce2ce>] tracesys+0xd0/0xd5
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      147261f7
    • Jan Kara's avatar
      ext4: fix mmap data corruption when blocksize < pagesize · 97f94c2e
      Jan Kara authored
      commit d6320cbf upstream.
      
      Use truncate_isize_extended() when hole is being created in a file so that
      ->page_mkwrite() will get called for the partial tail page if it is
      mmaped (see the first patch in the series for details).
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      97f94c2e
    • Jan Kara's avatar
      ext4: don't check quota format when there are no quota files · 0dce193f
      Jan Kara authored
      commit 279bf6d3 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: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0dce193f
    • Darrick J. Wong's avatar
      ext4: check EA value offset when loading · 2d550cd1
      Darrick J. Wong authored
      commit a0626e75 upstream.
      
      When loading extended attributes, check each entry's value offset to
      make sure it doesn't collide with the entries.
      
      Without this check it is easy to crash the kernel by mounting a
      malicious FS containing a file with an EA wherein e_value_offs = 0 and
      e_value_size > 0 and then deleting the EA, which corrupts the name
      list.
      
      (See the f_ea_value_crash test's FS image in e2fsprogs for an example.)
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2d550cd1
    • Darrick J. Wong's avatar
      jbd2: free bh when descriptor block checksum fails · 3a7fa65d
      Darrick J. Wong authored
      commit 064d8389 upstream.
      
      Free the buffer head if the journal descriptor block fails checksum
      verification.
      
      This is the jbd2 port of the e2fsprogs patch "e2fsck: free bh on csum
      verify error in do_one_pass".
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3a7fa65d
    • Marc-André Lureau's avatar
      qxl: don't create too large primary surface · ff4b0a92
      Marc-André Lureau authored
      commit c572aaf4 upstream.
      
      Limit primary to qemu vgamem size, to avoid reaching
      qemu guest bug "requested primary larger than framebuffer"
      on resizing screen too large to fit.
      
      Remove unneeded and misleading variables.
      
      Related to:
      https://bugzilla.redhat.com/show_bug.cgi?id=1127552Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ff4b0a92
    • David Daney's avatar
      MIPS: tlbex: Properly fix HUGE TLB Refill exception handler · f223ebe3
      David Daney authored
      commit 9e0f162a upstream.
      
      In commit 8393c524 (MIPS: tlbex: Fix a missing statement for
      HUGETLB), the TLB Refill handler was fixed so that non-OCTEON targets
      would work properly with huge pages.  The change was incorrect in that
      it broke the OCTEON case.
      
      The problem is shown here:
      
          xxx0:	df7a0000 	ld	k0,0(k1)
          .
          .
          .
          xxxc0:	df610000 	ld	at,0(k1)
          xxxc4:	335a0ff0 	andi	k0,k0,0xff0
          xxxc8:	e825ffcd 	bbit1	at,0x5,0x0
          xxxcc:	003ad82d 	daddu	k1,at,k0
          .
          .
          .
      
      In the non-octeon case there is a destructive test for the huge PTE
      bit, and then at 0, $k0 is reloaded (that is what the 8393c524
      patch added).
      
      In the octeon case, we modify k1 in the branch delay slot, but we
      never need k0 again, so the new load is not needed, but since k1 is
      modified, if we do the load, we load from a garbage location and then
      get a nested TLB Refill, which is seen in userspace as either SIGBUS
      or SIGSEGV (depending on the garbage).
      
      The real fix is to only do this reloading if it is needed, and never
      where it is harmful.
      Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/8151/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f223ebe3
    • Markos Chandras's avatar
      MIPS: ftrace: Fix a microMIPS build problem · 84e435ce
      Markos Chandras authored
      commit aedd153f upstream.
      
      Code before the .fixup section needs to have the .insn directive.
      This has no side effects on MIPS32/64 but it affects the way microMIPS
      loads the address for the return label.
      
      Fixes the following build problem:
      mips-linux-gnu-ld: arch/mips/built-in.o: .fixup+0x4a0: Unsupported jump between
      ISA modes; consider recompiling with interlinking enabled.
      mips-linux-gnu-ld: final link failed: Bad value
      Makefile:819: recipe for target 'vmlinux' failed
      
      The fix is similar to 1658f914 ("MIPS: microMIPS:
      Disable LL/SC and fix linker bug.")
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/8117/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      84e435ce
    • Nicholas Bellinger's avatar
      target: Fix APTPL metadata handling for dynamic MappedLUNs · 8bb710ae
      Nicholas Bellinger authored
      commit e2480563 upstream.
      
      This patch fixes a bug in handling of SPC-3 PR Activate Persistence
      across Target Power Loss (APTPL) logic where re-creation of state for
      MappedLUNs from dynamically generated NodeACLs did not occur during
      I_T Nexus establishment.
      
      It adds the missing core_scsi3_check_aptpl_registration() call during
      core_tpg_check_initiator_node_acl() -> core_tpg_add_node_to_devs() in
      order to replay any pre-loaded APTPL metadata state associated with
      the newly connected SCSI Initiator Port.
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      8bb710ae
    • Quinn Tran's avatar
      target: Fix queue full status NULL pointer for SCF_TRANSPORT_TASK_SENSE · 63e62ea8
      Quinn Tran authored
      commit 082f58ac upstream.
      
      During temporary resource starvation at lower transport layer, command
      is placed on queue full retry path, which expose this problem.  The TCM
      queue full handling of SCF_TRANSPORT_TASK_SENSE currently sends the same
      cmd twice to lower layer.  The 1st time led to cmd normal free path.
      The 2nd time cause Null pointer access.
      
      This regression bug was originally introduced v3.1-rc code in the
      following commit:
      
      commit e057f533
      Author: Christoph Hellwig <hch@infradead.org>
      Date:   Mon Oct 17 13:56:41 2011 -0400
      
          target: remove the transport_qf_callback se_cmd callback
      Signed-off-by: default avatarQuinn Tran <quinn.tran@qlogic.com>
      Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      63e62ea8
    • Joern Engel's avatar
      qla_target: don't delete changed nacls · 769e2859
      Joern Engel authored
      commit f4c24db1 upstream.
      
      The code is currently riddled with "drop the hardware_lock to avoid a
      deadlock" bugs that expose races.  One of those races seems to expose a
      valid warning in tcm_qla2xxx_clear_nacl_from_fcport_map.  Add some
      bandaid to it.
      Signed-off-by: default avatarJoern Engel <joern@logfs.org>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      769e2859
    • Vineet Gupta's avatar
      ARC: [SMP] General Fixes · 1e3b42ef
      Vineet Gupta authored
      commit c3441edd upstream.
      
      -Pass the expected arg to non-boot park'ing routine
       (It worked so far because existing SMP backends don't use the arg)
      
      -CONFIG_DEBUG_PREEMPT warning
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1e3b42ef
    • Petr Matousek's avatar
      kvm: vmx: handle invvpid vm exit gracefully · 5838e85e
      Petr Matousek authored
      commit a642fc30 upstream.
      
      On systems with invvpid instruction support (corresponding bit in
      IA32_VMX_EPT_VPID_CAP MSR is set) guest invocation of invvpid
      causes vm exit, which is currently not handled and results in
      propagation of unknown exit to userspace.
      
      Fix this by installing an invvpid vm exit handler.
      
      This is CVE-2014-3646.
      Signed-off-by: default avatarPetr Matousek <pmatouse@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      5838e85e
    • Nadav Amit's avatar
      KVM: x86: Emulator fixes for eip canonical checks on near branches · a20e81cb
      Nadav Amit authored
      commit 234f3ce4 upstream.
      
      Before changing rip (during jmp, call, ret, etc.) the target should be asserted
      to be canonical one, as real CPUs do.  During sysret, both target rsp and rip
      should be canonical. If any of these values is noncanonical, a #GP exception
      should occur.  The exception to this rule are syscall and sysenter instructions
      in which the assigned rip is checked during the assignment to the relevant
      MSRs.
      
      This patch fixes the emulator to behave as real CPUs do for near branches.
      Far branches are handled by the next patch.
      
      This fixes CVE-2014-3647.
      Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      a20e81cb
    • Nadav Amit's avatar
      KVM: x86: Fix wrong masking on relative jump/call · 4b4290c0
      Nadav Amit authored
      commit 05c83ec9 upstream.
      
      Relative jumps and calls do the masking according to the operand size, and not
      according to the address size as the KVM emulator does today.
      
      This patch fixes KVM behavior.
      Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      4b4290c0
    • Michael S. Tsirkin's avatar
      kvm: x86: don't kill guest on unknown exit reason · 3f119d66
      Michael S. Tsirkin authored
      commit 2bc19dc3 upstream.
      
      KVM_EXIT_UNKNOWN is a kvm bug, we don't really know whether it was
      triggered by a priveledged application.  Let's not kill the guest: WARN
      and inject #UD instead.
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3f119d66
    • Nadav Amit's avatar
      KVM: x86: Check non-canonical addresses upon WRMSR · 7e60cb9b
      Nadav Amit authored
      commit 854e8bb1 upstream.
      
      Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is
      written to certain MSRs. The behavior is "almost" identical for AMD and Intel
      (ignoring MSRs that are not implemented in either architecture since they would
      anyhow #GP). However, IA32_SYSENTER_ESP and IA32_SYSENTER_EIP cause #GP if
      non-canonical address is written on Intel but not on AMD (which ignores the top
      32-bits).
      
      Accordingly, this patch injects a #GP on the MSRs which behave identically on
      Intel and AMD.  To eliminate the differences between the architecutres, the
      value which is written to IA32_SYSENTER_ESP and IA32_SYSENTER_EIP is turned to
      canonical value before writing instead of injecting a #GP.
      
      Some references from Intel and AMD manuals:
      
      According to Intel SDM description of WRMSR instruction #GP is expected on
      WRMSR "If the source register contains a non-canonical address and ECX
      specifies one of the following MSRs: IA32_DS_AREA, IA32_FS_BASE, IA32_GS_BASE,
      IA32_KERNEL_GS_BASE, IA32_LSTAR, IA32_SYSENTER_EIP, IA32_SYSENTER_ESP."
      
      According to AMD manual instruction manual:
      LSTAR/CSTAR (SYSCALL): "The WRMSR instruction loads the target RIP into the
      LSTAR and CSTAR registers.  If an RIP written by WRMSR is not in canonical
      form, a general-protection exception (#GP) occurs."
      IA32_GS_BASE and IA32_FS_BASE (WRFSBASE/WRGSBASE): "The address written to the
      base field must be in canonical form or a #GP fault will occur."
      IA32_KERNEL_GS_BASE (SWAPGS): "The address stored in the KernelGSbase MSR must
      be in canonical form."
      
      This patch fixes CVE-2014-3610.
      Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      7e60cb9b
    • Andy Honig's avatar
      KVM: x86: Improve thread safety in pit · 5671c6a9
      Andy Honig authored
      commit 2febc839 upstream.
      
      There's a race condition in the PIT emulation code in KVM.  In
      __kvm_migrate_pit_timer the pit_timer object is accessed without
      synchronization.  If the race condition occurs at the wrong time this
      can crash the host kernel.
      
      This fixes CVE-2014-3611.
      Signed-off-by: default avatarAndrew Honig <ahonig@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      5671c6a9
    • Andy Honig's avatar
      KVM: x86: Prevent host from panicking on shared MSR writes. · 9f9a1ce3
      Andy Honig authored
      commit 8b3c3104 upstream.
      
      The previous patch blocked invalid writes directly when the MSR
      is written.  As a precaution, prevent future similar mistakes by
      gracefulling handle GPs caused by writes to shared MSRs.
      Signed-off-by: default avatarAndrew Honig <ahonig@google.com>
      [Remove parts obsoleted by Nadav's patch. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9f9a1ce3
    • Quentin Casasnovas's avatar
      kvm: fix excessive pages un-pinning in kvm_iommu_map error path. · 24854135
      Quentin Casasnovas authored
      commit 3d32e4db upstream.
      
      The third parameter of kvm_unpin_pages() when called from
      kvm_iommu_map_pages() is wrong, it should be the number of pages to un-pin
      and not the page size.
      
      This error was facilitated with an inconsistent API: kvm_pin_pages() takes
      a size, but kvn_unpin_pages() takes a number of pages, so fix the problem
      by matching the two.
      
      This was introduced by commit 350b8bdd ("kvm: iommu: fix the third parameter
      of kvm_iommu_put_pages (CVE-2014-3601)"), which fixes the lack of
      un-pinning for pages intended to be un-pinned (i.e. memory leak) but
      unfortunately potentially aggravated the number of pages we un-pin that
      should have stayed pinned. As far as I understand though, the same
      practical mitigations apply.
      
      This issue was found during review of Red Hat 6.6 patches to prepare
      Ksplice rebootless updates.
      
      Thanks to Vegard for his time on a late Friday evening to help me in
      understanding this code.
      
      Fixes: 350b8bdd ("kvm: iommu: fix the third parameter of... (CVE-2014-3601)")
      Signed-off-by: default avatarQuentin Casasnovas <quentin.casasnovas@oracle.com>
      Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: default avatarJamie Iles <jamie.iles@oracle.com>
      Reviewed-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      24854135