Commit Graph

738737 Commits

Author SHA1 Message Date
Andy Whitcroft a14bff1311 x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels
In the following commit:

  9e0e3c5130 ("x86/speculation, objtool: Annotate indirect calls/jumps for objtool")

... we added annotations for CALL_NOSPEC/JMP_NOSPEC on 64-bit x86 kernels,
but we did not annotate the 32-bit path.

Annotate it similarly.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180314112427.22351-1-apw@canonical.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-03-14 13:24:31 +01:00
Andy Lutomirski b506978245 x86/vm86/32: Fix POPF emulation
POPF would trap if VIP was set regardless of whether IF was set.  Fix it.

Suggested-by: Stas Sergeev <stsp@list.ru>
Reported-by: Bart Oldeman <bartoldeman@gmail.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Fixes: 5ed92a8ab7 ("x86/vm86: Use the normal pt_regs area for vm86")
Link: http://lkml.kernel.org/r/ce95f40556e7b2178b6bc06ee9557827ff94bd28.1521003603.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-03-14 09:21:01 +01:00
Andy Lutomirski 78393fdde2 selftests/x86/entry_from_vm86: Add test cases for POPF
POPF is currently broken -- add tests to catch the error.  This
results in:

   [RUN]	POPF with VIP set and IF clear from vm86 mode
   [INFO]	Exited vm86 mode due to STI
   [FAIL]	Incorrect return reason (started at eip = 0xd, ended at eip = 0xf)

because POPF currently fails to check IF before reporting a pending
interrupt.

This patch also makes the FAIL message a bit more informative.

Reported-by: Bart Oldeman <bartoldeman@gmail.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stas Sergeev <stsp@list.ru>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/a16270b5cfe7832d6d00c479d0f871066cbdb52b.1521003603.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-03-14 09:21:01 +01:00
Andy Lutomirski 327d53d005 selftests/x86/entry_from_vm86: Exit with 1 if we fail
Fix a logic error that caused the test to exit with 0 even if test
cases failed.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stas Sergeev <stsp@list.ru>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bartoldeman@gmail.com
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/b1cc37144038958a469c8f70a5f47a6a5638636a.1521003603.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-03-14 09:21:01 +01:00
Paul Mackerras a8b48a4dcc KVM: PPC: Book3S HV: Fix trap number return from __kvmppc_vcore_entry
This fixes a bug where the trap number that is returned by
__kvmppc_vcore_entry gets corrupted.  The effect of the corruption
is that IPIs get ignored on POWER9 systems when the IPI is sent via
a doorbell interrupt to a CPU which is executing in a KVM guest.
The effect of the IPI being ignored is often that another CPU locks
up inside smp_call_function_many() (and if that CPU is holding a
spinlock, other CPUs then lock up inside raw_spin_lock()).

The trap number is currently held in register r12 for most of the
assembly-language part of the guest exit path.  In that path, we
call kvmppc_subcore_exit_guest(), which is a C function, without
restoring r12 afterwards.  Depending on the kernel config and the
compiler, it may modify r12 or it may not, so some config/compiler
combinations see the bug and others don't.

To fix this, we arrange for the trap number to be stored on the
stack from the 'guest_bypass:' label until the end of the function,
then the trap number is loaded and returned in r12 as before.

Cc: stable@vger.kernel.org # v4.8+
Fixes: fd7bacbca4 ("KVM: PPC: Book3S HV: Fix TB corruption in guest exit path on HMI interrupt")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2018-03-14 15:10:50 +11:00
Mike Snitzer e8f74a0f00 dm mpath: eliminate need to use scsi_device_from_queue
Instead of scsi_device_from_queue(), use scsi_dh_attached_handler_name()
-- whose implementation uses scsi_device_from_queue() to avoid trying to
access SCSI-specific resources from non-SCSI devices.

Fixes buildbot reported issue when CONFIG_SCSI isn't set:
 ERROR: "scsi_device_from_queue" [drivers/md/dm-multipath.ko] undefined!

Fixes: 8d47e65948 ("dm mpath: remove unnecessary NVMe branching in favor of scsi_dh checks")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2018-03-13 15:09:56 -04:00
Mike Snitzer c37366742b dm mpath: fix uninitialized 'pg_init_wait' waitqueue_head NULL pointer
Initialize all the scsi_dh related 'struct multipath' members regardless
of whether a scsi_dh is in use or not.

The subtle (and fragile) SCSI-assuming legacy code clearly needs further
decoupling from non-SCSI (and/or developer understanding).

Fixes: 8d47e65948 ("dm mpath: remove unnecessary NVMe branching in favor of scsi_dh checks")
Reported-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2018-03-13 15:09:56 -04:00
Miguel Ojeda 26a2c54d03 auxdisplay: img-ascii-lcd: Silence 2 uninitialized warnings
The warnings are:

  drivers/auxdisplay/img-ascii-lcd.c: warning: 'err' may be used
  uninitialized in this function [-Wuninitialized]

At lines 109 and 207. Reported by Geert using the build service
several times, e.g.:

  https://lkml.org/lkml/2018/2/19/303

They are two false positives, since num_chars > 0 in the three present
configurations (boston, malta, sead3). Initialize to 0 in order to
silence the warning.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Paul Burton <paul.burton@mips.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-03-13 18:16:38 +01:00
Miguel Ojeda 6a78b4dde1 auxdisplay: img-ascii-lcd: Fix doc comment to silence warnings
Compiling with W=1 with gcc 7.2.0 gives 2 warnings:

  drivers/auxdisplay/img-ascii-lcd.c:233: warning: Function parameter or
  member 't' not described in 'img_ascii_lcd_scroll'
  drivers/auxdisplay/img-ascii-lcd.c:233: warning: Excess function
  parameter 'arg' description in 'img_ascii_lcd_scroll'

Cc: Paul Burton <paul.burton@mips.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-03-13 18:13:34 +01:00
Miguel Ojeda 5617c599bb auxdisplay: panel: Change comments to silence fallthrough warnings
Compiling with W=1 with gcc 7.2.0 gives 3 warnings like:

  drivers/auxdisplay/panel.c: In function ‘panel_process_inputs’:
  drivers/auxdisplay/panel.c:1374:17: warning: this statement may fall
  through [-Wimplicit-fallthrough=]

Cc: Willy Tarreau <w@1wt.eu>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-03-13 18:12:09 +01:00
Merlijn Wajer 94e46a4f2d usb: musb: Fix external abort in musb_remove on omap2430
This fixes an oops on unbind / module unload (on the musb omap2430
platform).

musb_remove function now calls musb_platform_exit before disabling
runtime pm.

Signed-off-by: Merlijn Wajer <merlijn@wizzup.org>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-13 16:36:59 +01:00
Ard Biesheuvel 79832f0b5f efi/libstub/tpm: Initialize pointer variables to zero for mixed mode
As reported by Jeremy Cline, running the new TPM libstub code in mixed
mode (i.e., 64-bit kernel on 32-bit UEFI) results in hangs when invoking
the TCG2 protocol, or when accessing the log_tbl pool allocation.

The reason turns out to be that in both cases, the 64-bit pointer
variables are not fully initialized by the 32-bit EFI code, and so
we should take care to zero initialize these variables beforehand,
or we'll end up dereferencing bogus pointers.

Reported-by: Jeremy Cline <jeremy@jcline.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: hdegoede@redhat.com
Cc: jarkko.sakkinen@linux.intel.com
Cc: javierm@redhat.com
Cc: linux-efi@vger.kernel.org
Cc: tweek@google.com
Link: http://lkml.kernel.org/r/20180313140922.17266-2-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-03-13 15:28:29 +01:00
Chris Wilson f1430f145e drm/i915: Kick the rps worker when changing the boost frequency
The boost frequency is only applied from the RPS worker while someone is
waiting on a request and requested a boost. As such, when the user
wishes to change the frequency, we have to kick the worker in order to
re-evaluate whether to apply the boost frequency.

