1. 06 May, 2020 36 commits
  2. 02 May, 2020 4 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.19.120 · fdc07232
      Greg Kroah-Hartman authored
      fdc07232
    • Al Viro's avatar
      propagate_one(): mnt_set_mountpoint() needs mount_lock · fa87bf60
      Al Viro authored
      commit b0d3869c upstream.
      
      ... to protect the modification of mp->m_count done by it.  Most of
      the places that modify that thing also have namespace_lock held,
      but not all of them can do so, so we really need mount_lock here.
      Kudos to Piotr Krysiuk <piotras@gmail.com>, who'd spotted a related
      bug in pivot_root(2) (fixed unnoticed in 5.3); search for other
      similar turds has caught out this one.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarPiotr Krysiuk <piotras@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fa87bf60
    • Ritesh Harjani's avatar
      ext4: check for non-zero journal inum in ext4_calculate_overhead · 38faccf5
      Ritesh Harjani authored
      commit f1eec3b0 upstream.
      
      While calculating overhead for internal journal, also check
      that j_inum shouldn't be 0. Otherwise we get below error with
      xfstests generic/050 with external journal (XXX_LOGDEV config) enabled.
      
      It could be simply reproduced with loop device with an external journal
      and marking blockdev as RO before mounting.
      
      [ 3337.146838] EXT4-fs error (device pmem1p2): ext4_get_journal_inode:4634: comm mount: inode #0: comm mount: iget: illegal inode #
      ------------[ cut here ]------------
      generic_make_request: Trying to write to read-only block-device pmem1p2 (partno 2)
      WARNING: CPU: 107 PID: 115347 at block/blk-core.c:788 generic_make_request_checks+0x6b4/0x7d0
      CPU: 107 PID: 115347 Comm: mount Tainted: G             L   --------- -t - 4.18.0-167.el8.ppc64le #1
      NIP:  c0000000006f6d44 LR: c0000000006f6d40 CTR: 0000000030041dd4
      <...>
      NIP [c0000000006f6d44] generic_make_request_checks+0x6b4/0x7d0
      LR [c0000000006f6d40] generic_make_request_checks+0x6b0/0x7d0
      <...>
      Call Trace:
      generic_make_request_checks+0x6b0/0x7d0 (unreliable)
      generic_make_request+0x3c/0x420
      submit_bio+0xd8/0x200
      submit_bh_wbc+0x1e8/0x250
      __sync_dirty_buffer+0xd0/0x210
      ext4_commit_super+0x310/0x420 [ext4]
      __ext4_error+0xa4/0x1e0 [ext4]
      __ext4_iget+0x388/0xe10 [ext4]
      ext4_get_journal_inode+0x40/0x150 [ext4]
      ext4_calculate_overhead+0x5a8/0x610 [ext4]
      ext4_fill_super+0x3188/0x3260 [ext4]
      mount_bdev+0x778/0x8f0
      ext4_mount+0x28/0x50 [ext4]
      mount_fs+0x74/0x230
      vfs_kern_mount.part.6+0x6c/0x250
      do_mount+0x2fc/0x1280
      sys_mount+0x158/0x180
      system_call+0x5c/0x70
      EXT4-fs (pmem1p2): no journal found
      EXT4-fs (pmem1p2): can't get journal size
      EXT4-fs (pmem1p2): mounted filesystem without journal. Opts: dax,norecovery
      
      Fixes: 3c816ded ("ext4: use journal inode to determine journal overhead")
      Reported-by: default avatarHarish Sriram <harish@linux.ibm.com>
      Signed-off-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Link: https://lore.kernel.org/r/20200316093038.25485-1-riteshh@linux.ibm.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      38faccf5
    • Yuval Basson's avatar
      qed: Fix use after free in qed_chain_free · 64325c28
      Yuval Basson authored
      commit 8063f761 upstream.
      
      The qed_chain data structure was modified in
      commit 1a4a6975 ("qed: Chain support for external PBL") to support
      receiving an external pbl (due to iWARP FW requirements).
      The pages pointed to by the pbl are allocated in qed_chain_alloc
      and their virtual address are stored in an virtual addresses array to
      enable accessing and freeing the data. The physical addresses however
      weren't stored and were accessed directly from the external-pbl
      during free.
      
      Destroy-qp flow, leads to freeing the external pbl before the chain is
      freed, when the chain is freed it tries accessing the already freed
      external pbl, leading to a use-after-free. Therefore we need to store
      the physical addresses in additional to the virtual addresses in a
      new data structure.
      
      Fixes: 1a4a6975 ("qed: Chain support for external PBL")
      Signed-off-by: default avatarMichal Kalderon <mkalderon@marvell.com>
      Signed-off-by: default avatarYuval Bason <ybason@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64325c28