Commit Graph

857571 Commits

Author SHA1 Message Date
Paolo Bonzini
f7eea636c3 KVM: nVMX: handle page fault in vmread
The implementation of vmread to memory is still incomplete, as it
lacks the ability to do vmread to I/O memory just like vmptrst.

Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-09-14 09:25:02 +02:00
Linus Torvalds
a7f89616b7 Merge branch 'for-5.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fix from Tejun Heo:
 "Roman found and fixed a bug in the cgroup2 freezer which allows new
  child cgroup to escape frozen state"

* 'for-5.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup: freezer: fix frozen state inheritance
  kselftests: cgroup: add freezer mkdir test
2019-09-13 09:52:01 +01:00
Linus Torvalds
1b304a1ae4 for-5.3-rc8-tag
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE8rQSAMVO+zA4DBdWxWXV+ddtWDsFAl16aTEACgkQxWXV+ddt
 WDvICg//cSn5w+g6EnxbrAZ6IYQJ4GA7lZSk2i6Dc/lI3BTfs7Wj0SPRKd01pBjT
 N+wbqoOgubsS1jkNfJsGCN80XzSa0tvyQdbezj5ncgSPXp4FRlT0K24EUQNPaqbg
 SsvvxAOCerVN3Yj2qrHNWIS5qZ5/8/NjLXca1DJ/OYmrkKfhe+Z6/b9EuKffPnco
 erMnaeSvQ27hYkkcdM0DGcWDoHHAQrefGNjQzp5vncJNN1F7+EGLbcH31UwApk1K
 /hvOQ6Q6SoR/NKbQu3AitrR9u7v9uhWP9jHJZT46q1m89CzI4S5FjK2wKZFjPE6r
 0PGRqnpdaGAERaTo3s6jIqv/X2gzJkhhhzGMiPgPJCQbAH39f/fFGEX22TjG33Yq
 2CiGSIPnmKQ7HE494YLuSyHD/89SutMMCkbF0sFBoKuTnu2HQMn9r5Pk6bEKtvIY
 iTk75/WTXR02qWCVhTyNDa9QnxewQGJC1d1KNQ6MwbzBiYyG9S/DDZnjLJPNx7DF
 KAAANCDdyPpraLcmw2sD/qd1o10HfQmn9z1L2v3YvJBfjMe76SQFCP5WwaJRcjOm
 c3ScAX9bXeXJgH+E98kWc7T6p49IPdMDGAtArQmtjO4V8pFRuqG+2Ibg6Za/y5XZ
 fkaS5UY+XIk3TUpEqkWKMPMigM9a3jgHskyMgdRLQfVnoOc6Z+k=
 =KXB8
 -----END PGP SIGNATURE-----

Merge tag 'for-5.3-rc8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
 "Here are two fixes, one of them urgent fixing a bug introduced in 5.2
  and reported by many users. It took time to identify the root cause,
  catching the 5.3 release is higly desired also to push the fix to 5.2
  stable tree.

  The bug is a mess up of return values after adding proper error
  handling and honestly the kind of bug that can cause sleeping
  disorders until it's caught. My appologies to everybody who was
  affected.

  Summary of what could happen:

  1) either a hang when committing a transaction, if this happens
     there's no risk of corruption, still the hang is very inconvenient
     and can't be resolved without a reboot

  2) writeback for some btree nodes may never be started and we end up
     committing a transaction without noticing that, this is really
     serious and that will lead to the "parent transid verify failed"
     messages"

* tag 'for-5.3-rc8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  Btrfs: fix unwritten extent buffers and hangs on future writeback attempts
  Btrfs: fix assertion failure during fsync and use of stale transaction
2019-09-13 09:48:47 +01:00
Roman Gushchin
97a6136983 cgroup: freezer: fix frozen state inheritance
If a new child cgroup is created in the frozen cgroup hierarchy
(one or more of ancestor cgroups is frozen), the CGRP_FREEZE cgroup
flag should be set. Otherwise if a process will be attached to the
child cgroup, it won't become frozen.

The problem can be reproduced with the test_cgfreezer_mkdir test.

This is the output before this patch:
  ~/test_freezer
  ok 1 test_cgfreezer_simple
  ok 2 test_cgfreezer_tree
  ok 3 test_cgfreezer_forkbomb
  Cgroup /sys/fs/cgroup/cg_test_mkdir_A/cg_test_mkdir_B isn't frozen
  not ok 4 test_cgfreezer_mkdir
  ok 5 test_cgfreezer_rmdir
  ok 6 test_cgfreezer_migrate
  ok 7 test_cgfreezer_ptrace
  ok 8 test_cgfreezer_stopped
  ok 9 test_cgfreezer_ptraced
  ok 10 test_cgfreezer_vfork

And with this patch:
  ~/test_freezer
  ok 1 test_cgfreezer_simple
  ok 2 test_cgfreezer_tree
  ok 3 test_cgfreezer_forkbomb
  ok 4 test_cgfreezer_mkdir
  ok 5 test_cgfreezer_rmdir
  ok 6 test_cgfreezer_migrate
  ok 7 test_cgfreezer_ptrace
  ok 8 test_cgfreezer_stopped
  ok 9 test_cgfreezer_ptraced
  ok 10 test_cgfreezer_vfork

Reported-by: Mark Crossen <mcrossen@fb.com>
Signed-off-by: Roman Gushchin <guro@fb.com>
Fixes: 76f969e894 ("cgroup: cgroup v2 freezer")
Cc: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Tejun Heo <tj@kernel.org>
2019-09-12 14:04:45 -07:00
Roman Gushchin
44e9d308a5 kselftests: cgroup: add freezer mkdir test
Add a new cgroup freezer selftest, which checks that if a cgroup is
frozen, their new child cgroups will properly inherit the frozen
state.

It creates a parent cgroup, freezes it, creates a child cgroup
and populates it with a dummy process. Then it checks that both
parent and child cgroup are frozen.

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
2019-09-12 14:04:40 -07:00
Chris Wilson
505a8ec7e1 Revert "drm/i915/userptr: Acquire the page lock around set_page_dirty()"
The userptr put_pages can be called from inside try_to_unmap, and so
enters with the page lock held on one of the object's backing pages. We
cannot take the page lock ourselves for fear of recursion.

Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Martin Wilck <Martin.Wilck@suse.com>
Reported-by: Leo Kraav <leho@kraav.com>
Fixes: aa56a292ce ("drm/i915/userptr: Acquire the page lock around set_page_dirty()")
References: https://bugzilla.kernel.org/show_bug.cgi?id=203317
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-09-12 14:55:03 +01:00
Linus Torvalds
98dcb386e5 for-linus-20190912
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCXXpIKgAKCRCRxhvAZXjc
 om8yAQCIPJp2HWNsJRPRl9KVKRmR6MxItG1Hpj0MvgwzLEjufwD/SF9VAPgl2AmD
 oaAXrOYH4yhr9aaFlVuMpe2aWAZdxgU=
 =Tjvf
 -----END PGP SIGNATURE-----

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

Pull clone3 fix from Christian Brauner:
 "This is a last-minute bugfix for clone3() that should go in before we
  release 5.3 with clone3().

  clone3() did not verify that the exit_signal argument was set to a
  valid signal. This can be used to cause a crash by specifying a signal
  greater than NSIG. e.g. -1.

  The commit from Eugene adds a check to copy_clone_args_from_user() to
  verify that the exit signal is limited by CSIGNAL as with legacy
  clone() and that the signal is valid. With this we don't get the
  legacy clone behavior were an invalid signal could be handed down and
  would only be detected and then ignored in do_notify_parent(). Users
  of clone3() will now get a proper error right when they pass an
  invalid exit signal. Note, that this is not a change in user-visible
  behavior since no kernel with clone3() has been released yet"

* tag 'for-linus-20190912' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux:
  fork: block invalid exit signals with clone3()
2019-09-12 14:50:14 +01:00
Linus Torvalds
95217783b7 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar:
 "A KVM guest fix, and a kdump kernel relocation errors fix"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/timer: Force PIT initialization when !X86_FEATURE_ARAT
  x86/purgatory: Change compiler flags from -mcmodel=kernel to -mcmodel=large to fix kexec relocation errors
2019-09-12 14:47:35 +01:00
Eugene Syromiatnikov
a0eb9abd8a
fork: block invalid exit signals with clone3()
Previously, higher 32 bits of exit_signal fields were lost when copied
to the kernel args structure (that uses int as a type for the respective
field). Moreover, as Oleg has noted, exit_signal is used unchecked, so
it has to be checked for sanity before use; for the legacy syscalls,
applying CSIGNAL mask guarantees that it is at least non-negative;
however, there's no such thing is done in clone3() code path, and that
can break at least thread_group_leader.

This commit adds a check to copy_clone_args_from_user() to verify that
the exit signal is limited by CSIGNAL as with legacy clone() and that
the signal is valid. With this we don't get the legacy clone behavior
were an invalid signal could be handed down and would only be detected
and ignored in do_notify_parent(). Users of clone3() will now get a
proper error when they pass an invalid exit signal. Note, that this is
not user-visible behavior since no kernel with clone3() has been
released yet.

The following program will cause a splat on a non-fixed clone3() version
and will fail correctly on a fixed version:

 #define _GNU_SOURCE
 #include <linux/sched.h>
 #include <linux/types.h>
 #include <sched.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/syscall.h>
 #include <sys/wait.h>
 #include <unistd.h>

 int main(int argc, char *argv[])
 {
        pid_t pid = -1;
        struct clone_args args = {0};
        args.exit_signal = -1;

        pid = syscall(__NR_clone3, &args, sizeof(struct clone_args));
        if (pid < 0)
                exit(EXIT_FAILURE);

        if (pid == 0)
                exit(EXIT_SUCCESS);

        wait(NULL);

        exit(EXIT_SUCCESS);
 }