v2: Check num_waiters to decide if we should kick the worker to handle
boosting.

Fixes: 29ecd78d3b ("drm/i915: Define a separate variable and control for RPS waitboost frequency")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180308142648.4016-1-chris@chris-wilson.co.uk
(cherry picked from commit 59cd31f177)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-03-12 11:24:49 -07:00
Chris Wilson 82813ba9b4 drm/i915: Only prune fences after wait-for-all
Currently, we only allow ourselves to prune the fences so long as
all the waits completed (i.e. all the fences we checked were signaled),
and that the reservation snapshot did not change across the wait.
However, if we only waited for a subset of the reservation object, i.e.
just waiting for the last writer to complete as opposed to all readers
as well, then we would erroneously conclude we could prune the fences as
indeed although all of our waits were successful, they did not represent
the totality of the reservation object.

v2: We only need to check the shared fences due to construction (i.e.
all of the shared fences will be later than the exclusive fence, if
any).

Fixes: e54ca97747 ("drm/i915: Remove completed fences after a wait")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180307171303.29466-1-chris@chris-wilson.co.uk
(cherry picked from commit fa73055b84)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-03-12 11:24:44 -07:00
Mustamin B Mustaffa e8cd7143e2 drm/i915: Enable VBT based BL control for DP
Currently, BXT_PP is hardcoded with value '0'.
It practically disabled eDP backlight on MRB (BXT) platform.

This patch will tell which BXT_PP registers (there are two set of
PP_CONTROL in the spec) to be used as defined in VBT (Video Bios Timing
table) and this will enabled eDP backlight controller on MRB (BXT)
platform.

v2:
 - Remove unnecessary information in commit message.
 - Assign vbt.backlight.controller to a backlight_controller variable and
   return the variable value.
v3:
 - Rebased to latest code base.
 - updated commit title.

Signed-off-by: Mustamin B Mustaffa <mustamin.b.mustaffa@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180227030734.37901-1-mustamin.b.mustaffa@intel.com
(cherry picked from commit 73c0fcac97)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-03-12 11:23:47 -07:00
Linus Torvalds fc6eabbbf8 NFS client bugfixes for Linux 4.16
Hightlights include the following stable fixes:
 
 - NFS: Fix an incorrect type in struct nfs_direct_req
 - pNFS: Prevent the layout header refcount going to zero in pnfs_roc()
 - NFS: Fix unstable write completion
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJaprb9AAoJEGcL54qWCgDysK0P/Rwyc7fhcs4CvxETQT0LhbbB
 P6XDAb5pBeU+ca8ZWzqlpe1uKc0z5ykuTLuxLt2QvSb9+6h+8T1gxOa5SibehnwY
 6UizLDgHMuY2V4wqm4XLHiZX7J0Evdo4rgNCp7qq2/TinBPYKQsqIz34+s9BZDti
 6LG6WiVhOtkhs6s/sRbAn+FfMbSiQn54iQIgFPeO+3zEzaaLzUZqlVHO5yjxVnxh
 6oYGkEPVzP09URUO/HJ1VTUZJnso1/axEcH9qhuJzZ+pANCpuBjSMoFzzE6oI2mD
 dfD8UJZjwqLb7AsFhgSQUrDXzaI0Xg7ccrImtCp4QLlTjja3TlOYMYbK9kDRHC1/
 kT93cSFSIeSGpqLVSdNyiz7pCh2Cps2U0JTbhwE0R1NEskWQPzSwY73jEwiA/bex
 JOZBxtjVZt8TgOKHxPO65rvQwaq3T31KrQSDLqv3JReI0epJeqng0h+pwiZluNAs
 TFjE1aP0l567A3qQnPrHrGZ4IIs8XYobZ+MBxf9x5PaRWnGoPUkhHXMP2j8JCnwa
 ofPBR4Mx5WhnsB7Z5vsYetHtmD99QbJ0+WH9ObilUFt6gUgXoXCrvexIUq+LD3DP
 HIIqfbSorAIlQxtCwEz7m85B7VEKByaCWj8OiFt5VVAreEhiazmsncsyh8R5fa88
 wJDxRe3QmNu7BEJ9NJKi
 =IQGX
 -----END PGP SIGNATURE-----

Merge tag 'nfs-for-4.16-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfixes from Trond Myklebust:
 "Hightlights include the following stable fixes:

   - NFS: Fix an incorrect type in struct nfs_direct_req

   - pNFS: Prevent the layout header refcount going to zero in
     pnfs_roc()

   - NFS: Fix unstable write completion"

* tag 'nfs-for-4.16-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  NFS: Fix unstable write completion
  pNFS: Prevent the layout header refcount going to zero in pnfs_roc()
  NFS: Fix an incorrect type in struct nfs_direct_req
2018-03-12 10:47:03 -07:00
Takashi Iwai db45dc9540 ASoC: Fixes for v4.16
This is a fairly standard collection of fixes, there's no changes to the
 core here just a bunch of small device specific changes for single
 drivers plus an update to the MAINTAINERS file for the sgl5000.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlqmqZITHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0EVkB/9MrEZMqClZqWnolQJEFh6oGVRx78Lu
 kZmFoO2l4lYcZuRwbVn/nYYTsJzCUIOptvQT8Sx0jM6xoBpWHftP9zUQ6TTakezt
 vd/idrooS0Btbe/viiDt1ujkrrBlp8netS2IWWY66eJFQ8BrRwOkYWK+45YZFjAm
 GIZ5b6+cLrZqnrcHVLYTg9nAzYOMcfRn7ma9NNhtYlqKkKLhZgHgQh6QJuJKyrGe
 aZIjDbpbPQs594NH8rogbLOAJxfY5ib38Ah9OU3mHzzvK05kCARo9dU6dNs0boW8
 6GABdIAujX3za/qeApfpqhwnrM5N8QBD28BkPGvH60sxxTeO8Vwm91Uf
 =jIwC
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v4.16-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v4.16

This is a fairly standard collection of fixes, there's no changes to the
core here just a bunch of small device specific changes for single
drivers plus an update to the MAINTAINERS file for the sgl5000.
2018-03-12 17:30:38 +01:00
Mark Brown a3e39ed1f4
Merge remote-tracking branches 'asoc/fix/amd', 'asoc/fix/hdmi-codec', 'asoc/fix/rt5651', 'asoc/fix/samsung', 'asoc/fix/sgtl5000', 'asoc/fix/sunxi' and 'asoc/fix/wm-adsp' into asoc-linus 2018-03-12 09:14:07 -07:00
Takashi Iwai 40088dc4e1 ALSA: hda - Revert power_save option default value
With the commit 1ba8f9d308 ("ALSA: hda: Add a power_save
blacklist"), we changed the default value of power_save option to -1
for processing the power-save blacklist.
Unfortunately, this seems breaking user-space applications that
actually read the power_save parameter value via sysfs and judge /
adjust the power-saving status.  They see the value -1 as if the
power-save is turned off, although the actual value is taken from
CONFIG_SND_HDA_POWER_SAVE_DEFAULT and it can be a positive.

So, overall, passing -1 there was no good idea.  Let's partially
revert it -- at least for power_save option default value is restored
again to CONFIG_SND_HDA_POWER_SAVE_DEFAULT.  Meanwhile, in this patch,
we keep the blacklist behavior and make is adjustable via the new
option, pm_blacklist.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199073
Fixes: 1ba8f9d308 ("ALSA: hda: Add a power_save blacklist")
Acked-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-12 14:16:08 +01:00
Greg Kroah-Hartman 914a020d4a phy: for 4.16-rc
*) Fix a Kbuild failure in qcom-ufs
 
 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJapk/uAAoJEA5ceFyATYLZ2PkP/2h6ukU68gdgzmnADvx8Nvwb
 TXYJG7w5NcCVAf2QrGr9B9QQnWqUIdx+Gq6Md5QV0Wmhqgog6yzAf1Rt2J5AwA4i
 9aR/nWRbAMyB/O+H43Rdmbcv2ME9nPeGvcSKnvNh1TAtMOheeaJex0RQSFMv0wiH
 KpD/NpnN0JD/Dk1/qKHJWUV0R6N0Zjv5EcCshEHyHwrwptZwEXPMj7s0LS+g7YeL
 GihZKSOqrjN9mkvQdXMhN7XVhF73WWtBDUpM/YJuA6xJED7KjBGi7LL2JD5V4uD3
 qYZowz3WKRhDT9dqpWtgOroODcfCW7KkKaYWzfENHBrBscS8TfG37scCo3itB/nx
 Z875MlzVXxxH+0YGV921IOjOjA99u9H1VHRHH9+cJWxQr8MlXHC/TiDUQD5eLWyu
 FGQXLw6bhKOyoHf7pbPrTrZIXcwFZ6UVR+7XMN4h0IMADC/ZXritnYjdFEfKayM9
 ja52G1d5iNp5f8djODtCNgVANMFvkoBw+QXceRSx3BiBn2S9kT9iQZDNgODYsayR
 yHvLwG6D4Bgi5tjLXkN9c8F110MAjHx9zd2oodA6gE0enJke36h1xl5sgkD6ExsN
 Q0dnUhyp+3jlRwQwCWVAk04VO/2S3EEI6Gveq+hYR/zQUuocwxREUUm7Iqhx3F/u
 9O+4pviVjpOzt2wwRR79
 =0H1k
 -----END PGP SIGNATURE-----

