1
0
Fork 0
Commit Graph

767680 Commits (512ddf7d7db056edfed3159ea7cb4e4a5eefddd4)

Author SHA1 Message Date
Linus Torvalds b2d44d145d five smb3/cifs fixes for stable (including for some leaks and memory overwrites) and also a few fixes for recent regressions in packet signing
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAltBFyMACgkQiiy9cAdy
 T1EwcAwAoflntkPJtDX1/Ch3fm4cwR/GHiOHJ3jXUUs5x1JVy2YMyIpojijcDB9q
 ifmc9ZEVdov5kJVJF4dz4HUhxDwPbZTgZdAwSaYUdbQepA0Nzu7k7ZaTfzWwzYTa
 AaGxNShfEWogBdhMjNPKHpIUfrnOEtosv6iLLN3iwkbypLH0f3z1Tye38+9wnDO/
 B0M64lf4gxMB7ZsjFoQIu9ZLZMlQgF9ISycPUUmahR6G9sTJaykfyTihTwOo8HUb
 zNA6hgW5lUxCpCc2eNwy2wFuLqwf3+t3JmWUgJoYqVCbscywtTScivZyNEO36/17
 4oFCExMuJ79TXBP9RyTFrYkNhsTTdAyfDOLWcsMVsAo+zHub1nqjm8ENlmGJ7ZAS
 ESdLY+E+59Hndb21Te1IVq7HZsmXKHU6UHxknXTaXFPlBIKeHbH7vtt5zUzq7lxW
 hDwPTmev+b7jOE/4+cR5WQItMxzZ+pW7Toc6f8gmN1IU2FJjEsTgNGy2n4Az5WyR
 pZAydSRd
 =x5ij
 -----END PGP SIGNATURE-----

Merge tag '4.18-rc3-smb3fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:
 "Five smb3/cifs fixes for stable (including for some leaks and memory
  overwrites) and also a few fixes for recent regressions in packet
  signing.

  Additional testing at the recent SMB3 test event, and some good work
  by Paulo and others spotted the issues fixed here. In addition to my
  xfstest runs on these, Aurelien and Stefano did additional test runs
  to verify this set"

* tag '4.18-rc3-smb3fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: Fix stack out-of-bounds in smb{2,3}_create_lease_buf()
  cifs: Fix infinite loop when using hard mount option
  cifs: Fix slab-out-of-bounds in send_set_info() on SMB2 ACE setting
  cifs: Fix memory leak in smb2_set_ea()
  cifs: fix SMB1 breakage
  cifs: Fix validation of signed data in smb2
  cifs: Fix validation of signed data in smb3+
  cifs: Fix use after free of a mid_q_entry
2018-07-07 18:31:34 -07:00
Linus Torvalds 4f572efde4 Revert an incorrect dma-mapping commit for 4.18-rc
-----BEGIN PGP SIGNATURE-----
 
 iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAltBWfgLHGhjaEBsc3Qu
 ZGUACgkQD55TZVIEUYMpehAAooNYwofaWWXrn2Q2aKIfqvsmbdDFXYnb3qY0anIs
 Y+UWS063p1QHd1ZJsyDL83zhfDhOKybs+1sZsDtTaEXL4+my3iRlcb1yyNgEUq68
 AKH/Lf0MSHLsFL/w5EiZgVpN2KpCIJRwiMRJ4smzNpOpDzyhPKF7yqk2Qg2fv9Fx
 hHWI/WyZm8GATXYn6JrI+iXVthicpBiXYjmW8X0+jJHnPsJrieNw2QJDacp2Mjy0
 b1nRKUxamUXwlZI7AI5Wmen2Y1y+c9Sdya3cT+iHWKQwGkaY2Pv+nwnxw/SrJ2KJ
 sGzYc77gb+SploEalhFSuYaJqYa2iP545ykHBt5cNhcwtJQ8BPIn1Uemvfb4twMw
 OtNDKVphQ1yw/lmeESxF28u1VPZB2p14w7DSv4Kkg3rkd0IB+Cn/A40P4ZGICAsY
 7nxs1FqOTj5ivGWERdEGZOwp4CA1jRhNVMHpsleQl/OkJuK0Tb3Y/SX79XHslEQr
 UFt1MlQR/HuYrf97cqcgP2mtfH2LAU7WLbF9+6JgT05kbh8hB3lQo0iscjhv7etQ
 xzQkCPnyc3lwcAs4ftVGVP/PV7YdFFAa0dhrpKzcHYGEEtWh6GgsAtMXVqPRprki
 /bUVw6AR544WV2YfEPNc35lI8xrWgpqWCHYITSoNCXL9X3m2C8sgoonj9MiVNkLl
 daU=
 =8ZHD
 -----END PGP SIGNATURE-----

Merge tag 'dma-mapping-4.18-3' of git://git.infradead.org/users/hch/dma-mapping

Pull dma-mapping fix from Christoph Hellwig:
 "Revert an incorrect dma-mapping commit for 4.18-rc"

* tag 'dma-mapping-4.18-3' of git://git.infradead.org/users/hch/dma-mapping:
  Revert "iommu/intel-iommu: Enable CONFIG_DMA_DIRECT_OPS=y and clean up intel_{alloc,free}_coherent()"
2018-07-07 17:55:16 -07:00
Adam Borowski 47a18a2dab scripts: teach extract-vmlinux about LZ4 and ZSTD
Note that the LZ4 signature is different than that of modern LZ4 as we
use the "legacy" format which suffers from some downsides like inability
to disable compression.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-08 09:32:32 +09:00
Linus Torvalds 89ac2233d3 dmaengine fixes for v4.18-rc4
- Driver fixes for k3dma (off by one), pl330 (burst residue granularity)
    and omap-dma (incorrect residue_granularity)
  - Sinan's email update
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJbQK31AAoJEHwUBw8lI4NHdHgQAKPIWGpcochq1D05xXYTtFeW
 8OZ5KxJKj1/fEKbdDVGSvptGRfIOKH//xeb1nFn1vCJh/B/3v25hF9x47m+Dds/l
 nckkzKzn88Q4M5sbiQI+Rzgr4QRnPEjai55GsC90u7U6HmRSUBAnBELc8+gE7z/r
 6XAuUYpnJ6JLjcF9CX8UnG8PzE3Hw4Z94b2t5gaHi0tZnQTwMQ91pH7EGVRwga4+
 M+Cmds7Tvi8w1RTOS3OfD+E7H3PqKx3rZA6w3SK4NZqCSp4zA+jySVKi28QDIxHD
 kIX4i5eZwiClEVAxBNN40Md8sh6BRz5HkOKJy3WL2o1vSLCZJwm9DfJwo1EzKKI/
 FOyIF+clPctNXHwuSnpBes4X3zjPBVcl04Ii3oX1qdrWMT5XyyD8F/Y4NrT3rixQ
 CqqsF7WJHNPUI+ZE+Jxwns5NXWQunpLoaY2cyt2f6DfXZsEtizlUcYhaO1J1SuQn
 UnG/L94l8wX8oemlNYhBf/LvHNlOKzfKqtYVEEHy3c14ONZpeCLc/+TSKaoBWRke
 NJ57Pjecde5w2Z56ZhG/oFwRilXraG62O1JkJTAFeDDLXx1UCl5nOCkCQqGxdMWM
 mDxLVUKzIjJ8DbWJcq3DlLDWVMt2Dbqy7LA7/AagHBnIS1uuv9mXiUQT7CiVDzzG
 8Ekz5Jas6etHn3++K5Mt
 =pPiU
 -----END PGP SIGNATURE-----

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

Pull dmaengine fixes from Vinod Koul:
 "We have few odd driver fixes and one email update change for you this
  time:

   - Driver fixes for k3dma (off by one), pl330 (burst residue
     granularity) and omap-dma (incorrect residue_granularity)

   - Sinan's email update"

* tag 'dmaengine-fix-4.18-rc4' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()
  dmaengine: pl330: report BURST residue granularity
  MAINTAINERS: Update email-id of Sinan Kaya
  dmaengine: ti: omap-dma: Fix OMAP1510 incorrect residue_granularity