Fixes: 7f192e3cd3 ("fork: add clone3")
Reported-by: Oleg Nesterov <oleg@redhat.com>
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Link: https://lore.kernel.org/r/4b38fa4ce420b119a4c6345f42fe3cec2de9b0b5.1568223594.git.esyr@redhat.com
[christian.brauner@ubuntu.com: simplify check and rework commit message]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-09-12 14:56:33 +02:00
Filipe Manana
18dfa7117a Btrfs: fix unwritten extent buffers and hangs on future writeback attempts
The lock_extent_buffer_io() returns 1 to the caller to tell it everything
went fine and the callers needs to start writeback for the extent buffer
(submit a bio, etc), 0 to tell the caller everything went fine but it does
not need to start writeback for the extent buffer, and a negative value if
some error happened.

When it's about to return 1 it tries to lock all pages, and if a try lock
on a page fails, and we didn't flush any existing bio in our "epd", it
calls flush_write_bio(epd) and overwrites the return value of 1 to 0 or
an error. The page might have been locked elsewhere, not with the goal
of starting writeback of the extent buffer, and even by some code other
than btrfs, like page migration for example, so it does not mean the
writeback of the extent buffer was already started by some other task,
so returning a 0 tells the caller (btree_write_cache_pages()) to not
start writeback for the extent buffer. Note that epd might currently have
either no bio, so flush_write_bio() returns 0 (success) or it might have
a bio for another extent buffer with a lower index (logical address).

Since we return 0 with the EXTENT_BUFFER_WRITEBACK bit set on the
extent buffer and writeback is never started for the extent buffer,
future attempts to writeback the extent buffer will hang forever waiting
on that bit to be cleared, since it can only be cleared after writeback
completes. Such hang is reported with a trace like the following:

  [49887.347053] INFO: task btrfs-transacti:1752 blocked for more than 122 seconds.
  [49887.347059]       Not tainted 5.2.13-gentoo #2
  [49887.347060] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
  [49887.347062] btrfs-transacti D    0  1752      2 0x80004000
  [49887.347064] Call Trace:
  [49887.347069]  ? __schedule+0x265/0x830
  [49887.347071]  ? bit_wait+0x50/0x50
  [49887.347072]  ? bit_wait+0x50/0x50
  [49887.347074]  schedule+0x24/0x90
  [49887.347075]  io_schedule+0x3c/0x60
  [49887.347077]  bit_wait_io+0x8/0x50
  [49887.347079]  __wait_on_bit+0x6c/0x80
  [49887.347081]  ? __lock_release.isra.29+0x155/0x2d0
  [49887.347083]  out_of_line_wait_on_bit+0x7b/0x80
  [49887.347084]  ? var_wake_function+0x20/0x20
  [49887.347087]  lock_extent_buffer_for_io+0x28c/0x390
  [49887.347089]  btree_write_cache_pages+0x18e/0x340
  [49887.347091]  do_writepages+0x29/0xb0
  [49887.347093]  ? kmem_cache_free+0x132/0x160
  [49887.347095]  ? convert_extent_bit+0x544/0x680
  [49887.347097]  filemap_fdatawrite_range+0x70/0x90
  [49887.347099]  btrfs_write_marked_extents+0x53/0x120
  [49887.347100]  btrfs_write_and_wait_transaction.isra.4+0x38/0xa0
  [49887.347102]  btrfs_commit_transaction+0x6bb/0x990
  [49887.347103]  ? start_transaction+0x33e/0x500
  [49887.347105]  transaction_kthread+0x139/0x15c

So fix this by not overwriting the return value (ret) with the result
from flush_write_bio(). We also need to clear the EXTENT_BUFFER_WRITEBACK
bit in case flush_write_bio() returns an error, otherwise it will hang
any future attempts to writeback the extent buffer, and undo all work
done before (set back EXTENT_BUFFER_DIRTY, etc).

This is a regression introduced in the 5.2 kernel.

Fixes: 2e3c25136a ("btrfs: extent_io: add proper error handling to lock_extent_buffer_for_io()")
Fixes: f4340622e0 ("btrfs: extent_io: Move the BUG_ON() in flush_write_bio() one level up")
Reported-by: Zdenek Sojka <zsojka@seznam.cz>
Link: https://lore.kernel.org/linux-btrfs/GpO.2yos.3WGDOLpx6t%7D.1TUDYM@seznam.cz/T/#u
Reported-by: Stefan Priebe - Profihost AG <s.priebe@profihost.ag>
Link: https://lore.kernel.org/linux-btrfs/5c4688ac-10a7-fb07-70e8-c5d31a3fbb38@profihost.ag/T/#t
Reported-by: Drazen Kacar <drazen.kacar@oradian.com>
Link: https://lore.kernel.org/linux-btrfs/DB8PR03MB562876ECE2319B3E579590F799C80@DB8PR03MB5628.eurprd03.prod.outlook.com/
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204377
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-09-12 13:37:25 +02:00
Filipe Manana
410f954cb1 Btrfs: fix assertion failure during fsync and use of stale transaction
Sometimes when fsync'ing a file we need to log that other inodes exist and
when we need to do that we acquire a reference on the inodes and then drop
that reference using iput() after logging them.

That generally is not a problem except if we end up doing the final iput()
(dropping the last reference) on the inode and that inode has a link count
of 0, which can happen in a very short time window if the logging path
gets a reference on the inode while it's being unlinked.

In that case we end up getting the eviction callback, btrfs_evict_inode(),
invoked through the iput() call chain which needs to drop all of the
inode's items from its subvolume btree, and in order to do that, it needs
to join a transaction at the helper function evict_refill_and_join().
However because the task previously started a transaction at the fsync
handler, btrfs_sync_file(), it has current->journal_info already pointing
to a transaction handle and therefore evict_refill_and_join() will get
that transaction handle from btrfs_join_transaction(). From this point on,
two different problems can happen:

1) evict_refill_and_join() will often change the transaction handle's
   block reserve (->block_rsv) and set its ->bytes_reserved field to a
   value greater than 0. If evict_refill_and_join() never commits the
   transaction, the eviction handler ends up decreasing the reference
   count (->use_count) of the transaction handle through the call to
   btrfs_end_transaction(), and after that point we have a transaction
   handle with a NULL ->block_rsv (which is the value prior to the
   transaction join from evict_refill_and_join()) and a ->bytes_reserved
   value greater than 0. If after the eviction/iput completes the inode
   logging path hits an error or it decides that it must fallback to a
   transaction commit, the btrfs fsync handle, btrfs_sync_file(), gets a
   non-zero value from btrfs_log_dentry_safe(), and because of that
   non-zero value it tries to commit the transaction using a handle with
   a NULL ->block_rsv and a non-zero ->bytes_reserved value. This makes
   the transaction commit hit an assertion failure at
   btrfs_trans_release_metadata() because ->bytes_reserved is not zero but
   the ->block_rsv is NULL. The produced stack trace for that is like the
   following:

   [192922.917158] assertion failed: !trans->bytes_reserved, file: fs/btrfs/transaction.c, line: 816
   [192922.917553] ------------[ cut here ]------------
   [192922.917922] kernel BUG at fs/btrfs/ctree.h:3532!
   [192922.918310] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC PTI
   [192922.918666] CPU: 2 PID: 883 Comm: fsstress Tainted: G        W         5.1.4-btrfs-next-47 #1
   [192922.919035] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.2-0-gf9626ccb91-prebuilt.qemu-project.org 04/01/2014
   [192922.919801] RIP: 0010:assfail.constprop.25+0x18/0x1a [btrfs]
   (...)
   [192922.920925] RSP: 0018:ffffaebdc8a27da8 EFLAGS: 00010286
   [192922.921315] RAX: 0000000000000051 RBX: ffff95c9c16a41c0 RCX: 0000000000000000
   [192922.921692] RDX: 0000000000000000 RSI: ffff95cab6b16838 RDI: ffff95cab6b16838
   [192922.922066] RBP: ffff95c9c16a41c0 R08: 0000000000000000 R09: 0000000000000000
   [192922.922442] R10: ffffaebdc8a27e70 R11: 0000000000000000 R12: ffff95ca731a0980
   [192922.922820] R13: 0000000000000000 R14: ffff95ca84c73338 R15: ffff95ca731a0ea8
   [192922.923200] FS:  00007f337eda4e80(0000) GS:ffff95cab6b00000(0000) knlGS:0000000000000000
   [192922.923579] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
   [192922.923948] CR2: 00007f337edad000 CR3: 00000001e00f6002 CR4: 00000000003606e0
   [192922.924329] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
   [192922.924711] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
   [192922.925105] Call Trace:
   [192922.925505]  btrfs_trans_release_metadata+0x10c/0x170 [btrfs]
   [192922.925911]  btrfs_commit_transaction+0x3e/0xaf0 [btrfs]
   [192922.926324]  btrfs_sync_file+0x44c/0x490 [btrfs]
   [192922.926731]  do_fsync+0x38/0x60
   [192922.927138]  __x64_sys_fdatasync+0x13/0x20
   [192922.927543]  do_syscall_64+0x60/0x1c0
   [192922.927939]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
   (...)
   [192922.934077] ---[ end trace f00808b12068168f ]---

2) If evict_refill_and_join() decides to commit the transaction, it will
   be able to do it, since the nested transaction join only increments the
   transaction handle's ->use_count reference counter and it does not
   prevent the transaction from getting committed. This means that after
   eviction completes, the fsync logging path will be using a transaction
   handle that refers to an already committed transaction. What happens
   when using such a stale transaction can be unpredictable, we are at
   least having a use-after-free on the transaction handle itself, since
   the transaction commit will call kmem_cache_free() against the handle
   regardless of its ->use_count value, or we can end up silently losing
   all the updates to the log tree after that iput() in the logging path,
   or using a transaction handle that in the meanwhile was allocated to
   another task for a new transaction, etc, pretty much unpredictable
   what can happen.