Merge tag 'phy-for-4.16-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-linus

phy: for 4.16-rc

 *) Fix a Kbuild failure in qcom-ufs

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2018-03-12 13:13:42 +01:00
Kirill A. Shutemov 7958b2246f x86/cpufeatures: Add Intel PCONFIG cpufeature
CPUID.0x7.0x0:EDX[18] indicates whether Intel CPU support PCONFIG instruction.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Kai Huang <kai.huang@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20180305162610.37510-4-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-03-12 12:09:53 +01:00
Kirill A. Shutemov 1da961d72a x86/cpufeatures: Add Intel Total Memory Encryption cpufeature
CPUID.0x7.0x0:ECX[13] indicates whether CPU supports Intel Total Memory
Encryption.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Kai Huang <kai.huang@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20180305162610.37510-2-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-03-12 12:09:53 +01:00
Arnd Bergmann 59fba0869a phy: qcom-ufs: add MODULE_LICENSE tag
While the specific UFS PHY drivers (14nm and 20nm) have a module
license, the common base module does not, leading to a Kbuild
failure:

WARNING: modpost: missing MODULE_LICENSE() in drivers/phy/qualcomm/phy-qcom-ufs.o
FATAL: modpost: GPL-incompatible module phy-qcom-ufs.ko uses GPL-only symbol 'clk_enable'

This adds a module description and license tag to fix the build.
I added both Yaniv and Vivek as authors here, as Yaniv sent the initial
submission, while Vivek did most of the work since.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2018-03-12 15:11:59 +05:30
Linus Torvalds 0c8efd610b Linux 4.16-rc5 2018-03-11 17:25:09 -07:00
Linus Torvalds ed58d66f60 Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86/pti updates from Thomas Gleixner:
 "Yet another pile of melted spectrum related updates:

   - Drop native vsyscall support finally as it causes more trouble than
     benefit.

   - Make microcode loading more robust. There were a few issues
     especially related to late loading which are now surfacing because
     late loading of the IB* microcodes addressing spectre issues has
     become more widely used.

   - Simplify and robustify the syscall handling in the entry code

   - Prevent kprobes on the entry trampoline code which lead to kernel
     crashes when the probe hits before CR3 is updated

   - Don't check microcode versions when running on hypervisors as they
     are considered as lying anyway.

   - Fix the 32bit objtool build and a coment typo"

* 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/kprobes: Fix kernel crash when probing .entry_trampoline code
  x86/pti: Fix a comment typo
  x86/microcode: Synchronize late microcode loading
  x86/microcode: Request microcode on the BSP
  x86/microcode/intel: Look into the patch cache first
  x86/microcode: Do not upload microcode if CPUs are offline
  x86/microcode/intel: Writeback and invalidate caches before updating microcode
  x86/microcode/intel: Check microcode revision before updating sibling threads
  x86/microcode: Get rid of struct apply_microcode_ctx
  x86/spectre_v2: Don't check microcode versions when running under hypervisors
  x86/vsyscall/64: Drop "native" vsyscalls
  x86/entry/64/compat: Save one instruction in entry_INT80_compat()
  x86/entry: Do not special-case clone(2) in compat entry
  x86/syscalls: Use COMPAT_SYSCALL_DEFINEx() macros for x86-only compat syscalls
  x86/syscalls: Use proper syscall definition for sys_ioperm()
  x86/entry: Remove stale syscall prototype
  x86/syscalls/32: Simplify $entry == $compat entries
  objtool: Fix 32-bit build
2018-03-11 14:59:23 -07:00
Linus Torvalds 1ad5daa653 Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fix from Thomas Gleixner:
 "Just a single fix which adds a missing Kconfig dependency to avoid
  unmet dependency warnings"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource/atmel-st: Add 'depends on HAS_IOMEM' to fix unmet dependency
2018-03-11 14:55:15 -07:00
Linus Torvalds ebb3762e88 Merge branch 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RAS fixes from Thomas Gleixner:
 "Two small fixes for RAS/MCE:

   - Serialize sysfs changes to avoid concurrent modificaiton of
     underlying data

   - Add microcode revision to Machine Check records. This should have
     been there forever, but now with the broken microcode versions in
     the wild it has become important"

* 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/MCE: Serialize sysfs changes
  x86/MCE: Save microcode revision in machine check records
2018-03-11 14:52:41 -07:00
Linus Torvalds 8ad4424350 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Thomas Gleixner:
 "Another set of perf updates:

   - Fix a Skylake Uncore event format declaration

   - Prevent perf pipe mode from crahsing which was caused by a missing
     buffer allocation

   - Make the perf top popup message which tells the user that it uses
     fallback mode on older kernels a debug message.

   - Make perf context rescheduling work correcctly

   - Robustify the jump error drawing in perf browser mode so it does
     not try to create references to NULL initialized offset entries

   - Make trigger_on() robust so it does not enable the trigger before
     everything is set up correctly to handle it

   - Make perf auxtrace respect the --no-itrace option so it does not
     try to queue AUX data for decoding.

   - Prevent having different number of field separators in CVS output
     lines when a counter is not supported.

   - Make the perf kallsyms man page usage behave like it does for all
     other perf commands.

   - Synchronize the kernel headers"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/core: Fix ctx_event_type in ctx_resched()
  perf tools: Fix trigger class trigger_on()
  perf auxtrace: Prevent decoding when --no-itrace
  perf stat: Fix CVS output format for non-supported counters
  tools headers: Sync x86's cpufeatures.h
  tools headers: Sync copy of kvm UAPI headers
  perf record: Fix crash in pipe mode
  perf annotate browser: Be more robust when drawing jump arrows
  perf top: Fix annoying fallback message on older kernels
  perf kallsyms: Fix the usage on the man page
  perf/x86/intel/uncore: Fix Skylake UPI event format
2018-03-11 14:49:49 -07:00
Linus Torvalds 02bf0ef028 Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fix from Thomas Gleixner:
 "rt_mutex_futex_unlock() grew a new irq-off call site, but the function
  assumes that its always called from irq enabled context.

  Use (un)lock_irqsafe() to handle the new call site correctly"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  rtmutex: Make rt_mutex_futex_unlock() safe for irq-off callsites
