- 27 12月, 2019 40 次提交
-
-
由 zhangyi (F) 提交于
hulk inclusion category: bugfix bugzilla: 18685 CVE: NA --------------------------- Remount process will release system zone which was allocated before if "noblock_validity" is specified. If we mount an ext4 file system to two mountpoints with default mount options, and then remount one of them with "noblock_validity", it may trigger a use after free problem when someone accessing the other one. # mount /dev/sda foo # mount /dev/sda bar User access mountpoint "foo" | Remount mountpoint "bar" | ext4_map_blocks() | ext4_remount() check_block_validity() | ext4_setup_system_zone() ext4_data_block_valid() | ext4_release_system_zone() | free system_blks rb nodes access system_blks rb nodes | trigger use after free | This problem can also be reproduced by one mountpint, At the same time, add_system_zone() can get called during remount as well so there can be racing ext4_data_block_valid() reading the rbtree at the same time. This patch add RCU to protect system zone from releasing or building when doing a remount which inverse current "noblock_validity" mount option. It assign the rbtree after the whole tree was complete and do actual freeing after rcu grace period, avoid any intermediate state. Signed-off-by: Nzhangyi (F) <yi.zhang@huawei.com> Reviewed-by: NJan Kara <jack@suse.cz> Signed-off-by: Nzhangyi (F) <yi.zhang@huawei.com> Reviewed-by: Nyangerkun <yangerkun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Khazhismel Kumykov 提交于
mainline inclusion from mainline-5.2-rc1 commit 4b99faa2 category: bugfix bugzilla: 18685 CVE: NA --------------------------- Signed-off-by: NKhazhismel Kumykov <khazhy@google.com> Signed-off-by: NTheodore Ts'o <tytso@mit.edu> Reviewed-by: NAndreas Dilger <adilger@dilger.ca> Signed-off-by: Nzhangyi (F) <yi.zhang@huawei.com> Reviewed-by: Nyangerkun <yangerkun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Hu Chunzhi 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA Add default config for CONFIG_INFINIBAND_HNS_DFX and CONFIG_INFINIBAND_HNS_TEST in hulk_defconfig and syzkaller_defconfig. Reviewed-by: NHuang Dongdong <hdd.huang@huawei.com> Signed-off-by: NHu Chunzhi <huchunzhi@huawei.com> Acked-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Hu Chunzhi 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA This patch changes some code format and fix device initialization bugs. Reviewed-by: NHuang Dongdong <hdd.huang@huawei.com> Signed-off-by: NHu Chunzhi <huchunzhi@huawei.com> Acked-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Hu Chunzhi 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA This patch deletes unused parameters and functions. Reviewed-by: NHuang Dongdong <hdd.huang@huawei.com> Signed-off-by: NHu Chunzhi <huchunzhi@huawei.com> Acked-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Hu Chunzhi 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA This patch adds roce dfx files. These dfx files provide the ability to adjust some specifications of roce driver and the ability to query information of several main rdma objects, such as QP, MR, CQ, etc. Reviewed-by: NHuang Dongdong <hdd.huang@huawei.com> Signed-off-by: NHu Chunzhi <huchunzhi@huawei.com> Acked-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Sun Ke 提交于
hulk inclusion category: bugfix bugzilla: 20213 CVE: NA ------------------------------------------------- When try to get the lock failed, before return, execute the nbd_config_put() to decrease the nbd->config_refs. If the nbd->config_refs is added but not decreased. Then will not execute nbd_clear_sock() in nbd_config_put(). bd->task_setup will not be cleared away. Finally, print"Device being setup by another task" in nbd_add_sock() and nbd device can not be reused. https://patchwork.kernel.org/patch/11087617/ Fixes: 8f3ea359 ("nbd: handle unexpected replies better") Signed-off-by: NSun Ke <sunke32@huawei.com> Reviewed-by: NZhangXiaoxu <zhangxiaoxu5@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 tanshukun 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA Feature or Bugfix:Bugfix Signed-off-by: Ntanshukun (A) <tanshukun1@huawei.com> Reviewed-by: Nwangzhou <wangzhou1@hisilicon.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Yufeng Mo 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA If the selftest and reset are performed at the same time, the loopback setting may be still in the enable state after the reset. As a result, packets cannot be sent out. This patch fixes this issue by disabling loopback in hclge_mac_init. Feature or Bugfix:Bugfix Signed-off-by: NYufeng Mo <moyufeng@huawei.com> Reviewed-by: Nlinyunsheng <linyunsheng@huawei.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 liaoguojia 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA Functions is used only in the declared file. So we need to add a keyword static for them to Reduce coupling. Those functions inclding as below: hclge_dbg_get_m7_stats_info() hclge_reset_done() hclge_handle_imp_error() Feature or Bugfix:Bugfix Signed-off-by: Nliaoguojia <liaoguojia@huawei.com> Reviewed-by: Nlinyunsheng <linyunsheng@huawei.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 liaoguojia 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA Relational and logical operators evaluate to bool, explicit conversion is overly verbose and unneeded Fix tag: fdbf549b ("add supports for arfs") Feature or Bugfix:Bugfix Signed-off-by: Nliaoguojia <liaoguojia@huawei.com> Reviewed-by: Nlinyunsheng <linyunsheng@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 liaoguojia 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA In function hns3_nic_bd_numa(), return type as Unsigned, however the return value as Signed. It would cause unexcept errors in some case. This patch modify return statement to ensuring the return value match. Fix tag: d6a78e3c ("unify maybe_stop_tx for TSO and non-TSO case") Feature or Bugfix:Bugfix Signed-off-by: Nliaoguojia <liaoguojia@huawei.com> Reviewed-by: Nlipeng <lipeng321@huawei.com> Reviewed-by: NYunsheng Lin <linyunsheng@huawei.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 shenjian 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA To be compatible with futher firmware version, use "0xFE", instead of "0x0E", so does other macroes here. Feature or Bugfix:Bugfix Signed-off-by: NJian Shen <shenjian15@huawei.com> Reviewed-by: Nlinyunsheng <linyunsheng@huawei.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 shenjian 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA According to user manual, there are several independent parameters for switch parameter configure command. If they are configured in two thread concurrently, we may encounter RMW issue. Now this command is refreshed, adding a new parameter "mask", then we can tell firmware only to change the specified parameter without affecting others. This patch refactors the switch parameter configure function to support the new command. Feature or Bugfix:Bugfix Signed-off-by: Nshenjian (K) <shenjian15@huawei.com> Reviewed-by: Nlipeng <lipeng321@huawei.com> Reviewed-by: NYunsheng Lin <linyunsheng@huawei.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 zhangwei 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA Signed-off-by: NZhangwei <zhangwei375@huawei.com> Reviewed-by: Nlingmingqiang <lingmingqiang@huawei.com> Signed-off-by: Nlingmingqiang <lingmingqiang@huawei.com> Reviewed-by: NZhou Wang <wangzhou1@hisilicon.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 lingmingqiang 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA Signed-off-by: Nliulongfang <liulongfang@huawei.com> Reviewed-by: Nxuzaibo <xuzaibo@huawei.com> Signed-off-by: Nlingmingqiang <lingmingqiang@huawei.com> Reviewed-by: NZhou Wang <wangzhou1@hisilicon.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 lingmingqiang 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA In this patch, we try to reserve more DMA memory for usre space application.At first, we bring SS(share static region) slice, which includes a continuous physical address memory. And, a SS region of a Warpdrive queue can have multiple slices. Before mapping to user space VMA, the slices will be sorted in a physical increasing order and merged those whose physical addresses are continuous. After reserving the memory, several IOCAL system call will be done to get the slices' physical address information for user space. Signed-off-by: Nyumeng <yumeng18@huawei.com> Reviewed-by: Nxuzaibo <xuzaibo@huawei.com> Signed-off-by: Nlingmingqiang <lingmingqiang@huawei.com> Reviewed-by: NZhou Wang <wangzhou1@hisilicon.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 liaoguojia 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA ARRAY_SIZE was defined as : (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)). It would detect validity of input parameters. So using ARRAY_SIZE() macro insteand sizeof(arr)/sizeof((arr)[0]) could improves the code readability. Feature or Bugfix:Bugfix Signed-off-by: Nliaoguojia <liaoguojia@huawei.com> Reviewed-by: Nlinyunsheng <linyunsheng@huawei.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Darrick J. Wong 提交于
mainline inclusion from mainline-5.0-rc1 commit 7af8150f category: bugfix bugzilla: 18922 CVE: NA --------------------------- Use %pS instead of %pF in ftrace strings so that we record the actual function address instead of the function descriptor. Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Reviewed-by: NEric Sandeen <sandeen@redhat.com> Signed-off-by: Nyu kuai <yukuai3@huawei.com> Reviewed-by: Nzhengbin <zhengbin13@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Brian Foster 提交于
mainline inclusion from mainline-4.20-rc1 commit efc3289c category: bugfix bugzilla: 18876 CVE: NA --------------------------- In the typical unmount case, the AIL is forced out by the unmount sequence before the xfsaild task is stopped. Since AIL items are removed on writeback completion, this means that the AIL ->ail_buf_list delwri queue has been drained. This is not always true in the shutdown case, however. It's possible for buffers to sit on a delwri queue for a period of time across submission attempts if said items are locked or have been relogged and pinned since first added to the queue. If the attempt to log such an item results in a log I/O error, the error processing can shutdown the fs, remove the item from the AIL, stale the buffer (dropping the LRU reference) and clear its delwri queue state. The latter bit means the buffer will be released from a delwri queue on the next submission attempt, but this might never occur if the filesystem has shutdown and the AIL is empty. This means that such buffers are held indefinitely by the AIL delwri queue across destruction of the AIL. Aside from being a memory leak, these buffers can also hold references to in-core perag structures. The latter problem manifests as a generic/475 failure, reproducing the following asserts at unmount time: XFS: Assertion failed: atomic_read(&pag->pag_ref) == 0, file: fs/xfs/xfs_mount.c, line: 151 XFS: Assertion failed: atomic_read(&pag->pag_ref) == 0, file: fs/xfs/xfs_mount.c, line: 132 To prevent this problem, clear the AIL delwri queue as a final step before xfsaild() exit. The !empty state should never occur in the normal case, so add an assert to catch unexpected problems going forward. [dgc: add comment explaining need for xfs_buf_delwri_cancel() after calling xfs_buf_delwri_submit_nowait().] Signed-off-by: NBrian Foster <bfoster@redhat.com> Reviewed-by: NDave Chinner <dchinner@redhat.com> Signed-off-by: NDave Chinner <david@fromorbit.com> Signed-off-by: Nyu kuai <yukuai3@huawei.com> Reviewed-by: Nzhengbin <zhengbin13@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Nick Bowler 提交于
mainline inclusion from mainline-5.0-rc1 commit c456d644 category: bugfix bugzilla: 18919 CVE: NA --------------------------- While inspecting the ioctl implementations, I noticed that the compat implementation of XFS_IOC_ATTRLIST_BY_HANDLE does not do exactly the same thing as the native implementation. Specifically, the "cursor" does not appear to be written out to userspace on the compat path, like it is on the native path. This adjusts the compat implementation to copy out the cursor just like the native implementation does. The attrlist cursor does not require any special compat handling. This fixes xfstests xfs/269 on both IA-32 and x32 userspace, when running on an amd64 kernel. Signed-off-by: NNick Bowler <nbowler@draconx.ca> Fixes: 0facef7f ("xfs: in _attrlist_by_handle, copy the cursor back to userspace") Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Nyu kuai <yukuai3@huawei.com> Reviewed-by: Nzhengbin <zhengbin13@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Pan Bian 提交于
mainline inclusion from mainline-5.0-rc1 commit fe5ed6c2 category: bugfix bugzilla: 18906 CVE: NA --------------------------- The function xfs_alloc_get_freelist calls xfs_perag_put to drop the reference. However, pag->pagf_btreeblks is read and written after the put operation. This patch moves the put operation later. Signed-off-by: NPan Bian <bianpan2016@163.com> Reviewed-by: NCarlos Maiolino <cmaiolino@redhat.com> [darrick: minor changelog edits] Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Nyu kuai <yukuai3@huawei.com> Reviewed-by: Nzhengbin <zhengbin13@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Dave Chinner 提交于
mainline inclusion from mainline-4.20-rc4 commit c0876897 category: bugfix bugzilla: 18898 CVE: NA --------------------------- The last AG may be very small comapred to all other AGs, and hence AG reservations based on the superblock AG size may actually consume more space than the AG actually has. This results on assert failures like: XFS: Assertion failed: xfs_perag_resv(pag, XFS_AG_RESV_METADATA)->ar_reserved + xfs_perag_resv(pag, XFS_AG_RESV_RMAPBT)->ar_reserved <= pag->pagf_freeblks + pag->pagf_flcount, file: fs/xfs/libxfs/xfs_ag_resv.c, line: 319 [ 48.932891] xfs_ag_resv_init+0x1bd/0x1d0 [ 48.933853] xfs_fs_reserve_ag_blocks+0x37/0xb0 [ 48.934939] xfs_mountfs+0x5b3/0x920 [ 48.935804] xfs_fs_fill_super+0x462/0x640 [ 48.936784] ? xfs_test_remount_options+0x60/0x60 [ 48.937908] mount_bdev+0x178/0x1b0 [ 48.938751] mount_fs+0x36/0x170 [ 48.939533] vfs_kern_mount.part.43+0x54/0x130 [ 48.940596] do_mount+0x20e/0xcb0 [ 48.941396] ? memdup_user+0x3e/0x70 [ 48.942249] ksys_mount+0xba/0xd0 [ 48.943046] __x64_sys_mount+0x21/0x30 [ 48.943953] do_syscall_64+0x54/0x170 [ 48.944835] entry_SYSCALL_64_after_hwframe+0x49/0xbe Hence we need to ensure the finobt per-ag space reservations take into account the size of the last AG rather than treat it like all the other full size AGs. Note that both refcountbt and rmapbt already take the size of the AG into account via reading the AGF length directly. Signed-off-by: NDave Chinner <dchinner@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Nyu kuai <yukuai3@huawei.com> Reviewed-by: Nzhengbin <zhengbin13@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Dave Chinner 提交于
mainline inclusion from mainline-4.20-rc1 commit 37fd1678 category: bugfix bugzilla: 18873 CVE: NA --------------------------- When looking at a 4.18 based KASAN use after free report, I noticed that racing xfs_buf_rele() may race on dropping the last reference to the buffer and taking the buffer lock. This was the symptom displayed by the KASAN report, but the actual issue that was reported had already been fixed in 4.19-rc1 by commit e339dd8d ("xfs: use sync buffer I/O for sync delwri queue submission"). Despite this, I think there is still an issue with xfs_buf_rele() in this code: release = atomic_dec_and_lock(&bp->b_hold, &pag->pag_buf_lock); spin_lock(&bp->b_lock); if (!release) { ..... If two threads race on the b_lock after both dropping a reference and one getting dropping the last reference so release = true, we end up with: CPU 0 CPU 1 atomic_dec_and_lock() atomic_dec_and_lock() spin_lock(&bp->b_lock) spin_lock(&bp->b_lock) <spins> <release = true bp->b_lru_ref = 0> <remove from lists> freebuf = true spin_unlock(&bp->b_lock) xfs_buf_free(bp) <gets lock, reading and writing freed memory> <accesses freed memory> spin_unlock(&bp->b_lock) <reads/writes freed memory> IOWs, we can't safely take bp->b_lock after dropping the hold reference because the buffer may go away at any time after we drop that reference. However, this can be fixed simply by taking the bp->b_lock before we drop the reference. It is safe to nest the pag_buf_lock inside bp->b_lock as the pag_buf_lock is only used to serialise against lookup in xfs_buf_find() and no other locks are held over or under the pag_buf_lock there. Make this clear by documenting the buffer lock orders at the top of the file. Signed-off-by: NDave Chinner <dchinner@redhat.com> Reviewed-by: NBrian Foster <bfoster@redhat.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com Signed-off-by: NDave Chinner <david@fromorbit.com> Signed-off-by: Nyu kuai <yukuai3@huawei.com> Reviewed-by: Nzhengbin <zhengbin13@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Darrick J. Wong 提交于
mainline inclusion from mainline-4.20-rc1 commit 1002ff45 category: bugfix bugzilla: 18865 CVE: NA --------------------------- In xrep_findroot_block, if we find a candidate root block with sibling pointers or sibling blocks on the same tree level, we should not return that block as a tree root because root blocks cannot have siblings. Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Reviewed-by: NBrian Foster <bfoster@redhat.com> Signed-off-by: NDave Chinner <david@fromorbit.com> Signed-off-by: Nyu kuai <yukuai3@huawei.com> Reviewed-by: Nzhengbin <zhengbin13@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Mike Snitzer 提交于
mainline inclusion from mainline-v5.3-rc1 commit 54fa16ee category: bugfix bugzilla: 18564 CVE: NA ------------------------------------------------- Check if in fail_io mode at start of dm_pool_metadata_set_needs_check(). Otherwise dm_pool_metadata_set_needs_check()'s superblock_lock() can crash in dm_bm_write_lock() while accessing the block manager object that was previously destroyed as part of a failed dm_pool_abort_metadata() that ultimately set fail_io to begin with. Also, update DMERR() message to more accurately describe superblock_lock() failure. Cc: stable@vger.kernel.org Reported-by: NZdenek Kabelac <zkabelac@redhat.com> Signed-off-by: NMike Snitzer <snitzer@redhat.com> Conflicts: drivers/md/dm-thin-metadata.c Signed-off-by: NZhangXiaoxu <zhangxiaoxu5@huawei.com> Reviewed-by: NYi Zhang <yi.zhang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 zhengbin 提交于
hulk inclusion category: bugfix bugzilla: 20127 CVE: NA --------------------------- KASAN reports a use-after-free in dd_has_work, need to make sure scsi_requeue_run_queue is done before blk_cleanup_queue. BUG: KASAN: use-after-free in dd_has_work+0x50/0xe8 Read of size 8 at addr ffff808b57c6f168 by task kworker/53:1H/6910 CPU: 53 PID: 6910 Comm: kworker/53:1H Kdump: loaded Tainted: G Hardware name: Huawei TaiShan 2280 /BC11SPCD, BIOS 1.59 01/31/2019 Workqueue: kblockd scsi_requeue_run_queue Call trace: dump_backtrace+0x0/0x270 show_stack+0x24/0x30 dump_stack+0xb4/0xe4 print_address_description+0x68/0x278 kasan_report+0x204/0x330 __asan_load8+0x88/0xb0 dd_has_work+0x50/0xe8 blk_mq_run_hw_queue+0x19c/0x218 blk_mq_run_hw_queues+0x7c/0xb0 scsi_run_queue+0x3ec/0x520 scsi_requeue_run_queue+0x2c/0x38 process_one_work+0x2e4/0x6d8 worker_thread+0x6c/0x6a8 kthread+0x1b4/0x1c0 ret_from_fork+0x10/0x18 Allocated by task 46843: kasan_kmalloc+0xe0/0x190 kmem_cache_alloc_node_trace+0x10c/0x258 dd_init_queue+0x68/0x190 blk_mq_init_sched+0x1cc/0x300 elevator_init_mq+0x90/0xe0 blk_mq_init_allocated_queue+0x700/0x728 blk_mq_init_queue+0x48/0x90 scsi_mq_alloc_queue+0x34/0xb0 scsi_alloc_sdev+0x340/0x530 scsi_probe_and_add_lun+0x46c/0x1260 __scsi_scan_target+0x1b8/0x7b0 scsi_scan_target+0x140/0x150 fc_scsi_scan_rport+0x164/0x178 [scsi_transport_fc] process_one_work+0x2e4/0x6d8 worker_thread+0x6c/0x6a8 kthread+0x1b4/0x1c0 ret_from_fork+0x10/0x18 Freed by task 46843: __kasan_slab_free+0x120/0x228 kasan_slab_free+0x10/0x18 kfree+0x88/0x218 dd_exit_queue+0x5c/0x78 blk_mq_exit_sched+0x104/0x130 elevator_exit+0xa8/0xc8 blk_exit_queue+0x48/0x78 blk_cleanup_queue+0x170/0x248 __scsi_remove_device+0x84/0x1b0 scsi_probe_and_add_lun+0xd00/0x1260 __scsi_scan_target+0x1b8/0x7b0 scsi_scan_target+0x140/0x150 fc_scsi_scan_rport+0x164/0x178 [scsi_transport_fc] process_one_work+0x2e4/0x6d8 worker_thread+0x6c/0x6a8 kthread+0x1b4/0x1c0 ret_from_fork+0x10/0x18 Fixes: 8dc765d4 ("SCSI: fix queue cleanup race before queue initialization is done") Signed-off-by: Nzhengbin <zhengbin13@huawei.com> Reviewed-by: Nyangerkun <yangerkun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Jiaxing Luo 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA At expander ENV, we delay after issue phy reset to wait for hardware to handle phy reset. But if sas_smp_phy_control() fail, delay is unnecessary because we will continue controller reset. So we do not delay if sas_smp_phy_control() return error. Feature or Bugfix: Bugfix Signed-off-by: NJiaxing Luo <luojiaxing@huawei.com> Signed-off-by: NJohn Garry <john.garry@huawei.com> Signed-off-by: Nluojiaxing <luojiaxing@huawei.com> Reviewed-by: Nchenxiang <chenxiang66@hisilicon.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 tanshukun 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA Feature or Bugfix:Bugfix Signed-off-by: Ntanshukun (A) <tanshukun1@huawei.com> Reviewed-by: Nwangzhou <wangzhou1@hisilicon.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Greg Kroah-Hartman 提交于
Merge 46 patches from 4.19.66 stable branch (46 total) beside 0 already merged patches. Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Lukas Wunner 提交于
commit 8d8bef50 upstream. Commit 6935224d ("spi: bcm2835: enable support of 3-wire mode") added 3-wire support to the BCM2835 SPI driver by setting the REN bit (Read Enable) in the CS register when receiving data. The REN bit puts the transmitter in high-impedance state. The driver recognizes that data is to be received by checking whether the rx_buf of a transfer is non-NULL. Commit 3ecd37ed ("spi: bcm2835: enable dma modes for transfers meeting certain conditions") subsequently broke 3-wire support because it set the SPI_MASTER_MUST_RX flag which causes spi_map_msg() to replace rx_buf with a dummy buffer if it is NULL. As a result, rx_buf is *always* non-NULL if DMA is enabled. Reinstate 3-wire support by not only checking whether rx_buf is non-NULL, but also checking that it is not the dummy buffer. Fixes: 3ecd37ed ("spi: bcm2835: enable dma modes for transfers meeting certain conditions") Reported-by: NNuno Sá <nuno.sa@analog.com> Signed-off-by: NLukas Wunner <lukas@wunner.de> Cc: stable@vger.kernel.org # v4.2+ Cc: Martin Sperl <kernel@martin.sperl.org> Acked-by: NStefan Wahren <wahrenst@gmx.net> Link: https://lore.kernel.org/r/328318841455e505370ef8ecad97b646c033dc8a.1562148527.git.lukas@wunner.deSigned-off-by: NMark Brown <broonie@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Tejun Heo 提交于
commit c596687a upstream. While adding handling for dying task group leaders c03cd773 ("cgroup: Include dying leaders with live threads in PROCS iterations") added an inverted cset skip condition to css_task_iter_advance_css_set(). It should skip cset if it's completely empty but was incorrectly testing for the inverse condition for the dying_tasks list. Fix it. Signed-off-by: NTejun Heo <tj@kernel.org> Fixes: c03cd773 ("cgroup: Include dying leaders with live threads in PROCS iterations") Reported-by: syzbot+d4bba5ccd4f9a2a68681@syzkaller.appspotmail.com Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Tejun Heo 提交于
commit cee0c33c upstream. b636fd38 ("cgroup: Implement css_task_iter_skip()") introduced css_task_iter_skip() which is used to fix task iterations skipping dying threadgroup leaders with live threads. Skipping is implemented as a subportion of full advancing but css_task_iter_next() forgot to fully advance a skipped iterator before determining the next task to visit causing it to return invalid task pointers. Fix it by making css_task_iter_next() fully advance the iterator if it has been skipped since the previous iteration. Signed-off-by: NTejun Heo <tj@kernel.org> Reported-by: syzbot Link: http://lkml.kernel.org/r/00000000000097025d058a7fd785@google.com Fixes: b636fd38 ("cgroup: Implement css_task_iter_skip()") Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Tejun Heo 提交于
commit c03cd773 upstream. CSS_TASK_ITER_PROCS currently iterates live group leaders; however, this means that a process with dying leader and live threads will be skipped. IOW, cgroup.procs might be empty while cgroup.threads isn't, which is confusing to say the least. Fix it by making cset track dying tasks and include dying leaders with live threads in PROCS iteration. Signed-off-by: NTejun Heo <tj@kernel.org> Reported-and-tested-by: NTopi Miettinen <toiwoton@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Tejun Heo 提交于
commit b636fd38 upstream. When a task is moved out of a cset, task iterators pointing to the task are advanced using the normal css_task_iter_advance() call. This is fine but we'll be tracking dying tasks on csets and thus moving tasks from cset->tasks to (to be added) cset->dying_tasks. When we remove a task from cset->tasks, if we advance the iterators, they may move over to the next cset before we had the chance to add the task back on the dying list, which can allow the task to escape iteration. This patch separates out skipping from advancing. Skipping only moves the affected iterators to the next pointer rather than fully advancing it and the following advancing will recognize that the cursor has already been moved forward and do the rest of advancing. This ensures that when a task moves from one list to another in its cset, as long as it moves in the right direction, it's always visible to iteration. This doesn't cause any visible behavior changes. Signed-off-by: NTejun Heo <tj@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Tejun Heo 提交于
commit 6b115bf5 upstream. cgroup_release() calls cgroup_subsys->release() which is used by the pids controller to uncharge its pid. We want to use it to manage iteration of dying tasks which requires putting it before __unhash_process(). Move cgroup_release() above __exit_signal(). While this makes it uncharge before the pid is freed, pid is RCU freed anyway and the window is very narrow. Signed-off-by: NTejun Heo <tj@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Arnd Bergmann 提交于
[ Upstream commit 055d8824 ] Support for handling the PPPOEIOCSFWD ioctl in compat mode was added in linux-2.5.69 along with hundreds of other commands, but was always broken sincen only the structure is compatible, but the command number is not, due to the size being sizeof(size_t), or at first sizeof(sizeof((struct sockaddr_pppox)), which is different on 64-bit architectures. Guillaume Nault adds: And the implementation was broken until 2016 (see 29e73269 ("pppoe: fix reference counting in PPPoE proxy")), and nobody ever noticed. I should probably have removed this ioctl entirely instead of fixing it. Clearly, it has never been used. Fix it by adding a compat_ioctl handler for all pppoe variants that translates the command number and then calls the regular ioctl function. All other ioctl commands handled by pppoe are compatible between 32-bit and 64-bit, and require compat_ptr() conversion. This should apply to all stable kernels. Acked-by: NGuillaume Nault <g.nault@alphalink.fr> Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NDavid S. Miller <davem@davemloft.net> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Heiner Kallweit 提交于
[ Upstream commit 003bd5b4 ] It was reported that after resuming from suspend network fails with error "do_IRQ: 3.38 No irq handler for vector", see [0]. Enabling WoL can work around the issue, but the only actual fix is to disable MSI. So let's mimic the behavior of the vendor driver and disable MSI on all chip versions before RTL8168d. [0] https://bugzilla.kernel.org/show_bug.cgi?id=204079 Fixes: 6c6aa15f ("r8169: improve interrupt handling") Reported-by: NDušan Dragić <dragic.dusan@gmail.com> Tested-by: NDušan Dragić <dragic.dusan@gmail.com> Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Ariel Levkovich 提交于
[ Upstream commit 90bb7692 ] This patch prevents a race between user invoked cached counters query and a neighbor last usage updater. The cached flow counter stats can be queried by calling "mlx5_fc_query_cached" which provides the number of bytes and packets that passed via this flow since the last time this counter was queried. It does so by reducting the last saved stats from the current, cached stats and then updating the last saved stats with the cached stats. It also provide the lastuse value for that flow. Since "mlx5e_tc_update_neigh_used_value" needs to retrieve the last usage time of encapsulation flows, it calls the flow counter query method periodically and async to user queries of the flow counter using cls_flower. This call is causing the driver to update the last reported bytes and packets from the cache and therefore, future user queries of the flow stats will return lower than expected number for bytes and packets since the last saved stats in the driver was updated async to the last saved stats in cls_flower. This causes wrong stats presentation of encapsulation flows to user. Since the neighbor usage updater only needs the lastuse stats from the cached counter, the fix is to use a dedicated lastuse query call that returns the lastuse value without synching between the cached stats and the last saved stats. Fixes: f6dfb4c3 ("net/mlx5e: Update neighbour 'used' state using HW flow rules counters") Signed-off-by: NAriel Levkovich <lariel@mellanox.com> Reviewed-by: NRoi Dayan <roid@mellanox.com> Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Edward Srouji 提交于
[ Upstream commit 7a32f296 ] Fix modify_cq_in alignment to match the device specification. After this fix the 'cq_umem_valid' field will be in the right offset. Cc: <stable@vger.kernel.org> # 4.19 Fixes: bd371975 ("net/mlx5: Update mlx5_ifc with DEVX UID bits") Signed-off-by: NEdward Srouji <edwards@mellanox.com> Reviewed-by: NYishai Hadas <yishaih@mellanox.com> Signed-off-by: NLeon Romanovsky <leonro@mellanox.com> Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-