In order to fix both of them, instead of using iput() during logging, use
btrfs_add_delayed_iput(), so that the logging path of fsync never drops
the last reference on an inode, that step is offloaded to a safe context
(usually the cleaner kthread).

The assertion failure issue was sporadically triggered by the test case
generic/475 from fstests, which loads the dm error target while fsstress
is running, which lead to fsync failing while logging inodes with -EIO
errors and then trying later to commit the transaction, triggering the
assertion failure.

CC: stable@vger.kernel.org # 4.4+
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-09-12 13:37:19 +02:00
Linus Torvalds
ad32b4800c virtio: last minute bugfixes
A couple of security things.
 
 And an error handling bugfix that is never encountered by most people,
 but that also makes it kind of safe to push at the last minute, and it
 helps push the fix to stable a bit sooner.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJdeUfXAAoJECgfDbjSjVRpfFoH/2B58dJasWK9CiHlu1Pm9sGZ
 44JOA3M9uqNCev0sXEYXB/ldRW0BK8BgOKv1UJ6Za2bvO0mEz6Go8jr8EUId5kaO
 YSwSscn7Fp1XJgRzJunhJNo/t70zptsDHpeVU68ObP4ubQgSQWLlVMvA9EQOz8M+
 Fq1FCmnLdPpu/8u2dN4bstt5uaUQSCOLOB9Sq0U8qNRuuVnNgwLtDqCw8chZRrfn
 Wl1XGzDp22wtf/Beey8YFB+IGP2BnPNbxNeuPI33SkLM6ZVjR6511lpihfZyN2AF
 Fb+yajOfLGnAftff5Lpn0dXxOOfwe+D20ymKa1rGCf6iVI5ZnZYZavrYmVy7X9k=
 =P20D
 -----END PGP SIGNATURE-----

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull virtio fixes from Michael Tsirkin:
 "Last minute bugfixes.

  A couple of security things.

  And an error handling bugfix that is never encountered by most people,
  but that also makes it kind of safe to push at the last minute, and it
  helps push the fix to stable a bit sooner"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  vhost: make sure log_num < in_num
  vhost: block speculation of translated descriptors
  virtio_ring: fix unmap of indirect descriptors
2019-09-12 11:07:31 +01:00
Linus Torvalds
6dcf6a4eb9 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fix from Ingo Molnar:
 "Fix an initialization bug in the hw-breakpoints, which triggered on
  the ARM platform"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/hw_breakpoint: Fix arch_hw_breakpoint use-before-initialization
2019-09-12 11:04:50 +01:00
Linus Torvalds
95779fe850 Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fix from Ingo Molnar:
 "Fix a race in the IRQ resend mechanism, which can result in a NULL
  dereference crash"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq: Prevent NULL pointer dereference in resend_irqs()
2019-09-12 11:02:00 +01:00
Linus Torvalds
840ce8f807 Pin control fixes for v5.3:
- A single patch for some Aspeed problems. The BMCs are much
   happier now.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAl16AN0ACgkQQRCzN7AZ
 XXN5EA/+LSMeYpoLPEi2NbEikj00hl71zyLRCb4X2KZKqqc6Wa7gbp0tTNLAmfX/
 zCPiSF0bsUlKjRrwHsMsPwq9mju4vbgsUILwddEy++CXZQeVRs8eOTuWF8a9a2Ga
 1D3ZLrQHwBl7CiboWnnXsPW7vPvOq+nV4hVMCrernYpYk5FM4SqDs+pqMtpZZP5J
 LW83RhBpjatdoqsQ2ZvUlOOADYALXtbCh9gCCZ9q5DejYTMMkr0EpyUMyC2quDYV
 RB9qpISkprwApjjnLSRe38KoErtrHTyr8mP96Y9b7pR8lQc/4mc+L5NGtiL0Xnk0
 /oC6eolIrDJQvV2lZjAXmfV6KVTS2c6ts9Vpusc8iQfaqnfsQC53/W8XcqpjKfmY
 NpK9rL41veoVWJmnm2wrvRcCpqFrVhqHb875ZhksdbAaXbLVoXo4Mwi8SY7GSAEv
 V4WVcevNqgEk7ip3RAPAMSx36bnx9aFXEWRXRThbh77yuBcsKM7taQIp9KtQPPtQ
 /ZR37N0pFxmOPdaSqX9tjsXw9QWKqy+FPmDlKfR4mh1JCzav5YszgOc5S1NDAsqK
 E3nyLrubyTZiGwpzqtF3sOVVoW9DccRQEpxE3YnwkCSA0OdaOCMpC0b7zlftYQpK
 CDjzgEgUpN1wgu6a1xAkkaVKc7FalmuLYkG4XbIgd0NjsBNfzr4=
 =JzRC
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fix from Linus Walleij:
 "Hopefully last pin control fix: a single patch for some Aspeed
  problems. The BMCs are much happier now"

* tag 'pinctrl-v5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: aspeed: Fix spurious mux failures on the AST2500
2019-09-12 10:58:47 +01:00
Linus Torvalds
9c09f62348 GPIO fixes for v5.3:
- An ACPI DSDT error fixup of the type we always see and
   Hans invariably gets to fix.
 - A OF quirk fix for the current release (v5.3)
 - Some consistency checks on the userspace ABI.
 - A memory leak.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAl15/G8ACgkQQRCzN7AZ
 XXOpKA/8D1yRVDehYXgL5vH9AweXtUN82t2ZKeN5Mu+XiTJ2DMI1tS3lNrgwlnew
 3nJ/o8hgR7O2ZTmNXcQ/tyw6+svCi9bGQjYnhmqVx5u2dyhxjFg5gLJJNT+Mrzw/
 7AnD05oBV4yGtRyscgfr9ODJR8Qy2a9el/5SSm1rAOgwRgtKviKFnv3crasWrS/m
 TavpO/BtQOH8gUByR8sIaOFSMzKYc66Km9CQLdmcpfCOksz3E1lx4MlPghA7Fs7G
 p2M3883mYQrK6Ya2ZUEOwbPG48JPmGHK0rGwTH2GASd0F1tfLxaxmBMdDOQ4KAjx
 V3sWiCyR5RscehB/TWRcDl63o2HyZv6DYggYwDeNPx3Lck3WO+BLhv+RGjhXC46p
 QWU+c0WoZeAKfd3S63N/68mVh/7EpK9ef9Nq/vv2IKxI0THn3ZI6xg70fsgdl7wW
 s/KMOpqmztxmaQIlthzMmQSRnKO9sbv5Zy58SWOA992BNbgbRVjkHjTkdcu6UXJ7
 aURX/k/3/6alMxTBLITWdax+ihjuwpdhX0VVf5qPGh1/WdMq5DAI79bUQAdvrPW6
 Q0YFhQqZNTBzCOWXSXEtUJiSI7a0Wrnf0bKIFXTu7qQ7Fw+ohqliY8qOs+m1hm8f
 6nYrS5JQKoGHbTVxL0/0m83f8OyQGnZiy7FEdBGYNKcSGec5rao=
 =QEAT
 -----END PGP SIGNATURE-----

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

Pull GPIO fixes from Linus Walleij:
 "I don't really like to send so many fixes at the very last minute, but
  the bug-sport activity is unpredictable.

  Four fixes, three are -stable material that will go everywhere, one is
  for the current cycle:

   - An ACPI DSDT error fixup of the type we always see and Hans
     invariably gets to fix.

   - A OF quirk fix for the current release (v5.3)

   - Some consistency checks on the userspace ABI.

   - A memory leak"

* tag 'gpio-v5.3-6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist
  gpiolib: of: fix fallback quirks handling
  gpio: fix line flag validation in lineevent_create
  gpio: fix line flag validation in linehandle_create
  gpio: mockup: add missing single_release()
2019-09-12 09:53:38 +01:00
Andrew Jeffery
c1432423a1 pinctrl: aspeed: Fix spurious mux failures on the AST2500
Commit 674fa8daa8 ("pinctrl: aspeed-g5: Delay acquisition of regmaps")
was determined to be a partial fix to the problem of acquiring the LPC
Host Controller and GFX regmaps: The AST2500 pin controller may need to
fetch syscon regmaps during expression evaluation as well as when
setting mux state. For example, this case is hit by attempting to export
pins exposing the LPC Host Controller as GPIOs.

An optional eval() hook is added to the Aspeed pinmux operation struct
and called from aspeed_sig_expr_eval() if the pointer is set by the
SoC-specific driver. This enables the AST2500 to perform the custom
action of acquiring its regmap dependencies as required.

John Wang tested the fix on an Inspur FP5280G2 machine (AST2500-based)
where the issue was found, and I've booted the fix on Witherspoon
(AST2500) and Palmetto (AST2400) machines, and poked at relevant pins
under QEMU by forcing mux configurations via devmem before exporting
GPIOs to exercise the driver.

Fixes: 7d29ed88ac ("pinctrl: aspeed: Read and write bits in LPC and GFX controllers")
Fixes: 674fa8daa8 ("pinctrl: aspeed-g5: Delay acquisition of regmaps")
Reported-by: John Wang <wangzqbj@inspur.com>
Tested-by: John Wang <wangzqbj@inspur.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

Link: https://lore.kernel.org/r/20190829071738.2523-1-andrew@aj.id.au
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-09-12 00:08:27 +01:00
yongduan
060423bfde vhost: make sure log_num < in_num
The code assumes log_num < in_num everywhere, and that is true as long as
in_num is incremented by descriptor iov count, and log_num by 1. However
this breaks if there's a zero sized descriptor.

As a result, if a malicious guest creates a vring desc with desc.len = 0,
it may cause the host kernel to crash by overflowing the log array. This
bug can be triggered during the VM migration.

There's no need to log when desc.len = 0, so just don't increment log_num
in this case.