2018-03-11 14:46:54 -07:00
Thomas Gleixner a2f9e6500f irqchip updates for 4.16-rc5
- IMX GPCv2 cleanup
 - GICv3 iomem annontation fixes
 - GICv3 ITS minimal ITE allocation now matching the LPIs'.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEn9UcU+C1Yxj9lZw9I9DQutE9ekMFAlqlMX0VHG1hcmMuenlu
 Z2llckBhcm0uY29tAAoJECPQ0LrRPXpDY7kP/0JWOR9fhN7q8bI7WWFIbOUQWuzA
 xKFg6SkrvEVS7LyCQ5CNqOAfkxOAh2jQL2W/IjFOXgL1ossP7QVzMA70m6x7GlUZ
 jtZsbo5+wBue+DHGDup/FDWekmb//ybJqoaMbmp3K1A9KzfivfUdg27d/4PCnVCB
 wd9cFhTcbjiOBwlrpznvkqnkwNYiUo3Sy1nJFsKjl4e0blNfWCi3AhsISjxob2dn
 5C/2KvRsYTpfWswgu0w3C4jpv6eITPcN1kMYkwo+fuvpf+iwpaR9u7juKW3QJMXd
 MyS6lK6oov7lxAgDUInXRigomRPVjmsK01iHE1u7+XlmxyvWcZyk83qd6ewP5HGp
 zQbyUqXpp4VG+QsEyAwy4kUAHJIgVNXIfbdIFCFAvhV73X59pVQXVA+DaIlGyJQ4
 S7T1+nvzMGAENRDiq+RRQYzgluFBgck5BsSHcYDyTgDcQILEoZlKNziyBx/+tudu
 3DpljijChOObqFG0EdCzg4Q22Pre26bxmLKJnc7Pkwrb85stt/vUqo0HII/KRyyl
 bV26Sa6dFv8ZIb/smWzMQGyrjHBheRoCbNGWF7vsPgaD0O3iwKetczNJ0gC7lLC9
 Yv6KIiygA+5+CLupdZDMZK2yfZE5NuEu/fv+zr7gjbHJpp9hSNEyrrdh1HpoeNf1
 I2H2OGjFQX5zF+87
 =6Nok
 -----END PGP SIGNATURE-----

Merge tag 'irqchip-4.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent

Pull irqchip updates for 4.16-rc5 from Marc Zyngier

- IMX GPCv2 cleanup
- GICv3 iomem annontation fixes
- GICv3 ITS minimal ITE allocation now matching the LPIs'.
2018-03-11 13:57:12 -07:00
Linus Torvalds abeb75218a dmaengine fixes for v4.16-rc5
Two small fixes are for this cycle:
 - fix max_chunk_size for rcar-dmac for R-Car Gen3
 - fix clock resource of mv_xor_v2
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJapUbhAAoJEHwUBw8lI4NHQZcP/iQ2Xwwm7iVzwKdpOXW+Knq3
 +zQQFFJaXzLTybEg9upFxAQqZMuUJ6FE3Pa/X1y3imcYoQIjWWd0/RykvY8Sac6E
 cM5IzM20JuVCnbHwKxmYUsoYWg41l0trhDPEFsHn/ddRu6PCHYfo7vflDhwuBweL
 5gIhoUzIKW34bJhFWaslVvfC9k66IL0rhQAawAQFcd3pKIVx5ED8su17cWAGda5w
 UKC0YEsiNY4MNVb4S9N5d1zxHDsjAnAH3//3gs39+zP04tmWsjRJZSPZ2543SU0X
 Ln5nA7p+Knhz1/iSKyYTMy/ZcInCWY+UYUYJNpBecuViXctc7e6gZg/pjmrGegpM
 sV1wvvGBmBifNYVPVhA2MP5uUJR6jfZIJCBjizUiaQkg4eQlLM5XCsZgheSbgLxY
 3zygh1bo4I465bAwjEZf7Xx541ku5orOrdhMUljWsS44z2VP5EZDsGXHsUx4UhAM
 5DP05HdOlSeWrRF8Ja8eJHrSXz6ICTz3N1oajOHzGgxjE0fRNmrnVOlyb9R61A4s
 a+GddqNm/hnHBo0slv3tZgjVCMzDQmedVjU5b4eSxEjV+vo+SrL7VwGHQrpLlvEo
 6PiXTRlKDvyHiOKJJ+YSw7g70HifDdb6IZRo7HsdzqscjvWc3iK4F8McYjiNzLra
 1+Zo3GEs7tikCWYi1ftQ
 =RhQT
 -----END PGP SIGNATURE-----

Merge tag 'dmaengine-fix-4.16-rc5' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fixes from Vinod Koul:
 "Two small fixes are for this cycle:

   - fix max_chunk_size for rcar-dmac for R-Car Gen3

   - fix clock resource of mv_xor_v2"

* tag 'dmaengine-fix-4.16-rc5' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
  dmaengine: rcar-dmac: fix max_chunk_size for R-Car Gen3
2018-03-11 13:07:14 -07:00
Linus Torvalds d43be80a4a This is a single GPIO fix for the v4.16 series affecting the
Renesas driver, and fixes wakeup from external stuff.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJapPzIAAoJEEEQszewGV1zyzEP/1lpoBdsHoMsLSQ5ya8YXXJo
 mtRTIn9WZ5cRS+RpR4UjRW+TnKcdfOtzEWevzyNoNWcSK1m9sSScOl2MwqP56Lda
 WH4SoLZYClHoUJsZ7v0r+b4WmOWa7IWaqjuNFLL+5w5nVmzpFlZoppqUAqoxi3rb
 Tr9PqI8NXmc9zfUz971/b8A4MmXMA/wXHfoin9uYoWHyyIf6Odszgdp01tMh1/39
 7R9OlHgwXuRF0iPtcmwXINU2WjGerIChDOehZ3u/OCFXlPULtWktyWiqEOvEgour
 XXyLynCLwUn4x5QIXNb0wBGR7R2OxKyk78AddkvA0wKWbixgJ2WSBA6oJl1+Cy4b
 2HQIkRz6b56JUf/7kc2Il+V0NIj4x0iq2JYOOHYcDe9sVdn9pVpfJ50gvkPDTTE8
 zILym6abGSfhq/UXW8YKMGvMez7YasWHHtf1jPK4/4YJthCtWEUbFeK2Bfd4MMxg
 ey1hAz9ZWkCdP8vWr5Znyh5LCu+3gtq24dkSKrDhdnzO+UZxeb7ZYT/kv18YNJSk
 aRpPOGFCZpdV2LeclbgfOLi8OO+xFWC7bM6ZNSVVH7JfJG0SpOWWGt6hurS4cWK3
 l7DHSIeWM2RCuJVPizHDM5Sr88P59t5cQm0JOt5t9WkUqAB8Abv6dJvGqkrghTbF
 xHAzyCax3xvnv+kuyRBo
 =8lyD
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fix from Linus Walleij:
 "This is a single GPIO fix for the v4.16 series affecting the Renesas
  driver, and fixes wakeup from external stuff"

* tag 'gpio-v4.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: rcar: Use wakeup_path i.s.o. explicit clock handling
2018-03-11 13:05:15 -07:00
Gregory CLEMENT 3cd2c313f1 dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
On the CP110 components which are present on the Armada 7K/8K SoC we need
to explicitly enable the clock for the registers. However it is not
needed for the AP8xx component, that's why this clock is optional.

With this patch both clock have now a name, but in order to be backward
compatible, the name of the first clock is not used. It allows to still
use this clock with a device tree using the old binding.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2018-03-11 20:33:27 +05:30
Fabio Estevam 61b8b22858 irqchip/irq-imx-gpcv2: Remove unused function
imx_gpcv2_get_wakeup_source() is not used anywhere, so remove it.

This fixes the following sparse warning:

drivers/irqchip/irq-imx-gpcv2.c:34:5: warning: symbol 'imx_gpcv2_get_wakeup_source' was not declared. Should it be static?