2018-07-07 17:29:08 -07:00
Linus Torvalds ea9561cfc9 A couple of small fixes, one to the BMC side of things that fixes
an interrupt issue, and one oops fix if init fails in a certain
 way on the client driver.
 
 -corey
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJbP9SSAAoJEGHzjJCRm/+BSPIP/3R9/zKTfv11OIHWCWaKtZzc
 bb+W5IRddVSNiFHtCJPNuk09ZSRL5q60fNOtYiQvjVWhykzZPqd3ExqkQxFkyIKj
 cirN5iJvE/h28nxL/XOrzErqAFzFqJNY8fG32GeoWlwM4ahDz6vTjQOPwi0PKCbx
 xyiCqxquuFBtW1qgBcGKVxJAMd9w29UGOEY5q7ifzsNIVHk/jABDKdWrpGKWzxHk
 daRRv4lXFyYoKpXk+MDuVZItQMsVwX+91jWOHDCUPohBFYLXcMCf/XSaAlQg84UG
 ugYxT5T04r5WwPzg1WPnq/tYQDtUy4RziVG3CGkFVcTzoOdZpOg+CCRbUdcBWesQ
 PesXOtkRVua7Ccov3eNuCQND1SzqYvQDC2ynoMuC8FImaJ1E7rwuPvb9qGYmUKwt
 M29kfXYIB4WSqMo1DA+Ivf/THnHmaPQGP5mr1sq4xsirtJu1YJrV+ScQXPqO7139
 Kou/mTV6VxwbT+VFID5+sno8ao89g+NG+GgGwYLaBGmUPAuW8wA+OZ9jSTaVWCOb
 tFg8J4AttQ9QVcohXBGV8MClSWUdKtH3L/9x593PR3gT0uiRBmYXAMnFkcLQU8iH
 s/6evtJF8ykMTapiSQCDh8RLDogieHYQVgjSPvYC0KekpK88EysF4zT0mdoc/qOT
 fZYqzB5VJrOVh0ZEok33
 =lLfC
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-4.18-2' of git://github.com/cminyard/linux-ipmi

Pull IPMI fixes from Corey Minyard:
 "A couple of small fixes: one to the BMC side of things that fixes an
  interrupt issue, and one oops fix if init fails in a certain way on
  the client driver"

* tag 'for-linus-4.18-2' of git://github.com/cminyard/linux-ipmi:
  ipmi: kcs_bmc: fix IRQ exception if the channel is not open
  ipmi: Cleanup oops on initialization failure
2018-07-07 17:15:38 -07:00
Linus Torvalds 43b6b6eca8 arm64 LDFLAGS clean-up:
- use aarch64elf instead of aarch64linux
 - move endianness options to LDFLAGS instead from LD
 - remove no-op '-p' linker flag
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAltAjncACgkQa9axLQDI
 XvFcOxAAqrNYMBnFJBbJEFhDmbLP7YMllM5zsTFjxolJYITCW66A/CZ6wSZdJgRe
 5Z5T0xKV6FLkYDxGpNioOcr2vFXuI8czE0uP1PjR2UxM49vCwVW7ytQKygOXnll4
 b80gq4cztiihhQGIIOaOv0x/z+V8ytMs5+YTPjJgmI23b1wKTM2+gk3kdXuJhuUO
 QdVcy5FXU9Ql7PNFa/SRNoja25V9ZXbKc8Itfvwg7H4pVJKgW6lmdJcomGCJWTTf
 2fyV7Nfd5svfAb+K2Wgf4GQEyuBNtpL68ePRhlwnBBd+uLmNAcSfHnPpPFQhQxZS
 rLkpYlk+5KJaQUwi7uXt1TQ4NZV++LIoFvOpdH+mgwLGVuJCDMN02VYthPItGcm+
 znT30CFOWcn4X7f07VRP3Xztg5/JOvYNcrZl4pL11l4y6BKFFqu2BY5QIS8gTYB7
 fequLd7J7QSf5hVzeo2rPkaKvrKfSgeaEfsUjN0vWW5DYvCdmgDzA/+aGyrEQb86
 hbFcUxTSUBYRz4OAPzc94UrhTKorpeP6OZiXiSe98SR+FbRlW2cvWSJMYkZ518EX
 nlFC/+YDlVCgXb8YMW6IvtEcdWdGyMxgaovm3tIfMZO5CfS7RvY6A8r80VDrUH1k
 DB3chrVsCtk0YujrZ69jQL7Jgf39ChkdIN+gTop5znHWCJlbZHE=
 =QXXd
 -----END PGP SIGNATURE-----

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

Pull arm64 LDFLAGS clean-up from Catalin Marinas:

 - use aarch64elf instead of aarch64linux

 - move endianness options to LDFLAGS instead from LD

 - remove no-op '-p' linker flag

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: remove no-op -p linker flag
  arm64: add endianness option to LDFLAGS instead of LD
  arm64: Use aarch64elf and aarch64elfb emulation mode variants
2018-07-07 10:51:25 -07:00
Jann Horn 15279df6f2 x86/mtrr: Don't copy out-of-bounds data in mtrr_write
Don't access the provided buffer out of bounds - this can cause a kernel
out-of-bounds read when invoked through sys_splice() or other things that
use kernel_write()/__kernel_write().

