1. 19 Jun, 2019 29 commits
  2. 17 Jun, 2019 5 commits
  3. 15 Jun, 2019 6 commits
    • Greg Kroah-Hartman's avatar
      Linux 5.1.10 · 7e1bdd68
      Greg Kroah-Hartman authored
      7e1bdd68
    • Jens Axboe's avatar
      io_uring: fix failure to verify SQ_AFF cpu · cf1fa8c9
      Jens Axboe authored
      commit 44a9bd18 upstream.
      
      The test case we have is rightfully failing with the current kernel:
      
      io_uring_setup(1, 0x7ffe2cafebe0), flags: IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF, resv: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000, sq_thread_cpu: 4
      expected -1, got 3
      
      This is in a vm, and CPU3 is the last valid one, hence asking for 4
      should fail the setup with -EINVAL, not succeed. The problem is that
      we're using array_index_nospec() with nr_cpu_ids as the index, hence we
      wrap and end up using CPU0 instead of CPU4. This makes the setup
      succeed where it should be failing.
      
      We don't need to use array_index_nospec() as we're not indexing any
      array with this. Instead just compare with nr_cpu_ids directly. This
      is fine as we're checking with cpu_online() afterwards.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cf1fa8c9
    • Takashi Iwai's avatar
      ALSA: seq: Cover unsubscribe_port() in list_mutex · bc9dcb27
      Takashi Iwai authored
      commit 7c32ae35 upstream.
      
      The call of unsubscribe_port() which manages the group count and
      module refcount from delete_and_unsubscribe_port() looks racy; it's
      not covered by the group list lock, and it's likely a cause of the
      reported unbalance at port deletion.  Let's move the call inside the
      group list_mutex to plug the hole.
      
      Reported-by: syzbot+e4c8abb920efa77bace9@syzkaller.appspotmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bc9dcb27
    • Amir Goldstein's avatar
      ovl: support stacked SEEK_HOLE/SEEK_DATA · f40c32fd
      Amir Goldstein authored
      commit 9e46b840 upstream.
      
      Overlay file f_pos is the master copy that is preserved
      through copy up and modified on read/write, but only real
      fs knows how to SEEK_HOLE/SEEK_DATA and real fs may impose
      limitations that are more strict than ->s_maxbytes for specific
      files, so we use the real file to perform seeks.
      
      We do not call real fs for SEEK_CUR:0 query and for SEEK_SET:0
      requests.
      
      Fixes: d1d04ef8 ("ovl: stack file ops")
      Reported-by: default avatarEddie Horng <eddiehorng.tw@gmail.com>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f40c32fd
    • Jiufei Xue's avatar
      ovl: check the capability before cred overridden · 289e5e05
      Jiufei Xue authored
      commit 98487de3 upstream.
      
      We found that it return success when we set IMMUTABLE_FL flag to a file in
      docker even though the docker didn't have the capability
      CAP_LINUX_IMMUTABLE.
      
      The commit d1d04ef8 ("ovl: stack file ops") and dab5ca8f ("ovl: add
      lsattr/chattr support") implemented chattr operations on a regular overlay
      file. ovl_real_ioctl() overridden the current process's subjective
      credentials with ofs->creator_cred which have the capability
      CAP_LINUX_IMMUTABLE so that it will return success in
      vfs_ioctl()->cap_capable().
      
      Fix this by checking the capability before cred overridden. And here we
      only care about APPEND_FL and IMMUTABLE_FL, so get these information from
      inode.
      
      [SzM: move check and call to underlying fs inside inode locked region to
      prevent two such calls from racing with each other]
      Signed-off-by: default avatarJiufei Xue <jiufei.xue@linux.alibaba.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      289e5e05
    • Greg Kroah-Hartman's avatar
      Revert "drm/nouveau: add kconfig option to turn off nouveau legacy contexts. (v3)" · e73b09c7
      Greg Kroah-Hartman authored
      This reverts commit 1e07d637 which is
      commit b30a43ac upstream.
      
      Sven reports:
      	Commit 1e07d637 ("drm/nouveau: add kconfig option to turn off nouveau
      	legacy contexts. (v3)") has caused a build failure for me when I
      	actually tried that option (CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT=n):
      
      	,----
      	| Kernel: arch/x86/boot/bzImage is ready  (#1)
      	|   Building modules, stage 2.
      	|   MODPOST 290 modules
      	| ERROR: "drm_legacy_mmap" [drivers/gpu/drm/nouveau/nouveau.ko] undefined!
      	| scripts/Makefile.modpost:91: recipe for target '__modpost' failed
      	`----
      
      	Upstream does not have that problem, as commit bed2dd84 ("drm/ttm:
      	Quick-test mmap offset in ttm_bo_mmap()") has removed the use of
      	drm_legacy_mmap from nouveau_ttm.c.  Unfortunately that commit does not
      	apply in 5.1.9.
      
      The ensuing discussion proposed a number of one-off patches, but no
      solid agreement was made, so just revert the commit for now to get
      people's systems building again.
      Reported-by: default avatarSven Joachim <svenjoac@gmx.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Thomas Backlund <tmb@mageia.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e73b09c7