Fixes: e324c4dc4a ("irqchip/imx-gpcv2: IMX GPCv2 driver for wakeup sources")
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
2018-03-11 13:27:12 +00:00
Ard Biesheuvel 4f2c7583e3 irqchip/gic-v3-its: Ensure nr_ites >= nr_lpis
When struct its_device instances are created, the nr_ites member
will be set to a power of 2 that equals or exceeds the requested
number of MSIs passed to the msi_prepare() callback. At the same
time, the LPI map is allocated to be some multiple of 32 in size,
where the allocated size may be less than the requested size
depending on whether a contiguous range of sufficient size is
available in the global LPI bitmap.

This may result in the situation where the nr_ites < nr_lpis, and
since nr_ites is what we program into the hardware when we map the
device, the additional LPIs will be non-functional.

For bog standard hardware, this does not really matter. However,
in cases where ITS device IDs are shared between different PCIe
devices, we may end up allocating these additional LPIs without
taking into account that they don't actually work.

So let's make nr_ites at least 32. This ensures that all allocated
LPIs are 'live', and that its_alloc_device_irq() will fail when
attempts are made to allocate MSIs beyond what was allocated in
the first place.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[maz: updated comment]
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
2018-03-11 13:27:06 +00:00
Takashi Iwai 01c0b4265c ALSA: pcm: Fix UAF in snd_pcm_oss_get_formats()
snd_pcm_oss_get_formats() has an obvious use-after-free around
snd_mask_test() calls, as spotted by syzbot.  The passed format_mask
argument is a pointer to the hw_params object that is freed before the
loop.  What a surprise that it has been present since the original
code of decades ago...

Reported-by: syzbot+4090700a4f13fccaf648@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-11 10:25:10 +01:00
Linus Torvalds 3266b5bd97 Kbuild fixes for v4.16 (2nd)
- make fixdep parse kconfig.h to fix missing rebuild
 
 - replace hyphens with underscores in builtin DTB label names
 
 - fix typos
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJao+BsAAoJED2LAQed4NsGR+wQAKGslOYu+2swZur6UATf3vNU
 kVlkQCs0ZLi8+vnCBCHuN7Qh+2SyHE3pedMVRKXl8n0fP65hiH42I+yMNJQ+zRh+
 wGjZdOWxjB80a8HUG9gbiCLfKaZ+7H1YYlWzhUvgJiEqmyKzDuXMYaYNbeOh1yJg
 dzTUuMvirw9OpT60FZqcR4Z8ivCbi0BmI9vOzKukQcgvXbPUkAX40yrxstPN3FeJ
 RWN0P/cKRhlYmM+42p0JcUqjt0OWGxKyoaOdTuz4ccOG9NEnRg4p9uygeedW615V
 7HMMdn/ZNvGmzAcMkkafOs6m0zLQyM3nW35sRdepXGCRjy2Np3hq7AMN9qpTH6Ol
 i5XGZH3phYi3K9L5gUEF3ex0EjaCRjqb3+ppN81GJ7uQHVra+CCq4M8CRRK73+Vh
 wvwjqDfnh11N8p2yg+VBcLr4z+alVGV0gpg8t3zsNZwSqxGI+nc0wlyuLR2hnP6z
 ZD8b/V1qEFa64y0BL89Swfu8u1q9NwS79hfN3TwZF8E7QKtqJtkOrX8stTXkCvJ6
 KUHfn7Z8Wosvmaz5NllR2aEGGDXM19mXVXoZ+3uNG8yM9whc0EDIrItT3ITF0Ryr
 f0SO+L7i+rHh1xCmKwWyWKZ7BQUzkFD5O2tOJxaglYF4juO5vqw9MuEQGNb9Kqa9
 ouRcrBf/B+7mfv4AilAM
 =dyKQ
 -----END PGP SIGNATURE-----

Merge tag 'kbuild-fixes-v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - make fixdep parse kconfig.h to fix missing rebuild

 - replace hyphens with underscores in builtin DTB label names

 - fix typos

* tag 'kbuild-fixes-v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: Handle builtin dtb file names containing hyphens
  scripts/bloat-o-meter: fix typos in help
  fixdep: do not ignore kconfig.h
  fixdep: remove some false CONFIG_ matches
  fixdep: remove stale references to uml-config.h
2018-03-10 10:21:07 -08:00
Linus Torvalds 23b33acc5f linux-watchdog 4.16-fixes-2 merge window tag
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iEYEABECAAYFAlqjrhoACgkQ+iyteGJfRsqqSACfS2mtTsPzvxofsaKjlUgG0PUu
 GtEAoKNM20k8Ni145/eCeosboYspForw
 =8Tgb
 -----END PGP SIGNATURE-----

Merge tag 'linux-watchdog-4.16-fixes-2' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog fixes from Wim Van Sebroeck:

 - f71808e_wdt: Fix magic close handling

 - sbsa: 32-bit read fix for WCV

 - hpwdt: Remove legacy NMI sourcing

* tag 'linux-watchdog-4.16-fixes-2' of git://www.linux-watchdog.org/linux-watchdog:
  watchdog: hpwdt: Remove legacy NMI sourcing.
  watchdog: sbsa: use 32-bit read for WCV
  watchdog: f71808e_wdt: Fix magic close handling
2018-03-10 10:17:59 -08:00
Linus Torvalds 91a262096e for-linus-20180309
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJao2pFAAoJEPfTWPspceCmo7wQAJb9B2FR0BnT0FeXyn+K14sB
 rsldkfXlMuA6zgNdDZjyrk5x1tAUpwE1md636V00clz/jFuBd9Wh6FhPRsvyWfsT
 IRcYh4d1Ojewyn/XsphBEgsruxe2gUGDaJKaeETH5Fzq/lo+zk+XESYuS6BD0dCl
 pLUMdVgsPl1FTlYjG8Oo7tPZcfrWtyOJ8Ri503PadEOretKIbjo5LbpNrKDsQCBT
 BmVrZJEDRXow9TaNgUgF6cYmJm2YVjKLnmovpNxVF2kto0oOfzEKoiQk/4kA7U5r
 kwIT9kXZO81GZ8JiG7ccNDrbQ+ExCaNMUSyhyDqrVs89/9xCA8ffTGj1bZWW4zd5
 qw85McjcWGfZIzsVKpUr9xhZAVB9y1AwZ5en6bcSi5RVhltyxouBzFROq1iJEGis
 /OIz5XcOXAWMZWSa4PRh7PXSRXtmPh7mj4bE0GfnuWfIA9yPYk5sCe0Lq/XNFvC8
 NVw8TL//SyMQnMUTCzFbRx7DXzZ1CRVSvV/28k96Clmymy8ZAEWhsvYb5bpMHM4C
 rAL71OEjDda+Msl0WKF7IWXYiuu5CWHk8Gp7k10IdVsVAorBzLRLXJvd+J7/SETk
 sO5QYW3DIxHwwS7389g91c1zq9KevDJUnV9AqkwcX260kgYjyPAdQB1eOLPTSHx9
 aa20gUIfEEds35dWCZLK
 =1Ukr
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-20180309' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

 - a xen-blkfront fix from Bhavesh with a multiqueue fix when
   detaching/re-attaching

 - a few important NVMe fixes, including a revert for a sysfs fix that
   caused some user space confusion

 - two bcache fixes by way of Michael Lyle

 - a loop regression fix, fixing an issue with lost writes on DAX.

* tag 'for-linus-20180309' of git://git.kernel.dk/linux-block:
  loop: Fix lost writes caused by missing flag
  nvme_fc: rework sqsize handling
  nvme-fabrics: Ignore nr_io_queues option for discovery controllers
  xen-blkfront: move negotiate_mq to cover all cases of new VBDs
  Revert "nvme: create 'slaves' and 'holders' entries for hidden controllers"
  bcache: don't attach backing with duplicate UUID
  bcache: fix crashes in duplicate cache device register
  nvme: pci: pass max vectors as num_possible_cpus() to pci_alloc_irq_vectors
  nvme-pci: Fix EEH failure on ppc