Fixes: 3a4d5c94e9 ("vhost_net: a kernel-level virtio server")
Cc: stable@vger.kernel.org
Reviewed-by: Lidong Chen <lidongchen@tencent.com>
Signed-off-by: ruippan <ruippan@tencent.com>
Signed-off-by: yongduan <yongduan@tencent.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-09-11 15:15:26 -04:00
Michael S. Tsirkin
a89db445fb vhost: block speculation of translated descriptors
iovec addresses coming from vhost are assumed to be
pre-validated, but in fact can be speculated to a value
out of range.

Userspace address are later validated with array_index_nospec so we can
be sure kernel info does not leak through these addresses, but vhost
must also not leak userspace info outside the allowed memory table to
guests.

Following the defence in depth principle, make sure
the address is not validated out of node range.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: stable@vger.kernel.org
Acked-by: Jason Wang <jasowang@redhat.com>
Tested-by: Jason Wang <jasowang@redhat.com>
2019-09-11 15:15:07 -04:00
Hans de Goede
61f7f7c8f9 gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist
Another day; another DSDT bug we need to workaround...

Since commit ca876c7483 ("gpiolib-acpi: make sure we trigger edge events
at least once on boot") we call _AEI edge handlers at boot.

In some rare cases this causes problems. One example of this is the Minix
Neo Z83-4 mini PC, this device has a clear DSDT bug where it has some copy
and pasted code for dealing with Micro USB-B connector host/device role
switching, while the mini PC does not even have a micro-USB connector.
This code, which should not be there, messes with the DDC data pin from
the HDMI connector (switching it to GPIO mode) breaking HDMI support.

To avoid problems like this, this commit adds a new
gpiolib_acpi.run_edge_events_on_boot kernel commandline option, which
allows disabling the running of _AEI edge event handlers at boot.

The default value is -1/auto which uses a DMI based blacklist, the initial
version of this blacklist contains the Neo Z83-4 fixing the HDMI breakage.

Cc: stable@vger.kernel.org
Cc: Daniel Drake <drake@endlessm.com>
Cc: Ian W MORRISON <ianwmorrison@gmail.com>
Reported-by: Ian W MORRISON <ianwmorrison@gmail.com>
Suggested-by: Ian W MORRISON <ianwmorrison@gmail.com>
Fixes: ca876c7483 ("gpiolib-acpi: make sure we trigger edge events at least once on boot")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20190827202835.213456-1-hdegoede@redhat.com
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ian W MORRISON <ianwmorrison@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-09-11 10:46:54 +01:00
Linus Torvalds
3120b9a6a3 ipc: fix regressions from y2038 patches
These are two regression fixes for bugs that got introduced
 during the system call rework that went into linux-5.1
 but only bisected and fixed now:
 
 - One patch affects semtimedop() on many of the less
   common 32-bit architectures, this just needs a single-line
   bugfix.
 
 - The other affects only sparc64 and has a slightly more
   invasive workaround to apply the same change to sparc64
   that was done to the generic code used everywhere else.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJddAhgAAoJEJpsee/mABjZCFsP/iV1iH6ezPC4thGazZ1n9wHw
 UOi+lVJPN3qZ2HmeSGYCFfktpbkj6UUT6QdwxfvZkD3EtKf1Zl+lMgJWAgE1/aUa
 ikCyKjSsnW3cv4Yd5uX9gYSzIdKrGY2XrDjq1J3hjUMPpZfj03ndKCYHEbMLDrO8
 g91ZGUuHqxW0NCkDq6mGed2d0FOCLgwHqqwEEZgvaEzMDv1xG2TzrxS566YfxSVA
 HTD7JjsaEh02Q3AYwpq3MOxWXxDQE0b7YI+LoEs8Maqi+0zSh946vMVloo/a1pv2
 SK9ol1zGQOwCojBTevcpHwdeeO2mYvjwDOa0aFucErAXiBPROXzFGIT/ZJ0WpZuf
 vI0JCCD3Rfp/oXRZePuToN2oE9HrrR6myhAMn+Nza3SbPlT/sQEaYvuStV/s8pQo
 HUNY234zACeRM5mPFUlbfYOBKL1loCpd+OjOA4fMoXGaG8HpnFBjnmz32yzo01zM
 oAiHzLXBeMLhJhZEX1b80rwbg4k/Kjn/ZQUEkQ0rc0+YEzXx/xd1FOsYtUgsDGFV
 hPvE7mO++1w9Wnu7dAIiCmk3qufF3oLjEngfHBcRy4gNxks7Ub9zEQwj9gCqbugq
 iHVQFQx25ToMnWHJ9ferkzj+eP1yFlkRiteoXMK0w5mU+3iF0qoTUbeMoucwlOmK
 VMncXfoiOdaOvQB6tQ/t
 =XsII
 -----END PGP SIGNATURE-----

Merge tag 'ipc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull ipc regression fixes from Arnd Bergmann:
 "Fix ipc regressions from y2038 patches

  These are two regression fixes for bugs that got introduced during the
  system call rework that went into linux-5.1 but only bisected and
  fixed now:

   - One patch affects semtimedop() on many of the less common 32-bit
     architectures, this just needs a single-line bugfix.

   - The other affects only sparc64 and has a slightly more invasive
     workaround to apply the same change to sparc64 that was done to the
     generic code used everywhere else"

* tag 'ipc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  ipc: fix sparc64 ipc() wrapper
  ipc: fix semtimedop for generic 32-bit architectures
2019-09-10 12:34:13 +01:00
Dmitry Torokhov
1dea33e84d gpiolib: of: fix fallback quirks handling
We should only try to execute fallback quirks handling when previous
call returned -ENOENT, and not when we did not get -EPROBE_DEFER.
The other errors should be treated as hard errors: we did find the GPIO
description, but for some reason we failed to handle it properly.

The fallbacks should only be executed when previous handlers returned
-ENOENT, which means the mapping/description was not found.

Also let's remove the explicit deferral handling when iterating through
GPIO suffixes: it is not needed anymore as we will not be calling
fallbacks for anything but -ENOENT.

Fixes: df451f83e1 ("gpio: of: fix Freescale SPI CS quirk handling")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20190903231856.GA165165@dtor-ws
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-09-10 11:31:35 +01:00
Linus Walleij
aefde297da gpio: fixes for v5.4
- fix a memory leak in gpio-mockup
 - fix two flag validation bugs in gpiolib's character device ioctl()'s
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAl13XhUACgkQEacuoBRx
 13IzaBAAzrC+i1GShEq9tBy6kBT0CQ6DsTZIwjFm3OHR2zcPTu4SjPTQle6a3zWu
 9xE3efY6hmHaIaFEz+zHy9kIccWVYpjyGr1YHUXtQUXlgnLaRNHKcFg2SBpABErM
 qIOrZRn2OG59ln3f3DYAU8BPgJ7GPj3NfYpKQV4GgMnJMrpQ9lPlReCOEfFIqDaI
 WzBTNDKyBmVMsAljd7zMuSDgLM/1plhl35sUVhID5dmUYGmRAfM+Wd1nQhdBKw9L
 jJJs6Qkb5J5ELL/RvLvQKr+wGifddr2t11ycyFM6cX5p77V3/RgS22MBsDnqFy1B
 HdwP6Td50mYq4XiIlNXhrAilLLnnVozlHU0jQGptks+LZnnZxjxUwSljwNHXfASI
 vAc+9uo1AYdlh/3+oZIwKpH/9po7ugLyek9YET++RvdMxNlYqioa0ON/GrEVZAg5
 3lOaOu5UUOzqSMl4TntHlmXZ3Y/L6vCrFXNYczaDJyiec8CT/X2Txqzao0uJfGp8
 hu13t0TI4fLKWSxtoACalAmDNeITLQidJiQ82Nwi6MzkLYYyjbYEFhF9vyd1lW9t
 riyOEZ2ycyqtc9GOY3hAX9hwyDMURlrhrdfmkMedvfYzALeBXNodA28QQySeBjKg
 oLYC5nF7gflSgrRrQjIq3VFtMfy00hmBxhBmFQazZB55lb67PtE=
 =Tdo8
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v5.4-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into fixes

gpio: fixes for v5.4

- fix a memory leak in gpio-mockup
- fix two flag validation bugs in gpiolib's character device ioctl()'s
2019-09-10 11:12:04 +01:00
Linus Torvalds
56037cadf6 regulator: Fixes for v5.3
This is obviouly very late, containing three small and simple
 driver specific fixes.  The main one is the TWL fix, this fixes
 issues with cpufreq on the PMICs used with BeagleBoard generation
 OMAP SoCs which had been broken due to changes in the generic OPP
 code exposing a bug in the regulator driver for these devices
 causing them to think that OPPs weren't supported on the system.
 
 Sorry about sending this so late, I hadn't registered that the
 TWL issue manifested in cpufreq.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl12XUwTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0P0KB/0QkoUb2NjJb+vHhUM4O8IYAq3tyYOh
 gXRbgYEILevB3Vt6PdrvHf0vRgI+yURFc/5uDlYHHoHd4NDj1nYKB8Wt2c8xn9dW
 08eCotje7PnqLOHTK2OlI9hzuoc+tETrA55ZwgPLQDbQH6MQh3OKLagBL0BPxq4M
 vv0twfIH/8YzCzXIg52xIVp/y0Whb81yEr7PXiaNBqDQphjPi32z435Ru9YBX/lq
 PD6hFu5tGoXw6X96e2zQmGD70Jj+Cq0OF7SA5nm/rkGho777Kmn8y+msRbdB7BFp
 lqEF4jgRgHitbwPzehKZcbDFq5xROQCqIAbtFPYdOhqhRQglPkk8Woch
 =czSl
 -----END PGP SIGNATURE-----

Merge tag 'regulator-fix-v5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "This is obviouly very late, containing three small and simple driver
  specific fixes.

  The main one is the TWL fix, this fixes issues with cpufreq on the
  PMICs used with BeagleBoard generation OMAP SoCs which had been broken
  due to changes in the generic OPP code exposing a bug in the regulator
  driver for these devices causing them to think that OPPs weren't
  supported on the system.

  Sorry about sending this so late, I hadn't registered that the TWL
  issue manifested in cpufreq"

* tag 'regulator-fix-v5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: twl: voltage lists for vdd1/2 on twl4030
  regulator: act8945a-regulator: fix ldo register addresses in set_mode hook
  regulator: slg51000: Fix a couple NULL vs IS_ERR() checks
2019-09-09 10:58:57 -07:00
Matthias Lange
cf8f169670 virtio_ring: fix unmap of indirect descriptors
The function virtqueue_add_split() DMA-maps the scatterlist buffers. In
case a mapping error occurs the already mapped buffers must be unmapped.
This happens by jumping to the 'unmap_release' label.

In case of indirect descriptors the release is wrong and may leak kernel
memory. Because the implementation assumes that the head descriptor is
already mapped it starts iterating over the descriptor list starting
from the head descriptor. However for indirect descriptors the head
descriptor is never mapped in case of an error.

The fix is to initialize the start index with zero in case of indirect
descriptors and use the 'desc' pointer directly for iterating over the
descriptor chain.

Signed-off-by: Matthias Lange <matthias.lange@kernkonzept.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-09-09 10:43:15 -04:00
Kent Gibson
5ca2f54b59 gpio: fix line flag validation in lineevent_create
lineevent_create should not allow any of GPIOHANDLE_REQUEST_OUTPUT,
GPIOHANDLE_REQUEST_OPEN_DRAIN or GPIOHANDLE_REQUEST_OPEN_SOURCE to be set.

Fixes: d7c51b47ac ("gpio: userspace ABI for reading/writing GPIO lines")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-09-09 10:04:53 +02:00
Kent Gibson
e95fbc130a gpio: fix line flag validation in linehandle_create
linehandle_create should not allow both GPIOHANDLE_REQUEST_INPUT
and GPIOHANDLE_REQUEST_OUTPUT to be set.

Fixes: d7c51b47ac ("gpio: userspace ABI for reading/writing GPIO lines")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-09-09 10:01:55 +02:00
Wei Yongjun
59929d3a2e gpio: mockup: add missing single_release()
When using single_open() for opening, single_release() should be
used instead of seq_release(), otherwise there is a memory leak.

Fixes: 2a9e27408e ("gpio: mockup: rework debugfs interface")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-09-09 09:55:27 +02:00
Linus Torvalds
f74c2bb987 Linux 5.3-rc8 2019-09-08 13:33:15 -07:00
Linus Torvalds
983f700eab Fix Oops in Clang-compiled kernels (Nick Desaulniers)
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPjU5OPd5QIZ9jqqOGXyLc2htIW0FAl11AIYACgkQGXyLc2ht
 IW1uAQ/+LkwyLy5NfQG0FuWJBsciE8a4dNpN51d8l4EnCsYZVyJXvzleQ0fYGYW3
 xfecrc6bArjN1yZzYhQLJyxZbCFfSRVCu+fCx03uRR2kKXmMPNasjMf/tEm3RgGd
 YOeWpE1cQEJ5t7RuR+HJJoS7oEvUWLOb/rKGV2K6hvQZyv4kYW4uJStUKjUHcDwx
 uIISv7FOOoEY1ZPwtTjbhSRULyBZddDPusWV455j5sAiJD6L15kg6t9/FLaKD+hu
 yA1Z9dv53XFEb5n3s2A9IujpD46N4BykXBB82+GAFYbei+6Ca6mpJp0DaYY2gwqP
 K4XmL+YPwIW0xN7Nv/otM6sehHf40UepWaPhvNKlaicQGAbwTpYEwFp7bViaZ2Sv
 Tj0tDAjkuhAGvdtLc367zyCIEP3XHwyfv8SnoNYiNtb7fcv9hhUsxLOFkr+XKt5S
 jdO0xZH0hGF42yr+MsjIdRXoAfZEHFqETy8paorgxqU02NScpmi/+r8pcTo8pqV3
 w7ziJTB6hoWPw2RNA/VphxucwnbCnZD79P35sE8nhBS94OSi4o27wBZ+B1hCg08Z
 /6ZCT2VlDfgIszH+ueQLa4b53lzTI6EDYyMomLJEvM1jLkSmojzTIzWgMfiN3E4T
 gIu/8ogDHCmDM+nT94/7YYhWcEefuzzO1YYilKCZ4IZxU5DyrlQ=
 =+sX1
 -----END PGP SIGNATURE-----

Merge tag 'compiler-attributes-for-linus-v5.3-rc8' of git://github.com/ojeda/linux

Pull section attribute fix from Miguel Ojeda:
 "Fix Oops in Clang-compiled kernels (Nick Desaulniers)"

* tag 'compiler-attributes-for-linus-v5.3-rc8' of git://github.com/ojeda/linux:
  include/linux/compiler.h: fix Oops for Clang-compiled kernels
2019-09-08 09:34:55 -07:00
Linus Torvalds
def8b72f0e GPIO fixes for the v5.3 series:
all related to the PCA953x driver when handling chips with
 more than 8 ports, now that works again.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAl10s9IACgkQQRCzN7AZ
 XXOy4w/8C9HdOgg4CPCJM8YmBZUiTxbLBjAxyIQ0bkdFB65GcGXwWurhFwguXg1G
 kS9pGDeibW/2pEgF6skONwLIBELXlLaJiuT2y/Vzyoi1oV4URimUDNVlkbwXikUp
 6HVzAO6Xo7rCXy4mfQ92rNeVFe2YWBowUgPpfKjTA6Dz+953eDaLg53LRNhdwBW1
 RVda9Mufr3cUqH4mTC/pH3xnZAJNUxwq7JJ+bX+jYWgNb+LGgIoXCKLRkU1F4TeF
 qwKGFrg590/QCg2qgqoZmUS5B7NuQoe1N9AuPS6UIURlpzz7bOhg3Z9K3db07bdB
 D2yzZhfY3wi4oefe9MpUzgqhVfrRS4F+OBhSLsCCDkRxE4P8+ybrIGQh0sfwy34i
 4NwZdtZLWi8MPeXhRoZGUdP4j/63FqCEwFJcWWN4YVRpLBKN5IVC0R663tC24YTD
 SReSZrvzd/a5URCKDhTm3DJf6JbiaOmNE7LzdZK1qcgVd9E/vKDlrdZNSLxi6G0p
 nCvlQ4QhxCswvRnNafIuFn2HWmcAYj4VinrprtQnlIYFjXvx1uEaSi12Qv2sZOKv
 CTSYFL7+T4xegXVR+5M9VhCSj6fbGJiUZShQ4wXctOdIkHfIyJm+pRVLLaZVHwBm
 YslXu3mmjFiuYfxgP5c9KNki5gH1sU/caqbwtbMwgQBO4sjC6fg=
 =MYtE
 -----END PGP SIGNATURE-----

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

Pull GPIO fixes from Linus Walleij:
 "All related to the PCA953x driver when handling chips with more than 8
  ports, now that works again"

* tag 'gpio-v5.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: pca953x: use pca953x_read_regs instead of regmap_bulk_read
  gpio: pca953x: correct type of reg_direction
2019-09-08 09:30:31 -07:00
Nick Desaulniers
bfafddd8de include/linux/compiler.h: fix Oops for Clang-compiled kernels
GCC unescapes escaped string section names while Clang does not. Because
__section uses the `#` stringification operator for the section name, it
doesn't need to be escaped.

This fixes an Oops observed in distro's that use systemd and not
net.core.bpf_jit_enable=1, when their kernels are compiled with Clang.

Link: https://github.com/ClangBuiltLinux/linux/issues/619
Link: https://bugs.llvm.org/show_bug.cgi?id=42950
Link: https://marc.info/?l=linux-netdev&m=156412960619946&w=2
Link: https://lore.kernel.org/lkml/20190904181740.GA19688@gmail.com/
Acked-by: Will Deacon <will@kernel.org>
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
[Cherry-picked from the __section cleanup series for 5.3]
[Adjusted commit message]
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2019-09-08 14:53:58 +02:00
Jan Stancek
afa8b475c1 x86/timer: Force PIT initialization when !X86_FEATURE_ARAT
KVM guests with commit c8c4076723 ("x86/timer: Skip PIT initialization on
modern chipsets") applied to guest kernel have been observed to have
unusually higher CPU usage with symptoms of increase in vm exits for HLT
and MSW_WRITE (MSR_IA32_TSCDEADLINE).

This is caused by older QEMUs lacking support for X86_FEATURE_ARAT.  lapic
clock retains CLOCK_EVT_FEAT_C3STOP and nohz stays inactive.  There's no
usable broadcast device either.

Do the PIT initialization if guest CPU lacks X86_FEATURE_ARAT.  On real
hardware it shouldn't matter as ARAT and DEADLINE come together.

Fixes: c8c4076723 ("x86/timer: Skip PIT initialization on modern chipsets")
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2019-09-08 09:01:15 +02:00
Linus Torvalds
950b07c14e Revert "x86/apic: Include the LDR when clearing out APIC registers"
This reverts commit 558682b529.

Chris Wilson reports that it breaks his CPU hotplug test scripts.  In
particular, it breaks offlining and then re-onlining the boot CPU, which
we treat specially (and the BIOS does too).

The symptoms are that we can offline the CPU, but it then does not come
back online again:

    smpboot: CPU 0 is now offline
    smpboot: Booting Node 0 Processor 0 APIC 0x0
    smpboot: do_boot_cpu failed(-1) to wakeup CPU#0

Thomas says he knows why it's broken (my personal suspicion: our magic
handling of the "cpu0_logical_apicid" thing), but for 5.3 the right fix
is to just revert it, since we've never touched the LDR bits before, and
it's not worth the risk to do anything else at this stage.

[ Hotpluging of the boot CPU is special anyway, and should be off by
  default. See the "BOOTPARAM_HOTPLUG_CPU0" config option and the
  cpu0_hotplug kernel parameter.

  In general you should not do it, and it has various known limitations
  (hibernate and suspend require the boot CPU, for example).

  But it should work, even if the boot CPU is special and needs careful
  treatment       - Linus ]

Link: https://lore.kernel.org/lkml/156785100521.13300.14461504732265570003@skylake-alporthouse-com/
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Bandan Das <bsd@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-09-07 14:25:54 -07:00
Arnd Bergmann
fb377eb80c ipc: fix sparc64 ipc() wrapper
Matt bisected a sparc64 specific issue with semctl, shmctl and msgctl
to a commit from my y2038 series in linux-5.1, as I missed the custom
sys_ipc() wrapper that sparc64 uses in place of the generic version that
I patched.

The problem is that the sys_{sem,shm,msg}ctl() functions in the kernel
now do not allow being called with the IPC_64 flag any more, resulting
in a -EINVAL error when they don't recognize the command.

Instead, the correct way to do this now is to call the internal
ksys_old_{sem,shm,msg}ctl() functions to select the API version.

As we generally move towards these functions anyway, change all of
sparc_ipc() to consistently use those in place of the sys_*() versions,
and move the required ksys_*() declarations into linux/syscalls.h

The IS_ENABLED(CONFIG_SYSVIPC) check is required to avoid link
errors when ipc is disabled.

Reported-by: Matt Turner <mattst88@gmail.com>
Fixes: 275f22148e ("ipc: rename old-style shmctl/semctl/msgctl syscalls")
Cc: stable@vger.kernel.org
Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-09-07 21:42:25 +02:00
Linus Torvalds
b3a9964cfa Documentation update for 5.3-rc8
Here is a few small patches for the documenation file that came in
 through the char-misc tree in -rc7 for your tree.  They fix the mistake
 in the .rst format that kept the table of companies from showing up in
 the html output, and most importantly, add people's names to the list
 showing support for our process.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCXXPyjA8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ylx1ACfTV2bj5y47d2JOL4K9fG5MOwQ4NUAoIDpi/eS
 q+Ere5H4JyL+cPi8mELt
 =FvIF
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull Documentation updates from Greg KH:
 "A few small patches for the documenation file that came in through the
  char-misc tree in -rc7 for your tree.

  They fix the mistake in the .rst format that kept the table of
  companies from showing up in the html output, and most importantly,
  add people's names to the list showing support for our process"

* tag 'char-misc-5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  Documentation/process: Add Qualcomm process ambassador for hardware security issues
  Documentation/process/embargoed-hardware-issues: Microsoft ambassador
  Documentation/process: Add Google contact for embargoed hardware issues
  Documentation/process: Volunteer as the ambassador for Xen
2019-09-07 11:48:28 -07:00
Trilok Soni
a8e0abae2f Documentation/process: Add Qualcomm process ambassador for hardware security issues
Add Trilok Soni as process ambassador for hardware security issues
from Qualcomm.

Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
Link: https://lore.kernel.org/r/1567796517-8964-1-git-send-email-tsoni@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-07 18:30:54 +01:00
Linus Torvalds
d3464ccd10 dmaengine late fixes for 5.3
Some late fixes for drivers:
  - memory leak in ti crossbar dma driver
  - cleanup of omap dma probe
  - Fix for link list configuration in sprd dma driver
  - Handling fixed for DMACHCLR if iommu is mapped in rcar dma
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJdc2UTAAoJEHwUBw8lI4NHOyMP/R/rB6DdQ1TLbe+NciH/0WZT
 OL0oTSQ3K3pCiA9XqPa1VXaOwPo0w3151Fzd44pfhoQkKGXUpBNHDRSfsV4kvajA
 E9weDEfvatrsh9N5R7ml+sWpsu+dd28NyCIOydDVOx+QjS4f9qZyNcUsnKNKlEij
 N2ZCQpBozQa8kXhDymI5V1ldJSA8OzOqTgdRGKJFwg69hzpUSrkfSbjjhCubA943
 LFLrQ1yp2lRwvd1HAKQutWGzzbXV9PiFCYWTcxHClaYjjhqNY/HBRppAw/Nfi4Qt
 C4JV2fi7IXTqNU5VJD6bfDtL4K2+oA0xkhuqdolrWFu0n1KBDDzC99zPEcjysQrK
 TWaGSNzR0oH9Xgk2IM75Srjorn3ErU5VSW0M8TSVBCoEj8Jt/R2GVFOrtCNMF8KN
 7Lv48FZQsv8SoMeEgH6Kq4GuqRtFbqVzJdkeHpjfNe0hih5PNNW1+VM2RTkoJkPd
 qG7YavUqKbOTbR+QXVY9TLyV14/fp5OnDhrBWZ4vJxU0waHkxNbNLIlEChs8Pa9O
 6UVnpl3bnKzDdFUEf6am5kjOEzTfxlbWcm5AA8rNyGHStDucgq/3c/FLZCuEPLtf
 VPrbR8oMe9iHZjRLwjSgVc1EjfWhmYeAOEBnAhi4duhgq+sXBfomrp8Y1B4voCkA
 m1UxFdLiAl+n1p4MQ9vA
 =rSgu
 -----END PGP SIGNATURE-----

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

Pull dmaengine fixes from Vinod Koul:
 "Some late fixes for drivers:

   - memory leak in ti crossbar dma driver

   - cleanup of omap dma probe

   - Fix for link list configuration in sprd dma driver

   - Handling fixed for DMACHCLR if iommu is mapped in rcar dma"

* tag 'dmaengine-fix-5.3' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: rcar-dmac: Fix DMACHCLR handling if iommu is mapped
  dmaengine: sprd: Fix the DMA link-list configuration
  dmaengine: ti: omap-dma: Add cleanup in omap_dma_probe()
  dmaengine: ti: dma-crossbar: Fix a memory leak bug
2019-09-07 10:00:34 -07:00
Linus Torvalds
1e3778cb22 SCSI fixes on 20190906
Just a single lpfc fix adjusting the number of available queues for
 high CPU count systems.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCXXK/9iYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishUTCAP9C9a9W
 sUBdDpe1bedPFJBBqT3540rucXGlSINXpm20RAEA7C9BkrHk7wFpCmieZscdDG2v
 T5o0P6RYDEShcm91HLk=
 =lrs3
 -----END PGP SIGNATURE-----

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

Pull SCSI fix from James Bottomley:
 "Just a single lpfc fix adjusting the number of available queues for
  high CPU count systems"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: lpfc: Raise config max for lpfc_fcp_mq_threshold variable
2019-09-06 16:18:43 -07:00
Linus Torvalds
7641033e17 libnvdimm fix v5.3-rc8
- Restore support for 1GB alignment namespaces, truncate the end of
   misaligned namespaces.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJdcrYBAAoJEB7SkWpmfYgCIdoQAISVni+8vLZBWe9em1oCeFRP
 xcb/2uyI3r0Ctmc8MrUKP58z1LBexhxomdAPK2gtnKkQ7zP8W/M2cFhpoA9bdp5A
 +yAlCg1N+WjjJ19AEaxicDhtuOzDnPUVJu4AHmGfhTYyunz/+lcMeyBKrpIXrou4
 NxU1SNm7/fQw9k6/aKBbEOYwrYplhxtcVMmNW1p70unHvaS0tIG7qdVYph8GVdbz
 JnMVBz2hW1KlqGo4PVkglNeK65eolX/8be5VJSVQrSu7phsCbICFQCViz73dnrt7
 0rpcdb8HlW1zh/n/7rxHVTBwWdIylMVm1DXX0BiXcj+vX64Nt5vbfSZAxIm+wzJu
 yr8vJ7LmWWMlza0gqwPkeOMCeUuHUeGgjn0OFohsN0S+XmoyBIyNUxwYvbJdpIf0
 8n31HWMMC76TwE5elO1Z3HjXfCfEV9kKpNLdAhi//xuHVKh9nQOYvidm/kTDEKJR
 +9r4Df4IZtQJIS5o10Q4kffiokxPEIy7QNrwn4/p53v4vSK65yiSTHajbxgcUFcC
 SFB1db3tv4TmWnVrzvqKowJE1TtSHyW9pHr33EVRaiCFnWgnsQsWPqdP5SmO+WZX
 lH4PhUMaVSN2ROZTQFg4EYreh2X/+IlOfhKyLFsoN+wQjMv3VXK8wxpsUtFVllmF
 Ja9QGiNImyW0kId//IKK
 =CEfh
 -----END PGP SIGNATURE-----

Merge tag 'libnvdimm-fix-5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fix from Dan Williams:
 "Restore support for 1GB alignment namespaces, truncate the end of
  misaligned namespaces"

* tag 'libnvdimm-fix-5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  libnvdimm/pfn: Fix namespace creation on misaligned addresses
2019-09-06 16:14:32 -07:00
Linus Torvalds
9772152b4b Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fix from Dmitry Torokhov:
 "A tiny update from Benjamin removing a mistakenly added Elan PNP ID so
  that the device is again handled by hid-multitouch"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: elan_i2c - remove Lenovo Legion Y7000 PnpID
2019-09-06 16:12:30 -07:00
Benjamin Tissoires
0c043d70d0 Input: elan_i2c - remove Lenovo Legion Y7000 PnpID
Looks like the Bios of the Lenovo Legion Y7000 is using ELAN061B
when the actual device is supposed to be used with hid-multitouch.

Remove it from the list of the supported device, hoping that
no one will complain about the loss in functionality.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=203467
Fixes: 738c06d0e4 ("Input: elan_i2c - add hardware ID for multiple Lenovo laptops")
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-06 15:40:22 -07:00
Linus Torvalds
36daa831b5 ARM: SoC fixes
There are three more fixes for this week:
 
 - The Windows-on-ARM laptops require a workaround to
   prevent crashing at boot from ACPI
 - The Renesas "draak" board needs one bugfix for
   the backlight regulator
 - Also for Renesas, the "hihope" board accidentally
   had its eMMC turned off in the 5.3 merge window.
 
 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJdcrXdAAoJEJpsee/mABjZ99QP/0Js6+FE+JXOsiUuREdiU8JC
 CmKPbtPT+IyOP+068bpkU1cWWVJ0fyF126D7mfsQfL/VrQTnqCAqkytBidUmh5kX
 LT0392kaB+zLlbCgxX3xdBOBpMT2j/kFE9YbtBQG59867zH1Y5q6U/Pek0lWze39
 llraW2Nlwr/SW+Ffw0tGLXi8dl9FVYNl3jNKfK2/EM51kEeqwTcJvI0WXgOtsUK3
 oiEamod7mQNGEcqnxWf/W9Pj76Y8dlw5H7Q2aTqsb4bYOB0QdCUZqiLfXhyQn0qZ
 wy3bnC5Y+nIg9N2I4GRp0MLQ54xdN41gZtX25OdmPIvawxnf2dfwinN9EeGxUn3G
 RTgv4eBRRNVlheEdUkoyvLaz9jtOO5NCebti9foYcZv9HDEoIHhCqCjgmU7DrW+2
 eP+6pTwnbokbCDtsQ4okfJrAlMkOz4ynGs3sDwzqyxwXKr8Ez0Gho7nVbrRakH4A
 fOmDAZEqcNNGCUC5S1LLZNVLC0hp7HDb50uqJnVcirSxw2Qr/RPxw7lY4iaG1Gcd
 g8NXmLlkWIGpKe4VofPDqRq7Z5UrpAlefpaO3YVV5k1GH3Z6qmDZpP2ItEdue4yr
 wagaHBuv/eJD8xdEij4uPzx+TshZ7JHcO4IjnTE9rUaPi62tyNigJsuik8LNq5zv
 Lm3ZJwXLhzUDG3XUS+JD
 =f5ge
 -----END PGP SIGNATURE-----

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

Pull ARM SoC fixes from Arnd Bergmann:
 "There are three more fixes for this week:

   - The Windows-on-ARM laptops require a workaround to prevent crashing
     at boot from ACPI

   - The Renesas 'draak' board needs one bugfix for the backlight
     regulator

   - Also for Renesas, the 'hihope' board accidentally had its eMMC
     turned off in the 5.3 merge window"

* tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
  soc: qcom: geni: Provide parameter error checking
  arm64: dts: renesas: hihope-common: Fix eMMC status
  arm64: dts: renesas: r8a77995: draak: Fix backlight regulator name
2019-09-06 12:53:31 -07:00
Arnd Bergmann
78e05972c5 ipc: fix semtimedop for generic 32-bit architectures
As Vincent noticed, the y2038 conversion of semtimedop in linux-5.1
broke when commit 00bf25d693 ("y2038: use time32 syscall names on
32-bit") changed all system calls on all architectures that take
a 32-bit time_t to point to the _time32 implementation, but left out
semtimedop in the asm-generic header.

This affects all 32-bit architectures using asm-generic/unistd.h:
h8300, unicore32, openrisc, nios2, hexagon, c6x, arc, nds32 and csky.

The notable exception is riscv32, which has dropped support for the
time32 system calls entirely.

Reported-by: Vincent Chen <deanbo422@gmail.com>
Cc: stable@vger.kernel.org
Cc: Vincent Chen <deanbo422@gmail.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: Mark Salter <msalter@redhat.com>
Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
Cc: Guo Ren <guoren@kernel.org>
Fixes: 00bf25d693 ("y2038: use time32 syscall names on 32-bit")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-09-06 21:49:24 +02:00
Linus Torvalds
30d7030b2f configfs fixes for 5.3
- fix removal vs attribute read/write races (Al Viro)
 -----BEGIN PGP SIGNATURE-----
 
 iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAl1yfl8LHGhjaEBsc3Qu
 ZGUACgkQD55TZVIEUYMXug//bsbudYEZVq1eInmMx6WJkHpYj1jc/gsNxtQiK00P
 dEsUg6GmwrXWcYefEl21hZi8Q7bij0uACmfZ6hxO/PjG1NjElkpUNsZC5WBZMkUg
 IiebsdzPr0KfnIZs7yvQfPYW0l9wvnGr8pGvgT+oWLlcHlPxS7+HBb86vlLWFsxO
 lxWShN3LhyPndPwItauXIZ4Zux6IonsQQpouJm/P1xcK206d3n9rB2hH45XupI9S
 2PhOY6YWfe5wgQN7GgXuMdwnvH+v1M/ELzbiz80aAnlTLQKDsi2n+g2KtYdoJBzD
 6pCzHgQDaW6O2XZJKTQ1xgAnIVKKO1GeRVZ2aZrXe588hJMe9JyJmj/uAltUJ0hJ
 YoIPZIXcU/Tl9O/4uPvqXgxcTCGCBYwHKQJa3d9krJtjrrUU/Secw57YLW0RLm1K
 FkPUSugEAb79l4f5L6dgowLaJwQ7RA+oDfXyvadJNi+Bb6E6PCQcb3rSDINPm4GB
 SXwzh2x1WlEVYz/1XaXYDf0YvmDpvTtRfNJmYng+OJscDkzQF8D2Jk5sjRxjUYys
 yjwDI++z/L0+iwl/BPIFZM/im+Tl8/MVzgB45pG1k8VBKB5L2a2G9CMty4WGkZSs
 rq9XiLbpsGapGoif+nVLoECLLDJmHULqa+wzI04FNpjhWihirqoK2JAV8rQ8MoOo
 1LE=
 =7/hj
 -----END PGP SIGNATURE-----

Merge tag 'configfs-for-5.3' of git://git.infradead.org/users/hch/configfs

Pull configfs fixes from Christoph Hellwig:
 "Late configfs fixes from Al that fix pretty nasty removal vs attribute
  access races"

* tag 'configfs-for-5.3' of git://git.infradead.org/users/hch/configfs:
  configfs: provide exclusion between IO and removals
  configfs: new object reprsenting tree fragments
  configfs_register_group() shouldn't be (and isn't) called in rmdirable parts
  configfs: stash the data we need into configfs_buffer at open time
2019-09-06 12:44:08 -07:00
Linus Torvalds
76f5e9f870 IOMMU Fixes for Linux v5.3-rc7
Including:
 
 	* Revert for an Intel VT-d patch that caused problems for some
 	  users.
 
 	* Removal of a feature in the Intel VT-d driver that was never
 	  supported in hardware. This qualifies as a fix because the
 	  code for this feature sets reserved bits in the invalidation
 	  queue descriptor, causing failed invalidations on real
 	  hardware.
 
 	* Two fixes for AMD IOMMU driver to fix a race condition and to
 	  add a missing IOTLB flush when kernel is booted in kdump mode.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEr9jSbILcajRFYWYyK/BELZcBGuMFAl1ydqsACgkQK/BELZcB
 GuMXZg//TbZjRmobBbtk+7yotzYS7S3W9WNcT97T7x+xKluCjh41j5QDRCajHZQI
 q+b8Dl0kzvydFOCdS4au7lF9sX/QV0yA20JIxgHQ4RiX5L9C7TAuCzXZxASYwryv
 CSHo5dHcIVLtfClW5wIAmo+PPDgQkZV6eY2BnTF1fkked+tf+rpH0MohdafFn9Oy
 gXKblNR6NMIDt7QnuhHLqF3/7aU8TVLQsk7zmieqEXxZN6FIEl4OeOADX/2zYjJh
 G2YaHGdyG8vvQuKarUMiEADKLMaxM8kfGcDCu0HJeXlz6cLiw3joM2E6V2FvEfTA
 25Jwc22784EG2DoosV6HMMGFrYIcMIhb4tXVsSTU2W+mypsPfad2IYk3TrBG9QV3
 Lb3AnpqcY79HEE6GtE1D8iX0b0rFIkEwMj7zxIX2najgsOxkNt9C8UnWrIPOtWvs
 eEaUFRnA/lKVsXWl09WD5gMboRZqRSMmmQWp0sIKtdscHLo8TmdTPefSPMNDQLG5
 odjxg91w/3Rbx11j49AqO6gZ9gpcYGnTBFpIVemC8WGmts6+R9QZ9OnkfWdUxXf2
 FKOBaWPYnsoh71pXsz9v9tW4iQPD5+81hR/92Nf8PdFgGgCyOhhf+PtbkFBCbXo5
 r40y8jQ21SIHYOF06m3u24DUK+KETvpNHmyS65r5C6yDWPJMoq8=
 =SEs8
 -----END PGP SIGNATURE-----

Merge tag 'iommu-fixes-v5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:

 - Revert an Intel VT-d patch that caused problems for some users.

 - Removal of a feature in the Intel VT-d driver that was never
   supported in hardware. This qualifies as a fix because the code for
   this feature sets reserved bits in the invalidation queue descriptor,
   causing failed invalidations on real hardware.

 - Two fixes for AMD IOMMU driver to fix a race condition and to add a
   missing IOTLB flush when kernel is booted in kdump mode.

* tag 'iommu-fixes-v5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/amd: Fix race in increase_address_space()
  iommu/amd: Flush old domains in kdump kernel
  iommu/vt-d: Remove global page flush support
  Revert "iommu/vt-d: Avoid duplicated pci dma alias consideration"
2019-09-06 12:22:36 -07:00
Linus Torvalds
0445971000 MMC core:
- Fix card init for some eMMCs that need retries for CMD6
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAl1yMP4XHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCklcBAAlaHw4FDXLwOzj9O5d1slPK3U
 wttFl0REMY8KQSVckIVBbt3jtv3SO6Zb3mDL76ELPJPoooiXLTzjoQXTj0Oxrdv7
 E9y96gohFLLioiN5NfNfYNnVyMYUKwZqkFhR+t9DuMofkxW2K1Nh8CRThXpNhowT
 TT9B7cXlCyByLp1JyXRzt2A+4fhp/xSAfrD88iiPjBLcaGB8Z7BJT9G//VeIr0Xm
 JDLokxw6exyWjUQUATmPNFBeT6vykK26hXYZS4NnXXNlBfSTZpTId7lI3pF3QZrN
 RQUAU4oMw8k9Snv+ZNtPKufx86QmpbXBa7Ilzh9Qcpyopn7YiaSEo2hABBcLgJVl
 q7v0jr0LfpEzsxiX4rPibrYuJhOg8Hv1eSQtTLMAi4bFJHhhiLR7UVz6DT6MPwnp
 VrpUL6kLt9lXwm6sVcUCxiZ3GvQOqs++XJGyR+JWCt1/nJi57UnOX4qbtc8X9IaW
 6xfdVn4Vr/jfNJfBtyI1FMo1Aqhg0yWSiGkdag0bwXVHL7UUHS1CVCTYCN8FXMrW
 iKqRcriSN+C+5C6pbXtGbCM2O3fwpIas2Mj7hrcoRERMBNa6GGn99si7dWwQPJ1h
 6rBnss0g6+17K4yvN09YwYaQixp3bLVmktCCvz+EgUYGrAXAdkOc1WD3TuHnoMQI
 cjOxBinCiPDUyRUm9/A=
 =jpf+
 -----END PGP SIGNATURE-----

Merge tag 'mmc-v5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fix from Ulf Hansson:
 "Revert in order to fix card init for some eMMCs that need retries for
  CMD6"

* tag 'mmc-v5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  Revert "mmc: core: do not retry CMD6 in __mmc_switch()"
2019-09-06 09:01:49 -07:00
Linus Torvalds
08d433d812 drm fixes for 5.3-rc8 (or final)
nouveau:
 - add missing MODULE_FIRMWARE definitions
 
 igenic:
 - hardcode panel type DPI
 
 vmwgfx:
 - double free fix
 
 core:
 - command line mode parser fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJdcgYAAAoJEAx081l5xIa+Td4QAKUcxyaAMbAjJde49nsrWQvY
 pyLdNLLDmE3xBPCetERn8QMgGr9K4c0mcVZ2deWVU/WS10BWEe5T0JlwfTqH7VnH
 rmCWh5dJiHCN9sjcoM9XbOJGbOiO6b0vNd4SMwHtMLfdeIHWHJovPhsfbD89NSux
 NxYQRYh9l1+vsbJC6kznAi/9Itg4xQ6BCeGFgq/vJjRA23E6+D7lKeZK9cykEV7Q
 fevjePoFtdmuzurbWS8gEWF/1mBTp7beAUTJYn5hdh3mj4HXtrmy71XaCwzj1nqd
 ssn3tOmmIvTmqvoU3aR7WbOsHIiaynU0HGh4sAUoZ8BLbuk6LtqGtGSuXrevYtS0
 q2QYCL0fSd2qUP64zz/hQAF0Pbfw0kUoyec/AQdVl+0Uk4rcrtLmpYNsw/2l2fKZ
 t5rq1quZ5FnD2GSNSi308ZhmHhjlluQzsd4oezYZndIiIG9mEPGfgrlvfWJqiFO4
 MAvVhP/NilvUnTvocVZtDe+kU3WGeqOUKK5T4aKaQeR1pbh4YF5aJpAoiOHtMldq
 W9Dm4sXu2PSdCzFl77k9QJ7XrUC9/dlr2SZ69K7G49LKTraVaQfNeXgvSftYKjWk
 eO8Kxk9QvGFdtwr2K5AOHOCcBtOQOl5l8RmrgAr9nGe3OZRP4+Bc1EEhYaTFdc6n
 EVIZe4yo/G8yX52/wR6L
 =dOSF
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2019-09-06' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Live from my friend's couch in Barcelona, latest round of drm fixes.

  The command line parser regression fixes look a bit larger because
  they come with selftests included for the bugs they fix. Otherwise a
  single nouveau, single ingenic and single vmwgfx fix:

  nouveau:
   - add missing MODULE_FIRMWARE definitions

  igenic:
   - hardcode panel type DPI

  vmwgfx:
   - double free fix

  core:
   - command line mode parser fixes"

* tag 'drm-fixes-2019-09-06' of git://anongit.freedesktop.org/drm/drm:
  drm/vmwgfx: Fix double free in vmw_recv_msg()
  drm/nouveau/sec2/gp102: add missing MODULE_FIRMWAREs
  drm/selftests: modes: Add more unit tests for the cmdline parser
  drm/modes: Introduce a whitelist for the named modes
  drm/modes: Fix the command line parser to take force options into account
  drm/modes: Add a switch to differentiate free standing options
  drm/ingenic: Hardcode panel type to DPI
2019-09-06 08:58:19 -07:00
Linus Torvalds
9d098a6234 virtio, vhost, balloon: bugfixes
A couple of last minute bugfixes. And a revert of a failed attempt at
 metadata access optimization - we'll try again in the next cycle.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJdb6MSAAoJECgfDbjSjVRpWq0IALJqn4RTQJiFUg4pa6qV1Uxb
 DJtHCmYhW+m9VB+5gmKJ9ugFcBbdbSEy81kwrc6lKywTttevk+whrlRry49ufbMx
 htoRFGG4gm2RgmXNkV92RQwrz0ajtG0hjm3/Gaxi2OzOudpB4/DJnUcXJKEa2UvD
 qAH4n9SN6QXQ6zfU20EvNyA0++RwIkg9xx0r5IZ8eddOlS5tqFasr7TkMBr7Tj9V
 a1QkCVGfCDUBpthMwrOuJpYkTWf2vRyarqWUvxsJbFqyECossHIYM7EWGu8apFYW
 pbQbn8bXVNNJoA8ERmCkiptHQALK8qeONu0MOarnDVRXvGni4OHTuXJfMYyCkEY=
 =RqIf
 -----END PGP SIGNATURE-----

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull virtio fixes from Michael Tsirkin:
 "virtio, vhost, and balloon bugfixes.

  A couple of last minute bugfixes. And a revert of a failed attempt at
  metadata access optimization - we'll try again in the next cycle"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  mm/balloon_compaction: suppress allocation warnings
  Revert "vhost: access vq metadata through kernel virtual address"
  vhost: Remove unnecessary variable
  virtio-net: lower min ring num_free for efficiency
  vhost/test: fix build for vhost test
  vhost/test: fix build for vhost test
2019-09-06 08:56:06 -07:00
Linus Torvalds
13da6ac106 powerpc fixes for 5.3 #5
One fix for a boot hang on some Freescale machines when PREEMPT is enabled.
 
 Two CVE fixes for bugs in our handling of FP registers and transactional memory,
 both of which can result in corrupted FP state, or FP state leaking between
 processes.
 
 Thanks to:
   Chris Packham, Christophe Leroy, Gustavo Romero, Michael Neuling.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAl1x06oTHG1wZUBlbGxl
 cm1hbi5pZC5hdQAKCRBR6+o8yOGlgCZzD/90EyaWJVS8WPZopoIdnuOfB/F7EZFY
 Lhgd640S1p4o8BUZaQ1T19JOzp6HlO38myOptBufY0BsIJW0M2GwngnBPzSPW8r7
 ImTTf5cU0CDe2m3OJdfBrVpnGmUsmoWxwrsFJZ9wbsXhCwbbUzOUuxD/B9wBIGi/
 sPpTlaYZBhu3cKs9EWPKAODJhtEf55Q1c62gftfj8Y5u8uxQGinYInCghAUr+3Zv
 uCw1CSxOV7yGxfgc1sbOptidOiG4Pljw4EDCUFLpjWTYgPVERASbPHs3C4xuAHGq
 IYuNDUJbwrxMU9BKLFzvL4MKWa5XtzLE34oY8SuyyVAbIQTszgCn2rIwlJXH88PO
 UtId9accmS+dy2lRI+90dC0qeTgUUIZXS1NF0cl5YNRN0TlMyjHL2/sRxCZF2svF
 EaGNjTQLAsfX0ccO9xQr8+KBSfFURMEkO8QQAR0lzJmIgbvSuzfjlZpbcYd2Nqfe
 EiYU4GeAQSn14vi0ZMdRWxc1rki9pPhGkrUwToDALsiEedRB03olM955uecf7fra
 S8MzHFBYh8Apd/lsAj53uAbL2rIHDJ5+6/eezYp7bRbo6FlvWDs9kmYTX3p3ixq1
 Q4gDHfbwnWxxhjUBri5QNZF9YHgkyGPURGpIbdXk9R4Hc7ihQWwDBcSrueca51Ug
 m97SLF5/+yWx0A==
 =C+wa
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-5.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
 "One fix for a boot hang on some Freescale machines when PREEMPT is
  enabled.

  Two CVE fixes for bugs in our handling of FP registers and
  transactional memory, both of which can result in corrupted FP state,
  or FP state leaking between processes.

  Thanks to: Chris Packham, Christophe Leroy, Gustavo Romero, Michael
  Neuling"

* tag 'powerpc-5.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/tm: Fix restoring FP/VMX facility incorrectly on interrupts
  powerpc/tm: Fix FP/VMX unavailable exceptions inside a transaction
  powerpc/64e: Drop stale call to smp_processor_id() which hangs SMP startup
2019-09-06 08:54:45 -07:00