Fixes: 7f8ec5a4f0 ("x86/mtrr: Convert to use strncpy_from_user() helper")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180706215003.156702-1-jannh@google.com
2018-07-07 18:58:41 +02:00
Douglas Anderson 87ed1405ef nvmem: Don't let a NULL cell_id for nvmem_cell_get() crash us
In commit ca04d9d3e1 ("phy: qcom-qusb2: New driver for QUSB2 PHY on
Qcom chips") you can see a call like:

  devm_nvmem_cell_get(dev, NULL);

Note that the cell ID passed to the function is NULL.  This is because
the qcom-qusb2 driver is expected to work only on systems where the
PHY node is hooked up via device-tree and is nameless.

This works OK for the most part.  The first thing nvmem_cell_get()
does is to call of_nvmem_cell_get() and there it's documented that a
NULL name is fine.  The problem happens when the call to
of_nvmem_cell_get() returns -EINVAL.  In such a case we'll fall back
to nvmem_cell_get_from_list() and eventually might (if nvmem_cells
isn't an empty list) crash with something that looks like:

 strcmp
 nvmem_find_cell
 __nvmem_device_get
 nvmem_cell_get_from_list
 nvmem_cell_get
 devm_nvmem_cell_get
 qusb2_phy_probe

There are several different ways we could fix this problem:

One could argue that perhaps the qcom-qusb2 driver should be changed
to use of_nvmem_cell_get() which is allowed to have a NULL name.  In
that case, we'd need to add a patche to introduce
devm_of_nvmem_cell_get() since the qcom-qusb2 driver is using devm
managed resources.

One could also argue that perhaps we could just add a name to
qcom-qusb2.  That would be OK but I believe it effectively changes the
device tree bindings, so maybe it's a no-go.

In this patch I have chosen to fix the problem by simply not crashing
when a NULL cell_id is passed to nvmem_cell_get().

NOTE: that for the qcom-qusb2 driver the "nvmem-cells" property is
defined to be optional and thus it's expected to be a common case that
we would hit this crash and this is more than just a theoretical fix.

Fixes: ca04d9d3e1 ("phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07 17:30:25 +02:00
Mika Westerberg 007a74907d thunderbolt: Notify userspace when boot_acl is changed
The commit 9aaa3b8b4c ("thunderbolt: Add support for preboot ACL")
introduced boot_acl attribute but missed the fact that now userspace
needs to poll the attribute constantly to find out whether it has
changed or not. Fix this by sending notification to the userspace
whenever the boot_acl attribute is changed.

Fixes: 9aaa3b8b4c ("thunderbolt: Add support for preboot ACL")
Reported-and-tested-by: Christian Kellner <christian@kellner.me>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Christian Kellner <christian@kellner.me>
Acked-by: Yehezkel Bernat <yehezkelshb@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07 17:29:17 +02:00
Xiubo Li 57c5f4df0a uio: fix crash after the device is unregistered
For the target_core_user use case, after the device is unregistered
it maybe still opened in user space, then the kernel will crash, like:

[  251.163692] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[  251.163820] IP: [<ffffffffc0736213>] show_name+0x23/0x40 [uio]
[  251.163965] PGD 8000000062694067 PUD 62696067 PMD 0
[  251.164097] Oops: 0000 [#1] SMP
...
[  251.165605]  e1000 mptscsih mptbase drm_panel_orientation_quirks dm_mirror dm_region_hash dm_log dm_mod
[  251.166014] CPU: 0 PID: 13380 Comm: tcmu-runner Kdump: loaded Not tainted 3.10.0-916.el7.test.x86_64 #1
[  251.166381] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/19/2017
[  251.166747] task: ffff971eb91db0c0 ti: ffff971e9e384000 task.ti: ffff971e9e384000
[  251.167137] RIP: 0010:[<ffffffffc0736213>]  [<ffffffffc0736213>] show_name+0x23/0x40 [uio]
[  251.167563] RSP: 0018:ffff971e9e387dc8  EFLAGS: 00010282
[  251.167978] RAX: 0000000000000000 RBX: ffff971e9e3f8000 RCX: ffff971eb8368d98
[  251.168408] RDX: ffff971e9e3f8000 RSI: ffffffffc0738084 RDI: ffff971e9e3f8000
[  251.168856] RBP: ffff971e9e387dd0 R08: ffff971eb8bc0018 R09: 0000000000000000
[  251.169296] R10: 0000000000001000 R11: ffffffffa09d444d R12: ffffffffa1076e80
[  251.169750] R13: ffff971e9e387f18 R14: 0000000000000001 R15: ffff971e9cfb1c80
[  251.170213] FS:  00007ff37d175880(0000) GS:ffff971ebb600000(0000) knlGS:0000000000000000
[  251.170693] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  251.171248] CR2: 0000000000000008 CR3: 00000000001f6000 CR4: 00000000003607f0
[  251.172071] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  251.172640] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  251.173236] Call Trace:
[  251.173789]  [<ffffffffa0c9b2d3>] dev_attr_show+0x23/0x60
[  251.174356]  [<ffffffffa0f561b2>] ? mutex_lock+0x12/0x2f
[  251.174892]  [<ffffffffa0ac6d9f>] sysfs_kf_seq_show+0xcf/0x1f0
[  251.175433]  [<ffffffffa0ac54e6>] kernfs_seq_show+0x26/0x30
[  251.175981]  [<ffffffffa0a63be0>] seq_read+0x110/0x3f0
[  251.176609]  [<ffffffffa0ac5d45>] kernfs_fop_read+0xf5/0x160
[  251.177158]  [<ffffffffa0a3d3af>] vfs_read+0x9f/0x170
[  251.177707]  [<ffffffffa0a3e27f>] SyS_read+0x7f/0xf0
[  251.178268]  [<ffffffffa0f648af>] system_call_fastpath+0x1c/0x21
[  251.178823] Code: 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 53 48 89 d3 e8 7e 96 56 e0 48 8b 80 d8 02 00 00 48 89 df 48 c7 c6 84 80 73 c0 <48> 8b 50 08 31 c0 e8 e2 67 44 e0 5b 48 98 5d c3 0f 1f 00 66 2e
[  251.180115] RIP  [<ffffffffc0736213>] show_name+0x23/0x40 [uio]
[  251.180820]  RSP <ffff971e9e387dc8>
[  251.181473] CR2: 0000000000000008

CC: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
CC: Mike Christie <mchristi@redhat.com>
Reviewed-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07 16:57:35 +02:00
Xiubo Li 543af5861f uio: change to use the mutex lock instead of the spin lock
We are hitting a regression with the following commit:

commit a93e7b3315
Author: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Date:   Mon May 14 13:32:23 2018 +1200

    uio: Prevent device destruction while fds are open

The problem is the addition of spin_lock_irqsave in uio_write. This
leads to hitting  uio_write -> copy_from_user -> _copy_from_user ->
might_fault and the logs filling up with sleeping warnings.

I also noticed some uio drivers allocate memory, sleep, grab mutexes
from callouts like open() and release and uio is now doing
spin_lock_irqsave while calling them.

Reported-by: Mike Christie <mchristi@redhat.com>
CC: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Reviewed-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07 16:57:35 +02:00
Xiubo Li 9421e45f5f uio: use request_threaded_irq instead
Prepraing for changing to use mutex lock.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07 16:57:35 +02:00
Christophe Jaillet 122c5770cf fpga: altera-cvp: Fix an error handling path in 'altera_cvp_probe()'
If 'fpga_mgr_create()' fails, we should release some resources, as done
in the other error handling path of the function.

Fixes: 7085e2a94f ("fpga: manager: change api, don't use drvdata")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
Acked-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07 16:55:22 +02:00
Daniel Mack 0c1049dcb4 ARM: pxa: irq: fix handling of ICMR registers in suspend/resume
PXA3xx platforms have 56 interrupts that are stored in two ICMR
registers. The code in pxa_irq_suspend() and pxa_irq_resume() however
does a simple division by 32 which only leads to one register being
saved at suspend and restored at resume time. The NAND interrupt
setting, for instance, is lost.

Fix this by using DIV_ROUND_UP() instead.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
2018-07-07 13:25:15 +02:00
Jann Horn a0341fc198 ibmasm: don't write out of bounds in read handler
This read handler had a lot of custom logic and wrote outside the bounds of
the provided buffer. This could lead to kernel and userspace memory
corruption. Just use simple_read_from_buffer() with a stack buffer.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07 09:59:35 +02:00
Linus Torvalds 624434af25 SCSI fixes on 20180706
This is two minor bug fixes (aacraid, target) and a fix for a
 potential exploit in the way sg handles teardown.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCWz/hBSYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishUkIAP9JKGYO
 rcoNxusKsTi6tMEeUFzX1Mu0IkUr9ApcsCJMyAEAyRL5+b77PoZG8NgQBBo99iFE
 8DMbxsNbBMbTzDqbfzk=
 =ttS3
 -----END PGP SIGNATURE-----

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

Pull SCSI fixes from James Bottomley:
 "This is two minor bug fixes (aacraid, target) and a fix for a
  potential exploit in the way sg handles teardown"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: sg: mitigate read/write abuse
  scsi: aacraid: Fix PD performance regression over incorrect qd being set
  scsi: target: Fix truncated PR-in ReadKeys response
2018-07-06 19:45:47 -07:00
Linus Torvalds 29119529d8 for-linus-20180706
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAltAFSMQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpleLD/4qr8zm9EvQbdg3KFyvePehlAuEKkEp1jrk
 wf6LQ9Uc+bNbnXCvxk+U3tXiPDmFOMakZBAyjDFLxL6ArfSEqymJMg1JxXUYwq3l
 tESQNNHjZBZaRpv5YuRLwDPpEivGlA80AE+2tkNTXDaGxRHahZnqV6/eUk1YAtbw
 N1ADOS+EquS/p2DH07QhLqKNWecz6SSr9R+oVU6if1ivC3T0uZbTmKMtUspZEwv/
 2AZr6my0DSk15FdFAGpDaDjPMO26VlWaOrQPXH30/63KysWR2NNuasKVGjcmGSjC
 9/aJREC1BE/hcDSNmu8MhFaL2JFy2F3l7VJzdXlYFbpP0OC6hqdlXPl+CKP43w2L
 iO2N4g+2DbXOf6Si7NtArZMQfY/PQipbcj7Y8o9sq0P6VNO9+csGHzwa8tCQSEi9
 CtinHYV8L7YyopZYRvgRaX1ND3S7ClFRFX9kkAmTA5iOHHJtaKUexKOHu+Pvn5zi
 3/O2y6U7F34CkM5C92+nvTTTPx6bTgs8U9c+V3Eut9InroQAU/SwvH/NsT67fFsu
 FcTWKfQ0HGgcsAxOAN2/vEztgZvu6kwhu3KkkQmt2Qy7B9dtBf44pTdv0b+RsPPq
 Ow/PtFaHK7lwxsGlrqXLdmvqlmJs8DXcc2TQw/JX8lPIc04Hs3ZpxMyt6wSDJToL
 OCZ2cY/bRg==
 =pge/
 -----END PGP SIGNATURE-----

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

Pull block fixes from Jens Axboe:
 "Two minor fixes for this series:

   - add LOOP_SET_BLOCK_SIZE as compat ioctl (Evan Green)

   - drbd use-after-free fix (Lars Ellenberg)"

* tag 'for-linus-20180706' of git://git.kernel.dk/linux-block:
  loop: Add LOOP_SET_BLOCK_SIZE in compat ioctl
  drbd: fix access after free
2018-07-06 19:13:42 -07:00
Linus Torvalds c2b58149d2 The usual collection of driver fixlets:
- Build cleanup/fix for the sunxi makefile that tried to save size
    but failed and prevented dead code elimination from working
 
  - Two Davinci clk driver fixes for a typo causing build failures
    in different configurations and an error check that checks
    the wrong variable.
 
  - Undo the DT ABI breaking imx6ul binding header shuffle that got
    merged this cycle.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEE9L57QeeUxqYDyoaDrQKIl8bklSUFAls/q0ERHHNib3lkQGtl
 cm5lbC5vcmcACgkQrQKIl8bklSW3cA//W6ifpX36cjFATeR3A46V5If0ZXL61aog
 cXkh5wCofB3OFdBdJifHFmdDIKjc/7Ix0T3x9rfbMXABsaE2xS6R1ikF4mGl1Osm
 TQXmMJHN8cLM58XLf2A0fVjH3UV7KJ+F4s9N2giDi+PVjFTZDI4uL2KGopHUnUx0
 BppDhf8XH6cKDWepNzQ/uPukQSburZn/pvwjhPQmgVl2pJaUpGXsPAJ4vqTQKrqJ
 IS2iI+wgwHbcIHYtbtabSt18q9jaVQkshy5C0l6fYvXs35on9DnLNGv7hLYK/42i
 HSRr6P1F2HMVir/dyDmWVigqiC3mqEVRedaq6zfRka2FAvX+4NiYTsvXyZYV52Uc
 p68ywqDFdaUWkz5vIS5YyvKb+ynZqvKU9qUMTXigg4pk3xf21eyPOCz5emvcdQ6W
 Tm4muE3xOCMrfPKjDgymkVm6+S8JyeJFjh7lPZxK5NIXSEswlB0y9SOlkn6ycra1
 y3PaKSs/DLmKBuoCteJxuuujqaJM/qbTwYtwDht7tH0vIkrw5Q9YqOe7MqqdGVyl
 hhyqDs7ZtSw4Co5Mu4DDhmqgjwvwQVT3vpzoZyukakEBoQyWomCVFp28I6Ng+iX6
 6RzOEIdNFaNuDOg0kxzENblVPWRmcgv76yYF7JcfrRMhjeDmpYV2xlAEmjHRNp6p
 iZohOeq/X48=
 =pNsb
 -----END PGP SIGNATURE-----

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

Pull clk fixes from Stephen Boyd:
 "The usual collection of driver fixlets:

   - build cleanup/fix for the sunxi makefile that tried to save size
     but failed and prevented dead code elimination from working

   - two Davinci clk driver fixes for a typo causing build failures in
     different configurations and an error check that checks the wrong
     variable.

   - undo the DT ABI breaking imx6ul binding header shuffle that got
     merged this cycle"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  dt-bindings: clock: imx6ul: Do not change the clock definition order
  clk: davinci: fix a typo (which leads to build failures)
  clk: davinci: cfgchip: testing the wrong variable
  clk: sunxi-ng: replace lib-y with obj-y
2018-07-06 12:32:17 -07:00
Linus Torvalds 1bb155702d VFIO fixes for v4.18
- Make vfio-pci IGD extensions optional via Kconfig (Alex Williamson)
 
  - Remove unused and soon to be removed map_atomic callback from mbochs
    sample driver, add unmap callback to avoid dmabuf leaks (Gerd Hoffmann)
 
  - Fix usage of get_user_pages_longterm() (Jason Gunthorpe)
 
  - Fix sample mbochs driver vm_operations_struct.fault return type
    (Souptick Joarder)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJbP5NzAAoJECObm247sIsibX8QAJnJ+p88yIhozwmzIyZdy/rN
 zHNo+jSKlyGYmm1GWg77h+UfmVzLPI1eQZUsVt1L582J1M1/cpjiiPLPq/HGMQlw
 kG+9sMxqcux92En5D6nJF8wF/DXSWLxRSv0YTgjLTzhx6d473VYHKBZA/VJa0wBD
 /lj7Mdhbs5FrAwIfZCTyodRvkE21rE63pcS4KnNayjiIIlbiBKV8n+RZ0ayl8Qqp
 oycEMOLo2yF5New2/AK/RAWeCFfiyAgXaFjAor1jD3kiA/PUNs+HpUnbUqjWyj36
 ogI81gZqe1XVrEKaAcESalpldQP3lggxC1QmwhSdOzAjKNRA4qMnvuRr3XyFxXM5
 PsBdqmdmavRTX23rTAViAhlrwwukWaICAU8p2UxVobS3IEEzaG+DHhxOmeeoYF1v
 5fjlf0D1jOaKnYmdEhsLKDEbJ5NCj2qjkkQNA3/MHoyjdmz1ZuonK9oap/OBrPkK
 IB1gSuKUNwsCNyN18c6RBnWagprAEbMR6i35SVEf0VIgM6UI2Ld4aUTDczqObU/L
 T1vgkbp8DkAX8O7TZ29eMm/ieyUZ01pgYuxjnK1MYLR1byuOwI1WpYjQfo1JPtmJ
 TJH5YbGUqznJUZXrkB6CuUCXX3MkG2KU9CZVJU0MwGYuRUvJz5Tk4+ODbpoqDHby
 v1cQJdVywzi8BkacW1DZ
 =shTo
 -----END PGP SIGNATURE-----

Merge tag 'vfio-v4.18-rc4' of git://github.com/awilliam/linux-vfio

Pull VFIO fixes from Alex Williamson:

 - Make vfio-pci IGD extensions optional via Kconfig (Alex Williamson)

 - Remove unused and soon to be removed map_atomic callback from mbochs
   sample driver, add unmap callback to avoid dmabuf leaks (Gerd
   Hoffmann)

 - Fix usage of get_user_pages_longterm() (Jason Gunthorpe)

 - Fix sample mbochs driver vm_operations_struct.fault return type
   (Souptick Joarder)

* tag 'vfio-v4.18-rc4' of git://github.com/awilliam/linux-vfio:
  sample/vfio-mdev: Change return type to vm_fault_t
  vfio: Use get_user_pages_longterm correctly
  sample/mdev/mbochs: add mbochs_kunmap_dmabuf
  sample/mdev/mbochs: remove mbochs_kmap_atomic_dmabuf
  vfio/pci: Make IGD support a configurable option
2018-07-06 12:23:53 -07:00
Linus Torvalds b4d0562137 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Martin Schwidefsky:
 "A few more changes for v4.18:

   - wire up the two new system calls io_pgetevents and rseq

   - fix a register corruption in the expolines code for machines
     without EXRL

   - drastically reduce the memory utilization of the dasd driver

   - fix reference counting for KVM page table pages"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390: wire up rseq system call
  s390: wire up io_pgetevents system call
  s390/mm: fix refcount usage for 4K pgste
  s390/dasd: reduce the default queue depth and nr of hardware queues
  s390: Correct register corruption in critical section cleanup
2018-07-06 09:14:34 -07:00
Ping-Ke Shih d59d2f9995 staging: r8822be: Fix RTL8822be can't find any wireless AP
RTL8822be can't bring up properly on ASUS X530UN, and dmesg says:
[ 8.591333] r8822be: module is from the staging directory, the quality
is unknown, you have been warned.
[ 8.593122] r8822be 0000:02:00.0: enabling device (0000 -> 0003)
[ 8.669163] r8822be: Using firmware rtlwifi/rtl8822befw.bin
[ 9.289939] r8822be: rtlwifi: wireless switch is on
[ 10.056426] r8822be 0000:02:00.0 wlp2s0: renamed from wlan0
...
[ 11.952534] r8822be: halmac_init_hal failed
[ 11.955933] r8822be: halmac_init_hal failed
[ 11.956227] r8822be: halmac_init_hal failed
[ 22.007942] r8822be: halmac_init_hal failed

Jian-Hong reported it works if turn off ASPM with module parameter aspm=0.
In order to fix this problem kindly, this commit don't turn off aspm but
enlarge ASPM L1 latency to 7.

Reported-by: Jian-Hong Pan <jian-hong@endlessm.com>
Tested-by: Jian-Hong Pan <jian-hong@endlessm.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-06 17:44:35 +02:00
Jann Horn f1e255d60a USB: yurex: fix out-of-bounds uaccess in read handler
In general, accessing userspace memory beyond the length of the supplied
buffer in VFS read/write handlers can lead to both kernel memory corruption
(via kernel_read()/kernel_write(), which can e.g. be triggered via
sys_splice()) and privilege escalation inside userspace.

Fix it by using simple_read_from_buffer() instead of custom logic.

Fixes: 6bc235a2e2 ("USB: add driver for Meywa-Denki & Kayac YUREX")
Signed-off-by: Jann Horn <jannh@google.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-06 17:21:34 +02:00
Baruch Siach 568cc2f07c ARM: dts: armada-38x: use the new thermal binding
Commit 2f28e4c24b (thermal: armada: Clarify control registers
accesses) introduced the new thermal binding. The new binding extends
the second registers field size to 8. Switch to the new binding to fix
thermal reading values. Without this change the fix for errata #132698
introduced in commit 8c0b888f66 (thermal: armada: Change sensors trim
default value) has no effect.

Cc: stable@vger.kernel.org # v4.16+
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
2018-07-06 16:50:48 +02:00
Nico Sneck bba57eddad usb: quirks: add delay quirks for Corsair Strafe
Corsair Strafe appears to suffer from the same issues
as the Corsair Strafe RGB.
Apply the same quirks (control message delay and init delay)
that the RGB version has to 1b1c:1b15.

With these quirks in place the keyboard works correctly upon
booting the system, and no longer requires reattaching the device.

Signed-off-by: Nico Sneck <snecknico@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-06 16:28:31 +02:00
Dan Carpenter 313db3d648 xhci: xhci-mem: off by one in xhci_stream_id_to_ring()
The > should be >= here so that we don't read one element beyond the end
of the ep->stream_info->stream_rings[] array.

Fixes: e9df17eb14 ("USB: xhci: Correct assumptions about number of rings per endpoint.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-06 16:28:31 +02:00
Arnd Bergmann aaa8fee7df usb/gadget: aspeed-vhub: add USB_LIBCOMPOSITE dependency
Without that option, we run into a link failure:

drivers/usb/gadget/udc/aspeed-vhub/hub.o: In function `ast_vhub_std_hub_request':
hub.c:(.text+0x5b0): undefined reference to `usb_gadget_get_string'

Fixes: 7ecca2a408 ("usb/gadget: Add driver for Aspeed SoC virtual hub")
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-06 16:28:31 +02:00
Laurentiu Tudor c0addc9a5b docs: kernel-parameters.txt: document xhci-hcd.quirks parameter
This parameter introduced several years ago in the XHCI host controller
driver was somehow left undocumented. Add a few lines in the kernel
parameters text.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-06 16:28:30 +02:00
Greg Kroah-Hartman e3ebc3ad0c USB-serial fixes for v4.18-rc4
Here are three fixes for broken control-transfer error handling, which
 could lead to uninitialised slab data leaking to user space.
 
 Included is also a new device id for cp210x.
 
 All but the final two patches have been in linux-next with no reported
 issues.
 
 Signed-off-by: Johan Hovold <johan@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEHszNKQClByu0A+9RQQ3kT97htJUFAls/WXIRHGpvaGFuQGtl
 cm5lbC5vcmcACgkQQQ3kT97htJVJTRAAgUB0WpRYEZQs8d/Du/dRRxHvUmmwAPBn
 u1RXFX/JtErMh40BjUnDSRrqaEBaN4LXwLpZ4r8eth8nwHdPjHm2vxa9WJYZ7szt
 BL7Nkf3V9PZuJpJ8G8sfHyeF9cAPOygFwWeKHRn4Izmz2cKaF9FmKrVOkD5pIdr3
 UjevLXtTJNOqlTNI0jvRx9MVfMjEZOm9vSzH6JXdxHJXhNnp71HN1hbW2/fGPdNy
 DFVWAFKZktFSaObIzNGMHZm4sfSrsgzmqv1T7PiphlQ+a81mV+RzDh+DykEkOHtJ
 rOFwFg3c0HEh/3WNilxc8ifqoqwTVTQOVT0ntrN2gHsodaG11GAe7uetMq/XNUjt
 oTLZWcMINMaoRp9uYMCbQAqeDijISpnSVpotb1x41poadroEw9ZpW1QPoWIBh9Bc
 N/Ohg8/mv0m6hYNiHSMqM4r/jLD/CnZeTT8n2K7pa3TrENofUlzUgrWInzQiyQTQ
 TqfARy053xOOnRPRz8kgAhi64Bae4rJ4kYuWn5GIBku5iFtMH9HwXRX6jNXZv0IK
 /LA0M7QoBPYaZv0EUYxKCXtqOOmx76abIn3xHAzMJjyiTDR0ww/K2T539pH2R4KZ
 i51dRO1YEcLnDHTPbCmKtMN3viahjb2ZNa4gDUq7vaZ5RAMM6ee+XVBHRfI9xUDD
 /MTNKBWai64=
 =UDQ5
 -----END PGP SIGNATURE-----

Merge tag 'usb-serial-4.18-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

USB-serial fixes for v4.18-rc4

Here are three fixes for broken control-transfer error handling, which
could lead to uninitialised slab data leaking to user space.

Included is also a new device id for cp210x.

All but the final two patches have been in linux-next with no reported
issues.

Signed-off-by: Johan Hovold <johan@kernel.org>
2018-07-06 16:23:19 +02:00
Masahiro Yamada 6916162c73 kbuild: remove duplicated comments about PHONY
The comment is the same as in the top-level Makefile.

Also, the comments contain typos:
  - the .PHONY variable  ->  the PHONY variable
  - se we can ...        ->  so we can ...

Instead of fixing the typos, just remove the duplicated comments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-06 22:04:03 +09:00
Ulf Magnusson bd412d81b7 kbuild: .PHONY is not a variable, but PHONY is
.PHONY is a target, not a variable.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-06 22:04:02 +09:00
Masahiro Yamada 48f6e3cf5b kbuild: do not drop -I without parameter
The comment line for addtree says "skip if -I has no parameter".

What it actually does is "drop if -I has no parameter".  For example,
if you have the compiler flag '-I foo' (a space between), it will be
converted to 'foo'.  This completely changes the meaning.

What we want is, "do nothing" for -I without parameter so that
'-I foo' is kept as-is.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-06 22:04:02 +09:00
Randy Dunlap 00e0793f83 kbuild: document the KBUILD_KCONFIG env. variable
Add usage info for the Kbuild environment variable KBUILD_KCONFIG.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-06 22:04:01 +09:00
Randy Dunlap 452d4c8673 kconfig: update user kconfig tools doc.
Update Documentation/kbuild/kconfig.txt, which mostly contains
user help for using the kernel config tools.

- Add mention of 'nconfig' embedded help text.
- Make the section on new config symbols readable.
- Correct how to find menuconfig search help.
- Add section on 'nconfig' usage.
- Mention that gconfig has multiple viewing modes/options.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-06 22:04:01 +09:00
Randy Dunlap 3f9cdee592 kbuild: delete INSTALL_FW_PATH from kbuild documentation
Removed Kbuild documentation for INSTALL_FW_PATH.

The kbuild symbol INSTALL_FW_PATH was removed from Kbuild tools in
September 2017 (for 4.14) but the symbol was not deleted from
the kbuild documentation, so do that now.

Fixes: 5620a0d1aa ("firmware: delete in-kernel firmware")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: stable@vger.kernel.org # 4.14+
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-06 21:58:33 +09:00
Randy Dunlap 5ba800962a kbuild: update ARCH alias info for sparc
The supported alias for building sparc 32-bit is "sparc32",
not "sparc", so update the alias documentation for that.
Just using "sparc" produces a 64-bit config file.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-06 21:58:33 +09:00
Randy Dunlap 09b1565324 kbuild: update ARCH alias info for sh
In Kbuild documentation, add alias for 64-bit sh ARCH ("sh64")
to the list of ARCH aliases.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-06 21:58:33 +09:00
Hui Wang c6b17f1020 ALSA: hda/realtek - two more lenovo models need fixup of MIC_LOCATION
We have two new lenovo desktop models which need to apply the fixup of
ALC294_FIXUP_LENOVO_MIC_LOCATION, and they have the same pin cfg as
the machine with subsystem id:0x17aa3136, now use the pincfg table
to apply the fixup for them.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-06 12:49:10 +02:00
K. Y. Srinivasan 1268ed0c47 x86/hyper-v: Fix the circular dependency in IPI enlightenment
The IPI hypercalls depend on being able to map the Linux notion of CPU ID
to the hypervisor's notion of the CPU ID. The array hv_vp_index[] provides
this mapping. Code for populating this array depends on the IPI functionality.
Break this circular dependency.

[ tglx: Use a proper define instead of '-1' with a u32 variable as pointed
  	out by Vitaly ]

Fixes: 68bb7bfb79 ("X86/Hyper-V: Enable IPI enlightenments")
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Cc: gregkh@linuxfoundation.org
Cc: devel@linuxdriverproject.org
Cc: olaf@aepfle.de
Cc: apw@canonical.com
Cc: jasowang@redhat.com
Cc: hpa@zytor.com
Cc: sthemmin@microsoft.com
Cc: Michael.H.Kelley@microsoft.com
Cc: vkuznets@redhat.com
Link: https://lkml.kernel.org/r/20180703230155.15160-1-kys@linuxonhyperv.com
2018-07-06 12:32:59 +02:00
Johan Hovold 794744abff USB: serial: mos7840: fix status-register error handling
Add missing transfer-length sanity check to the status-register
completion handler to avoid leaking bits of uninitialised slab data to
user space.

Fixes: 3f5429746d ("USB: Moschip 7840 USB-Serial Driver")
Cc: stable <stable@vger.kernel.org>     # 2.6.19
Signed-off-by: Johan Hovold <johan@kernel.org>
2018-07-06 10:32:28 +02:00
Johan Hovold 01b3cdfca2 USB: serial: keyspan_pda: fix modem-status error handling
Fix broken modem-status error handling which could lead to bits of slab
data leaking to user space.

Fixes: 3b36a8fd67 ("usb: fix uninitialized variable warning in keyspan_pda")
Cc: stable <stable@vger.kernel.org>     # 2.6.27
Signed-off-by: Johan Hovold <johan@kernel.org>
2018-07-06 10:32:14 +02:00
Linus Torvalds c42c12a905 amdgpu, i915, exynos, udl, sii8620 and core fixes
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJbPsIxAAoJEAx081l5xIa+assP/3i3tpzxASSaONcMoIzNFSv7
 8IXTKIaQpoIidhlh4M4i4xhvDoSLzZnB9Y/ITw9a2piceyTB0Oa1VmxDeYp9PqR1
 jM5Vuqt+WUSoxYAvwdqxbeMuTHY3C2Ff3POcW/siG/Bl0HIV+ajdvPIsh/Gy0/b9
 Q1G0YzZgH7D/VHaUipdjDtsFY+f2YSgM3p618P2A/lDP8WRW66y4CUNDdPPQ+UjU
 hLFyumOvywVHtvuDToeQezHrvbAbeYunt9nGx8RzPgL9X6m5+uX68y+HSxhcxR5T
 rzb5ozeFLT6R+7VKbY9XgXHTxuMQDEeEQQge6iWMDyBGIhfixW3BoH462spkfaCB
 6YceH3y2SsfSOPGax1wmUCQVUAFvPuUYPZv1D356f8AEEtpRTkrqkMd4QuAF9L7M
 Yvx7fhbWjIw3G0m4Sj6HYyBjRDzBSz1QiIq9W05+4EghGQAJ/2TcsXx7BApZz9VH
 01UawXxsurG6Z7JuIXiG7CdSCYklqi3RMnBlDG9TLLfLqzwpwpPjdQ4m7KZQk2dN
 8FoQKMfjzZsuDFVXtCCNEOf9khImiE31335rLvDAIYPqEDmhJb1Xu6r6UWCMgQgx
 iEqCJ4SSWjR6wpwcWB4cZ+7Lb8QlmZ3JgqtaoJ3a23C5lIN4lgyrtrHHsGLb4+j2
 q0vL5pN3uqSCIOeBOpzk
 =v25Z
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2018-07-06' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "This is the drm fixes for rc4.

  It's a bit larger than I'd like but the exynos cleanups are pretty
  mechanical, and I'd rather have them in sooner rather than later so we
  can avoid too much conflicts around them. The non-mechanincal exynos
  changes are mostly fixes for new feature recently introduced.

  Apart from the exynos updates, we have:

  i915:
   - GVT and GGTT mapping fixes

  amdgpu:
   - fix HDMI2.0 4K@60 Hz regression
   - Hotplug fixes for dual-GPU laptops to make power management better
   - misc vega12 bios fixes, a race fix and some typos.

  sii8620 bridge:
   - small fixes around mode setting

  core:
   - use kvzalloc to allocate blob property memory"

* tag 'drm-fixes-2018-07-06' of git://anongit.freedesktop.org/drm/drm: (34 commits)
  drm/amd/display: add a check for display depth validity
  drm/amd/display: adding ycbcr420 pixel encoding for hdmi
  drm/udl: fix display corruption of the last line
  drm/bridge/sii8620: Fix link mode selection
  drm/bridge/sii8620: Fix display of packed pixel modes
  drm/bridge/sii8620: Send AVI infoframe in all MHL versions
  drm/amdgpu: fix user fence write race condition
  drm/i915: Try GGTT mmapping whole object as partial
  drm/amdgpu/pm: fix display count in non-DC path
  drm/amdgpu: fix swapped emit_ib_size in vce3
  drm: Use kvzalloc for allocating blob property memory
  drm/i915/gvt: changed DDI mode emulation type
  drm/i915/gvt: fix a bug of partially write ggtt enties
  drm/exynos: Replace drm_dev_unref with drm_dev_put
  drm/exynos: Replace drm_gem_object_unreference_unlocked with put function
  drm/exynos: Replace drm_framebuffer_{un/reference} with put,get functions
  drm/exynos: ipp: use correct enum type
  drm/exynos: decon5433: Fix WINCONx reset value
  drm/exynos: decon5433: Fix per-plane global alpha for XRGB modes
  drm/exynos: fimc: Use real buffer width for configuring the hardware
  ...
2018-07-05 19:43:29 -07:00
Dan Williams 33cc2c9667 acpi, nfit: Fix scrub idle detection
The notification of scrub completion happens within the scrub workqueue.
That can clearly race someone running scrub_show() and work_busy()
before the workqueue has a chance to flush the recently completed work.
Add a flag to reliably indicate the idle vs busy state. Without this
change applications using poll(2) to wait for scrub-completion may
falsely wakeup and read ARS as being busy even though the thread is
going idle and then hang indefinitely.

Fixes: bc6ba80858 ("nfit, address-range-scrub: rework and simplify ARS...")
Cc: <stable@vger.kernel.org>
Reported-by: Vishal Verma <vishal.l.verma@intel.com>
Tested-by: Vishal Verma <vishal.l.verma@intel.com>
Reported-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2018-07-05 19:33:53 -07:00
Linus Torvalds 97f4e14229 While cleaning out my INBOX, I found a few patches that were lost
in the noise. These are minor bug fixes and clean ups. Those include:
 
  - Avoiding a string overflow
  - Code that didn't match the comment (but should)
  - A small code optimization (use of a conditional)
  - Quieting printf warnings
  - Nuking unused code
  - Fixing function graph interrupt annotation
 -----BEGIN PGP SIGNATURE-----
 
 iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCWz7ARhQccm9zdGVkdEBn
 b29kbWlzLm9yZwAKCRAp5XQQmuv6qmMqAQDTS7uvFLRR603WXyOazX6Y7FeiYFWp
 MUUZjnbG9u0bawEAulW53AM0OL3EAAaZKtPi8VtsT+uktR1GIynXrp+yoww=
 =yQDv
 -----END PGP SIGNATURE-----

Merge tag 'trace-v4.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes and cleanups from Steven Rostedt:
 "While cleaning out my INBOX, I found a few patches that were lost in
  the noise. These are minor bug fixes and clean ups. Those include:

   - avoid a string overflow

   - code that didn't match the comment (but should)

   - a small code optimization (use of a conditional)

   - quiet printf warnings

   - nuke unused code

   - fix function graph interrupt annotation"

* tag 'trace-v4.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Fix missing return symbol in function_graph output
  ftrace: Nuke clear_ftrace_function
  tracing: Use __printf markup to silence compiler
  tracing: Optimize trace_buffer_iter() logic
  tracing: Make create_filter() code match the comments
  tracing: Avoid string overflow
2018-07-05 19:29:07 -07:00
Dave Airlie c78d1f9d95 Fixups
- Fix several problems to IPPv2 merged to mainline recentely.
   . An align problem of width size that IPP driver incorrectly
     calculated the real buffer size.
   . Horizontal and vertical flip problem.
   . Per-plane global alpha for XRGB modes.
   . Incorrect variant of the YUV modes.
 - Fix plane overlapping problem.
   . The stange order of overlapping planes on XRGB modes
     by setting global alpha value to maximum value.
 
 Cleanup
 - Rename a enum type, drm_ipp_size_id, to one specific to Exynos,
   drm_exynos_ipp_limit_type.
 - Replace {un/reference} with {put,get} functions.
   . it replaces several reference/unreference functions with Linux
     kernel nameing standard.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJbOcEtAAoJEFc4NIkMQxK4fOIQALMX/zww/9iqbLmQCE0q1Idi
 VmEV/os/Is0yxYXndluKbSVrRlf4bi54ETATOVoxuIlBxPwbJn3q7CdXbOUsc123
 1n5PThLW9g7L9/oIPRgYXDn80rSdoy9AvR04f24AbP95xkCwLosxKOpMkFia9irH
 jaYXDuP0hxHXeMCt8B18OUM0JhY9rad7yPJgRINeFfRAWe1+qPoR68HeztVLCi4G
 f6VBkgoKDGH8ngQIEtkC0p6ouN/z8kcVtcA5Ob9KIld9hnztU84I7sidP4StkPUS
 kvbICe2ro7xPbEIRDn7AzjYAmPJHJEHxKrvbDlOoRGhRuqHHK8HyRhIiOsFYPZgW
 liGVXUvEaV7WjaSL6eAtzSxaLsPC9Z7lj0Ry/x/P+aZrREceaOkOI23C0g13zmPs
 MCVVnt0asJDPxI2o1epy1AQoAnaVVshuJhpRQYBvYhiNcL7JLyooczGuROFVkQ2q
 Chg9wgM8R5LEh6vnt7ZZHmD3bSsIY0OUzoQvoF1WP1EIItusYw5DQNL4CrbQY1rb
 oooz8UP+rGiPKnfZcNruBrT13EQdOE7dz26W+cHRjmZmDDU/8QDnaSnLqD3xr6Yv
 2vTyaB8pWWZttih01tADkDqA+rmRnd3ffyA1Zjwzv7Tey6pW8uqiSwoZrAZuj7ek
 aq0SJRXt6dvoY6nDFy5R
 =+7bq
 -----END PGP SIGNATURE-----

Merge tag 'exynos-drm-fixes-for-v4.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes

Fixups
- Fix several problems to IPPv2 merged to mainline recentely.
  . An align problem of width size that IPP driver incorrectly
    calculated the real buffer size.
  . Horizontal and vertical flip problem.
  . Per-plane global alpha for XRGB modes.
  . Incorrect variant of the YUV modes.
- Fix plane overlapping problem.
  . The stange order of overlapping planes on XRGB modes
    by setting global alpha value to maximum value.

Cleanup
- Rename a enum type, drm_ipp_size_id, to one specific to Exynos,
  drm_exynos_ipp_limit_type.
- Replace {un/reference} with {put,get} functions.
  . it replaces several reference/unreference functions with Linux
    kernel nameing standard.

Signed-off-by: Dave Airlie <airlied@redhat.com>

Link: https://patchwork.freedesktop.org/patch/msgid/1530512041-21392-1-git-send-email-inki.dae@samsung.com
2018-07-06 10:47:02 +10:00
Dave Airlie c8440a70bd Merge branch 'drm-fixes-4.18' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
- Fix an HDMI 2.0 4k@60 regression
- Hotplug fixes for PX/HG laptops
- Fixes for vbios changes in vega12
- Fix a race in the user fence code
- Fix a couple of misc typos

Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180705155206.2752-1-alexander.deucher@amd.com
2018-07-06 10:44:43 +10:00
Dave Airlie 0581a5cb06 A couple of GVT fixes, and a GGTT mmapping fix.
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEFWWmW3ewYy4RJOWc05gHnSar7m8FAls+DhEACgkQ05gHnSar
 7m/QRA/8CmWdYgRLWT9gc2OB8uWVWsKyMeO5Uvoy/3lnWPlmFO4J6wvOptVSxlfh
 yR89jIoxdb4204P5vjuI3dHD5WQFCiQzDTP438oIhFxc6KXr2osDMoy1laIpG31v
 XrV7dXk3lGOdkP+l6es0L4xo2IHpR9NLNtb61HNHmJFbsAPONG55wUW0VNDx17DY
 DyhyZtnI8Y+WZ8it95dn1E11MgKrQIpHKeWqAhJor2XaS6vHJkfzJFuNQh2V1dKm
 n9IbE1YexaYxC6ky7CEbDuSBu23NVsqZ0+QUHoq2qGj7s2i5PBzahCPZ+9TltypF
 fTCjtpXEhO3E2LCSUm/JEmZbl8zgKEzDBSRW/XMU2ryQby+AVTvtHIaFn9G1B8Ax
 dv0QCisNWmvA9m+jq2NfblffoD5aY0ME1eb6wKYf5XDIq8uysXHgSXP/3riaNcBb
 z4j/Bvf+qaBwxuOrbeZvwsjR8sgBxZR8sazUtUF1baiUODbya4dmWSiuQrBrDPtS
 5ZPw/glQhKcyFhAIN014Tn4opgbWnlMOgRaJOqb5EQ4tEcr6sCsiQBqgOE+A5eMR
 TWl27CsKkBvAthgemvLudlEdYkOe2OKwmUCuHhdYQAFL/nV4QzfP+7hpo17M8BIt
 hMYqmxf9pfHXILUkgDgv98q95ZaDkic5Aaa9nUQZVJ7iUQGpeZ0=
 =Euzf
 -----END PGP SIGNATURE-----

Merge tag 'drm-intel-fixes-2018-07-05' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes

A couple of GVT fixes, and a GGTT mmapping fix.

Signed-off-by: Dave Airlie <airlied@redhat.com>

Link: https://patchwork.freedesktop.org/patch/msgid/8736wxq35t.fsf@intel.com
2018-07-06 10:44:09 +10:00
Dave Airlie b7716735bb Fixes for v4.18-rc4:
- A few small fixes for the sii8620 bridge.
 - Allocate blob property memory using kvzalloc instead of kmalloc.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAls+Gq4ACgkQ/lWMcqZw
 E8PrGxAAiDFICLETi/mmVNleRvmhYKiJIOIgyk6KlVg2EwGuYvJfU3WHmzdrV8rA
 6WPPiVoPI4KKYARBqS1nQCDByWx0ZJ+AXrJLpkzfctCKJGnBQKRjsykwD1jmoeY9
 EgXJbjLUbIpFzo4aeNUEuezXuFWQFuzRA+5EySiK5njE3wqowoRkX2m4yDRDayFH
 HgQzhIAl3iEQqx2lgmVo1Pn/yiPMev2kXFr6TIdGs8u2ompKSpFNTYdunjmfh45X
 m77lVx9OkynETnoIqo5sy+YGW+Hzc0II/Re+HBmqbSPc3TJOErzHJikMUd2NnLsi
 GAP5LnGuQAFiN7FqCiNxAyl+OtbDdw7MEWxCr2ec41vNOyLGbBN7Aqb7a68pAH8M
 MJcOnbinYpZns6FVsR8ZP5HW9jWvow4NWBKx2R7n2g2ysMed4N2EKEHznxPhvGVu
 f1b0PoBodZ/SdOuVsli4sHrn5iOxhYZF2S/ynhgsxjSeQ4gXpUMXgs9US5be7L0C
 DVxUIMYk5Nyhg2LCz/eHQnyT/hLj4VjvbYFsDgSWCJAO/u3QRuVPGDKLnDI6MOXH
 3+8z/3zkviz0dTKilY6v5EfnpFmGXmGNIj/DlnmpHstfJ8rwm2haaeauQZ00Uj1R
 namWJIwjxbRG539UhGPXYGW3+UTyHpzBhlrk9GXTawQ2iPfh2EU=
 =bfQR
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2018-07-05' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

Fixes for v4.18-rc4:
- A few small fixes for the sii8620 bridge.
- Allocate blob property memory using kvzalloc instead of kmalloc.

Signed-off-by: Dave Airlie <airlied@redhat.com>

Link: https://patchwork.freedesktop.org/patch/msgid/4267636e-bb7c-8f69-eeff-12e045b3e7e1@linux.intel.com
2018-07-06 10:41:29 +10:00
Olof Johansson f0463f3619 Fixes for omap for v4.18-rc cycle
Few dts fixes for regressions for various SoCs and
 devices for touchscreen wake, dra7 USB quirk, pinmux
 for beaglebone mmc, and emac clock.
 
 Also included is a change for ti-sysc to use kcalloc
 that Kees wanted to get into v4.18 as that's the last
 one he wanted to fix for improved defense against
 allocation overflows.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAls92woRHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXNM/g//ZB5+qrF+798I0EGpL92ZX1nq/8ZudpRl
 A/E4o/mYJ6ltKMhIT96yYTBmd1Vz6FB54UK/5WZtHAKl14WyTIcncj7g0Cd+dMlj
 KvXnZIdyUdK1WIrPzDzGSPWxuVbq8n2dkqee51QApNK7eYsUyDt/xmmUr+SX426u
 C4Yit4ff7GY16qQuRgcwuISuAE6rP7o4iPak0nNnB+8v6ghjXSsteC9VVzaE7ATa
 cW2+cR7nlzYkoTcWkBjv99htcm5/wT5VF+ugeVtgUswyRalLV9FOeTvwEtghCnIc
 Eo8zHGwLy2lvDI9QlboBEnmwLHtw0uUrdLLAS2tBJ4053ojCxJcNq5h4f6pcFjHC
 OjjKp/7TDI7xXHjWTuj4D4zLHbEzDag9kNmAk0eN3LfH3iQK6uTc1vLQT28sC2nC
 gvEodrvXqD0v4IQF8EVZ9n2feVc3lRj2b2FuXfcdNHXITrFSiL+P4lyYPmMPkMOn
 VevqLJ0xxUiRWr0GFeBQkBjZzDs7x9Rpk4qhXcsOBnB261aePvpMM8k875TmcU9s
 k+a1JQn3s7SuAoUvPa1AltEkmYRzPyPHszJC312izW9yMpMZUI0nS0gVZSKuL5Gg
 sFEmc1WevyoUhctebvR778wRl/41PMLGmMSTX5HVzcZpbEFxFJTLBH9AbaV3pblj
 V6UGlXvOS7s=
 =H1MU
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v4.18/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

Fixes for omap for v4.18-rc cycle

Few dts fixes for regressions for various SoCs and
devices for touchscreen wake, dra7 USB quirk, pinmux
for beaglebone mmc, and emac clock.

Also included is a change for ti-sysc to use kcalloc
that Kees wanted to get into v4.18 as that's the last
one he wanted to fix for improved defense against
allocation overflows.

* tag 'omap-for-v4.18/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: dts: omap3: Fix am3517 mdio and emac clock references
  ARM: dts: am335x-bone-common: Fix mmc0 Write Protect
  bus: ti-sysc: Use 2-factor allocator arguments
  ARM: dts: dra7: Disable metastability workaround for USB2
  ARM: dts: am437x: make edt-ft5x06 a wakeup source

Signed-off-by: Olof Johansson <olof@lixom.net>
2018-07-05 14:59:20 -07:00
Paul Burton 523402fa91
MIPS: Fix ioremap() RAM check
We currently attempt to check whether a physical address range provided
to __ioremap() may be in use by the page allocator by examining the
value of PageReserved for each page in the region - lowmem pages not
marked reserved are presumed to be in use by the page allocator, and
requests to ioremap them fail.

The way we check this has been broken since commit 92923ca3aa ("mm:
meminit: only set page reserved in the memblock region"), because
memblock will typically not have any knowledge of non-RAM pages and
therefore those pages will not have the PageReserved flag set. Thus when
we attempt to ioremap a region outside of RAM we incorrectly fail
believing that the region is RAM that may be in use.

In most cases ioremap() on MIPS will take a fast-path to use the
unmapped kseg1 or xkphys virtual address spaces and never hit this path,
so the only way to hit it is for a MIPS32 system to attempt to ioremap()
an address range in lowmem with flags other than _CACHE_UNCACHED.
Perhaps the most straightforward way to do this is using
ioremap_uncached_accelerated(), which is how the problem was discovered.

Fix this by making use of walk_system_ram_range() to test the address
range provided to __ioremap() against only RAM pages, rather than all
lowmem pages. This means that if we have a lowmem I/O region, which is
very common for MIPS systems, we're free to ioremap() address ranges
within it. A nice bonus is that the test is no longer limited to lowmem.

The approach here matches the way x86 performed the same test after
commit c81c8a1eee ("x86, ioremap: Speed up check for RAM pages") until
x86 moved towards a slightly more complicated check using walk_mem_res()
for unrelated reasons with commit 0e4c12b45a ("x86/mm, resource: Use
PAGE_KERNEL protection for ioremap of memory pages").

Signed-off-by: Paul Burton <paul.burton@mips.com>
Reported-by: Serge Semin <fancer.lancer@gmail.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Fixes: 92923ca3aa ("mm: meminit: only set page reserved in the memblock region")
Cc: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org # v4.2+
Patchwork: https://patchwork.linux-mips.org/patch/19786/
2018-07-05 14:43:21 -07:00
Linus Torvalds 0fa3ecd878 Fix up non-directory creation in SGID directories
sgid directories have special semantics, making newly created files in
the directory belong to the group of the directory, and newly created
subdirectories will also become sgid.  This is historically used for
group-shared directories.

But group directories writable by non-group members should not imply
that such non-group members can magically join the group, so make sure
to clear the sgid bit on non-directories for non-members (but remember
that sgid without group execute means "mandatory locking", just to
confuse things even more).

Reported-by: Jann Horn <jannh@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-07-05 12:36:36 -07:00