2018-03-10 08:48:01 -08:00
Linus Torvalds b3b25b1d9e - Fix an uninitialized variable false warning in dm bufio
- Fix DM's passthrough ioctl support to be race free against an
   underlying device being removed.
 
 - Fix corner-case of DM raid resync reporting if/when the raid becomes
   degraded during resync; otherwise automated raid repair will fail.
 
 - A few DM multipath fixes to make non-SCSI optimizations, that were
   introduced during the 4.16 merge, useful for all non-SCSI devices,
   rather than narrowly define this non-SCSI mode in terms of "nvme".
   This allows the removal of "queue_mode nvme" that really didn't need
   to be introduced.  Instead DM core will internalize whether
   nvme-specific IO submission optimizations are doable and DM multipath
   will only do SCSI-specific device handler operations if SCSI is in
   use.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJaou84AAoJEMUj8QotnQNaYucH/RTlx1kJ4S7dHqUVFQdYZoZM
 ngpBGQZrvcjGwiTqpFb5lbvS4eXL5tAJrmIlcP/vD5woP57kK6uaxWbhZTDKlARK
 UppM2FwA166szfYLMopA4yPj7o2+aBBF6y6Q9s5kP9UbsNIdBbPGBzz3JhThSu5q
 FB6YWhMuEpBwQT2Y5nrz/X5mBVnzjPnvCDeYh3HLihnPeYYZiupR9EVCJ7vRVc+S
 S8+oX6Yl9Jc6GWKQriQW+EEQN/9E6YMH4tTPvd8S5hT6uzznePx8myv60qXM894J
 f+O9gcna3rF41XIYleUEXbES0kwXZzISeJNo5NokTRIKEmn8fJU+tuvqAGTh/yQ=
 =1Ki0
 -----END PGP SIGNATURE-----

Merge tag 'for-4.16/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device mapper fixes from Mike Snitzer:

 - Fix an uninitialized variable false warning in dm bufio

 - Fix DM's passthrough ioctl support to be race free against an
   underlying device being removed.

 - Fix corner-case of DM raid resync reporting if/when the raid becomes
   degraded during resync; otherwise automated raid repair will fail.

 - A few DM multipath fixes to make non-SCSI optimizations, that were
   introduced during the 4.16 merge, useful for all non-SCSI devices,
   rather than narrowly define this non-SCSI mode in terms of "nvme".

   This allows the removal of "queue_mode nvme" that really didn't need
   to be introduced. Instead DM core will internalize whether
   nvme-specific IO submission optimizations are doable and DM multipath
   will only do SCSI-specific device handler operations if SCSI is in
   use.

* tag 'for-4.16/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm table: allow upgrade from bio-based to specialized bio-based variant
  dm mpath: remove unnecessary NVMe branching in favor of scsi_dh checks
  dm table: fix "nvme" test
  dm raid: fix incorrect sync_ratio when degraded
  dm: use blkdev_get rather than bdgrab when issuing pass-through ioctl
  dm bufio: avoid false-positive Wmaybe-uninitialized warning
2018-03-10 08:45:44 -08:00
Linus Torvalds 2f64e70cd0 Second pull request for 4.16-rc
- Various driver bug fixes in mlx5, mlx4, bnxt_re and qedr, ranging
   from bugs under load to bad error case handling
 - There in one largish patch fixing the locking in bnxt_re to avoid
   a machine hard lock situation
 - A few core bugs on error paths
 - A patch to reduce stack usage in the new CQ API
 - One mlx5 regression introduced in this merge window
 - There were new syzkaller scripts written for the RDMA subsystem
   and we are fixing issues found by the bot
 - One of the commits (aa0de36a40 “RDMA/mlx5: Fix integer overflow
   while resizing CQ”) is missing part of the commit log message and
   one of the SOB lines.  The original patch was from Leon Romanovsky,
   and a cut-n-paste separator in the commit message confused patchworks
   which then put the end of message separator in the wrong place in
   the downloaded patch, and I didn’t notice in time.  The patch made
   it into the official branch, and the only way to fix it in-place
   was to rebase.  Given the pain that a rebase causes, and the fact
   that the patch has relevant tags for stable and syzkaller, a revert
   of the munged patch and a reapplication of the original patch with
   the log message intact was done.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJaoxYpAAoJELgmozMOVy/dPeoQAKUvtJzWaceuKdmNgh+Ut0qZ
 ZpaZIUwZsrrZAPOraxy36Q35vlzeb3AWLust3xTIHtb00tB55wgrWXo1KOPX4MhH
 AXDHCaYdjSdKewGo15zYXKAROs/BQ+ypoc3/jneqttTRtD0C93n0FpHb27k593Pu
 WzuvtqzVvLe11/IYk/lzlVHLuQRI1HIhUa2ygG/cFl1vLOcF1eY8Z+MdCS79uvv1
 s0FDB6yhIEcNaXGcDpIfQ6cJLVxLqBlvyCMB7Tok6Ss8Xk6383ZxXY/FrLkCMTo/
 rMiiWp9yhQ4hl+7NuO/KUWoeFuswjZso2vzerTe0DKdvAHO8fNNuC/Y6SuliEim7
 So7XVAFa0PArxw+/6sr8+nHkH0+O785xPU4qTgMRb9LyDw/Te7st1BHGJLuoNdER
 SM8LHKCd0LvP2hvi8fQpJNzfAqexaiJYqZlI3n+VdfyMZw6+IG8gGeNMQ1fKStF6
 rUve9+h91h7rW6W+jXOQwsMiMfSJLiKwtjapo6HRKYS3FUVd/wIdbjkNIc7rmgUy
 KI3zLanyfzOCFN5W8w4BBud25ibmxxuQMsZgx4oQUVYFWgosnQqTCAUNVlT2Pxou
 33yoWiwwcWZG3ATa5EfIBl1anqQP+mq7DxfQ6a/j1PNDl2Dh4DHWW1qwlhuIK8EU
 BYqPcWOFdk+DgGMjDJju
 =ZvN0
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Pull rdma fixes from Doug Ledford:

 - Various driver bug fixes in mlx5, mlx4, bnxt_re and qedr, ranging
   from bugs under load to bad error case handling

 - There in one largish patch fixing the locking in bnxt_re to avoid a
   machine hard lock situation

 - A few core bugs on error paths

 - A patch to reduce stack usage in the new CQ API

 - One mlx5 regression introduced in this merge window

 - There were new syzkaller scripts written for the RDMA subsystem and
   we are fixing issues found by the bot

 - One of the commits (aa0de36a40 “RDMA/mlx5: Fix integer overflow
   while resizing CQ”) is missing part of the commit log message and one
   of the SOB lines. The original patch was from Leon Romanovsky, and a
   cut-n-paste separator in the commit message confused patchworks which
   then put the end of message separator in the wrong place in the
   downloaded patch, and I didn’t notice in time. The patch made it into
   the official branch, and the only way to fix it in-place was to
   rebase. Given the pain that a rebase causes, and the fact that the
   patch has relevant tags for stable and syzkaller, a revert of the
   munged patch and a reapplication of the original patch with the log
   message intact was done.

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (25 commits)
  RDMA/mlx5: Fix integer overflow while resizing CQ
  Revert "RDMA/mlx5: Fix integer overflow while resizing CQ"
  RDMA/ucma: Check that user doesn't overflow QP state
  RDMA/mlx5: Fix integer overflow while resizing CQ
  RDMA/ucma: Limit possible option size
  IB/core: Fix possible crash to access NULL netdev
  RDMA/bnxt_re: Avoid Hard lockup during error CQE processing
  RDMA/core: Reduce poll batch for direct cq polling
  IB/mlx5: Fix an error code in __mlx5_ib_modify_qp()
  IB/mlx5: When not in dual port RoCE mode, use provided port as native
  IB/mlx4: Include GID type when deleting GIDs from HW table under RoCE
  IB/mlx4: Fix corruption of RoCEv2 IPv4 GIDs
  RDMA/qedr: Fix iWARP write and send with immediate
  RDMA/qedr: Fix kernel panic when running fio over NFSoRDMA
  RDMA/qedr: Fix iWARP connect with port mapper
  RDMA/qedr: Fix ipv6 destination address resolution
  IB/core : Add null pointer check in addr_resolve
  RDMA/bnxt_re: Fix the ib_reg failure cleanup
  RDMA/bnxt_re: Fix incorrect DB offset calculation
  RDMA/bnxt_re: Unconditionly fence non wire memory operations
  ...
2018-03-10 08:38:01 -08:00
Linus Torvalds b3337a6c35 platform-drivers-x86 for v4.16-6
Correct a module loading race condition between the DELL_SMBIOS backend
 modules and the first user by converting them to bool features of the
 DELL_SMBIOS driver. Fixup the resulting Kconfig dependency issue with
 DCDBAS.
 
 The following is an automated git shortlog grouped by driver:
 
  -  Resolve dependency error on DCDBAS
  -  Allow for SMBIOS backend defaults
  -  Link all dell-smbios-* modules together
  -  Rename dell-smbios source to dell-smbios-base
  -  Correct some style warnings
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJaot3AAAoJEKbMaAwKp364dmgIAIfHTsJK43WBdhiA8t+ZR2eI
 vW6gWOmTR0srhybgBFh+yNd0ljH4Ogb/JUrFuF6cemtpWxTJC+KS0gZWbHFw/5w5
 OsovY0/8AVtC7IFVe0HH3w3fZwsGGq4H/LU1K580cRF/YYzMVXnr2ASkIqn/EUzS
 voeAuL23JYvq+ByAqqKmA3tN7/+YpMrt5MPkJHk/MGnGxspTapcMvEK/fkYSlDWa
 MpWuKWqfFMM02sV37zyNQYaU64+5/FtGL/2OwsuMD6OgCism+FS/gPhR1JYLtPbd
 GKJoSfWqn2cMnLTA+1V9ya0zvGAwK4AdIoe4Cjg49pITXZneNfw+NzoQUe12Yg4=
 =FAX7
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v4.16-6' of git://git.infradead.org/linux-platform-drivers-x86

Pull x86 platform driver fixes from Darren Hart:
 "Correct a module loading race condition between the DELL_SMBIOS
  backend modules and the first user by converting them to bool features
  of the DELL_SMBIOS driver. Fixup the resulting Kconfig dependency
  issue with DCDBAS"

* tag 'platform-drivers-x86-v4.16-6' of git://git.infradead.org/linux-platform-drivers-x86:
  platform/x86: dell-smbios: Resolve dependency error on DCDBAS
  platform/x86: Allow for SMBIOS backend defaults
  platform/x86: dell-smbios: Link all dell-smbios-* modules together
  platform/x86: dell-smbios: Rename dell-smbios source to dell-smbios-base
  platform/x86: dell-smbios: Correct some style warnings
2018-03-10 08:35:29 -08:00
Takashi Iwai a2ff19f7b7 ALSA: seq: Clear client entry before deleting else at closing
When releasing a client, we need to clear the clienttab[] entry at
first, then call snd_seq_queue_client_leave().  Otherwise, the
in-flight cell in the queue might be picked up by the timer interrupt
via snd_seq_check_queue() before calling snd_seq_queue_client_leave(),
and it's delivered to another queue while the client is clearing
queues.  This may eventually result in an uncleared cell remaining in
a queue, and the later snd_seq_pool_delete() may need to wait for a
long time until the event gets really processed.

By moving the clienttab[] clearance at the beginning of release, any
event delivery of a cell belonging to this client will fail at a later
point, since snd_seq_client_ptr() returns NULL.  Thus the cell that
was picked up by the timer interrupt will be returned immediately
without further delivery, and the long stall of snd_seq_delete_pool()
can be avoided, too.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-10 17:30:01 +01:00
Takashi Iwai d0f8330652 ALSA: seq: Fix possible UAF in snd_seq_check_queue()
Although we've covered the races between concurrent write() and
ioctl() in the previous patch series, there is still a possible UAF in
the following scenario:

A: user client closed		B: timer irq
  -> snd_seq_release()		  -> snd_seq_timer_interrupt()
    -> snd_seq_free_client()	    -> snd_seq_check_queue()
				      -> cell = snd_seq_prioq_cell_peek()
      -> snd_seq_prioq_leave()
         .... removing all cells
      -> snd_seq_pool_done()
         .... vfree()
				      -> snd_seq_compare_tick_time(cell)
				         ... Oops

So the problem is that a cell is peeked and accessed without any
protection until it's retrieved from the queue again via
snd_seq_prioq_cell_out().

This patch tries to address it, also cleans up the code by a slight
refactoring.  snd_seq_prioq_cell_out() now receives an extra pointer
argument.  When it's non-NULL, the function checks the event timestamp
with the given pointer.  The caller needs to pass the right reference
either to snd_seq_tick or snd_seq_realtime depending on the event
timestamp type.

A good news is that the above change allows us to remove the
snd_seq_prioq_cell_peek(), too, thus the patch actually reduces the
code size.

Reviewed-by: Nicolai Stange <nstange@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-10 17:29:49 +01:00
Linus Torvalds cdb06e9d8f KVM fixes for v4.16-rc5
PPC:
  - Fix guest time accounting in the host
  - Fix large-page backing for radix guests on POWER9
  - Fix HPT guests on POWER9 backed by 2M or 1G pages
  - Compile fixes for some configs and gcc versions
 
 s390:
  - Fix random memory corruption when running as guest2 (e.g. KVM in
    LPAR) and starting guest3 (e.g. nested KVM) with many CPUs
  - Export forgotten io interrupt delivery statistics counter
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABCAAGBQJaoupNAAoJEED/6hsPKofoT2gH/1P6cNF3Gz3T7fetuan5Tyhw
 o5zduUxkM2AmTxzim9GPsKc5nsnPMnDraHCpQ9O2WW6VHvRZ6pwgtbtEtF2cx2Hv
 70o5gQzap/odA8eoV98xRbZ+aZHrZgs/z2Ql5eXk32BIs57TOQZVQ/mW+BA4Ixos
 8lOLYXuNY0lSL7Cp0MBY76ed8100ZTp7sfFByg3AmWDy7qhYOk9C3wPYNqPNfkuB
 eqZ9XPKV3vJuqc2xSJvsW4DjBcqZTxqDbw+EOA3MuUMH/JRkt7OuPgQHl/G5BqAW
 JcLb8ENfXNbamiakvarVenvnAJKJTLs8s9K8Z8ADXolY6NlGysGcrJo5dnGWN5A=
 =UxpG
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull KVM fixes from Radim Krčmář:
 "PPC:

   - Fix guest time accounting in the host

   - Fix large-page backing for radix guests on POWER9

   - Fix HPT guests on POWER9 backed by 2M or 1G pages

   - Compile fixes for some configs and gcc versions

  s390:

   - Fix random memory corruption when running as guest2 (e.g. KVM in
     LPAR) and starting guest3 (e.g. nested KVM) with many CPUs

   - Export forgotten io interrupt delivery statistics counter"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: s390: fix memory overwrites when not using SCA entries
  KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN
  KVM: PPC: Book3S HV: Fix VRMA initialization with 2MB or 1GB memory backing
  KVM: PPC: Book3S HV: Fix handling of large pages in radix page fault handler
  KVM: s390: provide io interrupt kvm_stat
  KVM: PPC: Book3S: Fix compile error that occurs with some gcc versions
  KVM: PPC: Fix compile error that occurs when CONFIG_ALTIVEC=n
2018-03-09 16:59:19 -08:00
Linus Torvalds 39614481fb xen: fix for V4.16-rc5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQEcBAABAgAGBQJaotGdAAoJELDendYovxMvzPoIAJ/wdIyikhIl4gFRY3dNJUfk
 iPfqmzc5y6zqVMYOHXy4aM1WsNqSJjzHQPNQQ/EgPC6EwvqnbRKTA1Z+06t8idtx
 RsjmQaiXUo+Rdo0QnuFUEZYwrec74GasujsnLy/CJcJOK6bULyoCETDluU6cXUJ1
 VcETKTselFPb19Hah6SNOkKn00J6ZYLddpF9RcYEpbln7cAzWKTvd0B/kNW24ToM
 OkH4m0qO0OzNHxLO31ZG2H/C8VukscQO7PTdcECenjkXnyztfkoLzCJswd7hGIDE
 JmQJgWKALZfPtwqFztC1bu7Y0N+aOxChggaXxKPlytmfs083EGFZ8H5SYZnhugs=
 =mXIM
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-4.16a-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fix from Juergen Gross:
 "Just one fix for the correct error handling after a failed
  device_register()"

* tag 'for-linus-4.16a-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen: xenbus: use put_device() instead of kfree()
2018-03-09 16:54:18 -08:00
Linus Torvalds 4178802c77 arm64 fixes:
- The SMCCC firmware interface for the spectre variant 2 mitigation has
   been updated to allow the discovery of whether the CPU needs the
   workaround. This pull request relaxes the kernel check on the return
   value from firmware.
 
 - Fix the commit allowing changing from global to non-global page table
   entries which inadvertently disallowed other safe attribute changes.
 
 - Fix sleeping in atomic during the arm_perf_teardown_cpu() code.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAlqi040ACgkQa9axLQDI
 XvFnJQ//YTCYifVu7pBY50czqDjBZ8BONQJFtMCsz/id4fBeELrciN5jNklWXA/y
 yYg+9Rb4UAEomqCRJWRU6MdIx52UagWlJ2Cn0G5q48uMdY9YFCJ4V8M6IFikvSUp
 o0p6Ldhee4r2yv6iBs125c7vIW/4c3nrTb03nsEJrjesKjcW1JSrzuJ0Py+x6ZIP
 AMuZocGlUOZ3NlKTPTQqY//fFCBp/hjvYzgUmPpcSZE/3E5pLHoxAIkkLMsaXaLH
 eWAbT9/E3NfQoBX2xisp7fyfd5nXZZ5IfEFJC90Dtl+yMb4I3DPgmBXclGFC8Rxd
 YOyabVAx9vpyBPGa9h4EtwMSRmiNwLwKxfCcXii8gAV7lPDqOyzduQTeepNCv6iY
 ioPHnx3mEEpfEF8TCV0lXzcsPdQnkfQcciJGxoz31KQe3TIp1keGASfwbn/Q575S
 i8/pHg9PS1r18tQIrrm/0lnBvkiyBFiKxPgOaWk4GXFYNh34GS9+xnTOsTuGOgGg
 vjQ0gRIkseqOeVuZSwD6kkj0f70NsjreTOaXF8eCA4cpGIia+cGUAOPR1SKTF3o6
 XkDjCRpde0KZoon95qye0+mVVJHOPgLs5VXFEngF7HCbI6spXxMSKuKoRYUbXZQj
 ddXQeaPY0wisMWmerDM9jkbhaprNsKp7b9CGmZKWAYXaa6+Y93w=
 =jVvu
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:

 - The SMCCC firmware interface for the spectre variant 2 mitigation has
   been updated to allow the discovery of whether the CPU needs the
   workaround. This pull request relaxes the kernel check on the return
   value from firmware.

 - Fix the commit allowing changing from global to non-global page table
   entries which inadvertently disallowed other safe attribute changes.

 - Fix sleeping in atomic during the arm_perf_teardown_cpu() code.

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: Relax ARM_SMCCC_ARCH_WORKAROUND_1 discovery
  arm_pmu: Use disable_irq_nosync when disabling SPI in CPU teardown hook
  arm64: mm: fix thinko in non-global page table attribute check
2018-03-09 16:49:30 -08:00
Linus Torvalds ed3c4dff8d The Sphinx 1.7 release broke the build process for reasons that are mostly
our fault.  This is a single fix cherry-picked from docs-next that restores
 docs buildability for all supported Sphinx versions.
 -----BEGIN PGP SIGNATURE-----
 
 iQJDBAABCAAtFiEEUOvtSCFqLxY/7px3jc41VjAi5XoFAlqiyLMPHGNvcmJldEBs
 d24ubmV0AAoJEI3ONVYwIuV6ePoQAK68+ymsML3xptZ0KoWV0PEHJUI+Ajnejj8/
 8ikgQWrg/cYkOu+gd0X6L/BewsM3cZ7zo2a7wBM8xK4HSme86Uz522CVGFieB/VF
 SFSUjFknVi9a2Bi4WBwR33EYUjUi6yDMVVfojPgC+fninqx6G5RV+vQSxWArgM3y
 aJwZqiBG7SfLUUQ8656JAWfJgmnnxHPC6DyOfTBm/UvuJZmHYmbo/UbAUlpfWG7I
 eG1Ks6CsbC0cfIWR2cs/tQe1tymkRMlaZwdTzkP2prXJ9ivtjtPtgnIyyTNZ5Dn/
 Uouf5egQDeRI/gdJg9Qy3cXGMMCzRXCCbkm0bg9lCG4vFcOTqRUi9GKvV8/n8G8o
 BFNd7ycIbcUDK3+WdVZYrGk2tPB4sqs8VFaau6ESJpvqBXc7S3Nj9UN2fw9IteyO
 U5Z15pc/2Lp8nSy6lHqDb70Fmpu3ksbk1odMDyGkpsO3XgFD8pbXMlI8Niijcqjb
 i12JHm3zjyhSIX4XNk/e9OWrTtx7O5wCUqVDNsjhGHuUvuaMIpm/q05DrLNHyfsE
 06D8tvtYR1R/W9nVByAdbbGVJioaRPqJNLjYkYqQn6FnGHNr5WwI6Mli12hVhWAc
 UYjqF6iQg3myrmvKSj8NcIXKRIdRmfw3I02xflprbqa4SUfUTF61Xq61jRjv3PM5
 FlgNPFBw
 =SAyC
 -----END PGP SIGNATURE-----

Merge tag 'docs-4.16-fix' of git://git.lwn.net/linux

Pull Documentation build fix from Jonathan Corbet:
 "The Sphinx 1.7 release broke the build process for reasons that are
  mostly our fault.

  This is a single fix cherry-picked from docs-next that restores docs
  buildability for all supported Sphinx versions"

* tag 'docs-4.16-fix' of git://git.lwn.net/linux:
  Documentation/sphinx: Fix Directive import error
2018-03-09 16:45:57 -08:00
Linus Torvalds cfc79ae844 Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton:
 "8 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  lib/test_kmod.c: fix limit check on number of test devices created
  selftests/vm/run_vmtests: adjust hugetlb size according to nr_cpus
  mm/page_alloc: fix memmap_init_zone pageblock alignment
  mm/memblock.c: hardcode the end_pfn being -1
  mm/gup.c: teach get_user_pages_unlocked to handle FOLL_NOWAIT
  lib/bug.c: exclude non-BUG/WARN exceptions from report_bug()
  bug: use %pB in BUG and stack protector failure
  hugetlb: fix surplus pages accounting
2018-03-09 16:42:25 -08:00
Luis R. Rodriguez ac68b1b3b9 lib/test_kmod.c: fix limit check on number of test devices created
As reported by Dan the parentheses is in the wrong place, and since
unlikely() call returns either 0 or 1 it's never less than zero.  The
second issue is that signed integer overflows like "INT_MAX + 1" are
undefined behavior.

Since num_test_devs represents the number of devices, we want to stop
prior to hitting the max, and not rely on the wrap arround at all.  So
just cap at num_test_devs + 1, prior to assigning a new device.

Link: http://lkml.kernel.org/r/20180224030046.24238-1-mcgrof@kernel.org
Fixes: d9c6a72d6f ("kmod: add test driver to stress test the module loader")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-03-09 16:40:02 -08:00