- 27 12月, 2019 40 次提交
-
-
由 Yonglong Liu 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA Some Chinese comments in kcompat.h, change them to English. Feature or Bugfix:Bugfix Signed-off-by: NYonglong Liu <liuyonglong@huawei.com> Reviewed-by: Nlinyunsheng <linyunsheng@huawei.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Vandana BN 提交于
mainline inclusion from mainline-v5.3-rc5 commit 5d2e73a5 category: bugfix bugzilla: 13690 CVE: CVE-2019-15217 ------------------------------------------------- SyzKaller hit the null pointer deref while reading from uninitialized udev->product in zr364xx_vidioc_querycap(). ================================================================== BUG: KASAN: null-ptr-deref in read_word_at_a_time+0xe/0x20 include/linux/compiler.h:274 Read of size 1 at addr 0000000000000000 by task v4l_id/5287 CPU: 1 PID: 5287 Comm: v4l_id Not tainted 5.1.0-rc3-319004-g43151d6 #6 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xe8/0x16e lib/dump_stack.c:113 kasan_report.cold+0x5/0x3c mm/kasan/report.c:321 read_word_at_a_time+0xe/0x20 include/linux/compiler.h:274 strscpy+0x8a/0x280 lib/string.c:207 zr364xx_vidioc_querycap+0xb5/0x210 drivers/media/usb/zr364xx/zr364xx.c:706 v4l_querycap+0x12b/0x340 drivers/media/v4l2-core/v4l2-ioctl.c:1062 __video_do_ioctl+0x5bb/0xb40 drivers/media/v4l2-core/v4l2-ioctl.c:2874 video_usercopy+0x44e/0xf00 drivers/media/v4l2-core/v4l2-ioctl.c:3056 v4l2_ioctl+0x14e/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:364 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0xced/0x12f0 fs/ioctl.c:696 ksys_ioctl+0xa0/0xc0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x74/0xb0 fs/ioctl.c:718 do_syscall_64+0xcf/0x4f0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f3b56d8b347 Code: 90 90 90 48 8b 05 f1 fa 2a 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 90 90 90 90 90 90 90 90 90 90 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c1 fa 2a 00 31 d2 48 29 c2 64 RSP: 002b:00007ffe005d5d68 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f3b56d8b347 RDX: 00007ffe005d5d70 RSI: 0000000080685600 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000400884 R13: 00007ffe005d5ec0 R14: 0000000000000000 R15: 0000000000000000 ================================================================== For this device udev->product is not initialized and accessing it causes a NULL pointer deref. The fix is to check for NULL before strscpy() and copy empty string, if product is NULL Reported-by: syzbot+66010012fd4c531a1a96@syzkaller.appspotmail.com Signed-off-by: NVandana BN <bnvandana@gmail.com> Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Hui Peng 提交于
mainline inclusion from mainline-v5.3-rc5 commit 19bce474c45be69a284ecee660aa12d8f1e88f18 category: bugfix bugzilla: 13690 CVE: CVE-2019-15118 ------------------------------------------------- `check_input_term` recursively calls itself with input from device side (e.g., uac_input_terminal_descriptor.bCSourceID) as argument (id). In `check_input_term`, if `check_input_term` is called with the same `id` argument as the caller, it triggers endless recursive call, resulting kernel space stack overflow. This patch fixes the bug by adding a bitmap to `struct mixer_build` to keep track of the checked ids and stop the execution if some id has been checked (similar to how parse_audio_unit handles unitid argument). Reported-by: NHui Peng <benquike@gmail.com> Reported-by: NMathias Payer <mathias.payer@nebelwelt.net> Signed-off-by: NHui Peng <benquike@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: NTakashi Iwai <tiwai@suse.de> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Hui Peng 提交于
mainline inclusion from mainline-v5.3-rc5 commit daac07156b330b18eb5071aec4b3ddca1c377f2c category: bugfix bugzilla: 13690 CVE: CVE-2019-15117 ------------------------------------------------- The `uac_mixer_unit_descriptor` shown as below is read from the device side. In `parse_audio_mixer_unit`, `baSourceID` field is accessed from index 0 to `bNrInPins` - 1, the current implementation assumes that descriptor is always valid (the length of descriptor is no shorter than 5 + `bNrInPins`). If a descriptor read from the device side is invalid, it may trigger out-of-bound memory access. ``` struct uac_mixer_unit_descriptor { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubtype; __u8 bUnitID; __u8 bNrInPins; __u8 baSourceID[]; } ``` This patch fixes the bug by add a sanity check on the length of the descriptor. Reported-by: NHui Peng <benquike@gmail.com> Reported-by: NMathias Payer <mathias.payer@nebelwelt.net> Cc: <stable@vger.kernel.org> Signed-off-by: NHui Peng <benquike@gmail.com> Signed-off-by: NTakashi Iwai <tiwai@suse.de> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Peter Zijlstra 提交于
mainline inclusion from mainline-5.3-rc2 commit 952041a8 category: bugfix bugzilla: 20006 CVE: NA ------------------------------------------------- While reviewing rwsem down_slowpath, Will noticed ldsem had a copy of a bug we just found for rwsem. X = 0; CPU0 CPU1 rwsem_down_read() for (;;) { set_current_state(TASK_UNINTERRUPTIBLE); X = 1; rwsem_up_write(); rwsem_mark_wake() atomic_long_add(adjustment, &sem->count); smp_store_release(&waiter->task, NULL); if (!waiter.task) break; ... } r = X; Allows 'r == 0'. Reported-by: NWill Deacon <will@kernel.org> Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org> Acked-by: NWill Deacon <will@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Hurley <peter@hurleysoftware.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: 4898e640 ("tty: Add timed, writer-prioritized rw semaphore") Signed-off-by: NIngo Molnar <mingo@kernel.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Peter Zijlstra 提交于
mainline inclusion from mainline-5.3-rc2 commit 99143f82 category: bugfix bugzilla: 20006 CVE: NA ------------------------------------------------- While reviewing another read_slowpath patch, both Will and I noticed another missing ACQUIRE, namely: X = 0; CPU0 CPU1 rwsem_down_read() for (;;) { set_current_state(TASK_UNINTERRUPTIBLE); X = 1; rwsem_up_write(); rwsem_mark_wake() atomic_long_add(adjustment, &sem->count); smp_store_release(&waiter->task, NULL); if (!waiter.task) break; ... } r = X; Allows 'r == 0'. Reported-by: NPeter Zijlstra (Intel) <peterz@infradead.org> Reported-by: NWill Deacon <will@kernel.org> Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org> Acked-by: NWill Deacon <will@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: 1da177e4 ("Linux-2.6.12-rc2") Signed-off-by: NIngo Molnar <mingo@kernel.org> Conflicts: kernel/locking/rwsem.c [yyl: rwsem_down_read_slowpath() is refactor __rwsem_down_read_failed_common()] Signed-off-by: NYang Yingliang <yangyingliang@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Brian Foster 提交于
mainline inclusion from mainline-5.0-rc6 commit 465fa17f category: bugfix bugzilla: 18932 CVE: NA --------------------------- As of commit e339dd8d ("xfs: use sync buffer I/O for sync delwri queue submission"), the delwri submission code uses sync buffer I/O for sync delwri I/O. Instead of waiting on async I/O to unlock the buffer, it uses the underlying sync I/O completion mechanism. If delwri buffer submission fails due to a shutdown scenario, an error is set on the buffer and buffer completion never occurs. This can cause xfs_buf_delwri_submit() to deadlock waiting on a completion event. We could check the error state before waiting on such buffers, but that doesn't serialize against the case of an error set via a racing I/O completion. Instead, invoke I/O completion in the shutdown case regardless of buffer I/O type. Signed-off-by: NBrian Foster <bfoster@redhat.com> Reviewed-by: NDave Chinner <dchinner@redhat.com> 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>
-
由 Darrick J. Wong 提交于
mainline inclusion from mainline-5.2-rc1 commit 3de5eab3 category: bugfix bugzilla: 19045 CVE: NA --------------------------- We passed an inode into xfs_ioctl_setattr_get_trans with join_flags indicating which locks are held on that inode. If we can't allocate a transaction then we need to unlock the inode before we bail out, like all the other error paths do. Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Reviewed-by: NDave Chinner <dchinner@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NBrian Foster <bfoster@redhat.com> Signed-off-by: Nzhengbin <zhengbin13@huawei.com> Reviewed-by: Nyu kuai <yukuai3@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Brian Foster 提交于
mainline inclusion from mainline-5.1-rc3 commit 6958d11f category: bugfix bugzilla: 19011 CVE: NA --------------------------- We've had rather rare reports of bmap btree block corruption where the bmap root block has a level count of zero. The root cause of the corruption is so far unknown. We do have verifier checks to detect this form of on-disk corruption, but this doesn't cover a memory corruption variant of the problem. The latter is a reasonable possibility because the root block is part of the inode fork and can reside in-core for some time before inode extents are read. If this occurs, it leads to a system crash such as the following: BUG: unable to handle kernel paging request at ffffffff00000221 PF error: [normal kernel read fault] ... RIP: 0010:xfs_trans_brelse+0xf/0x200 [xfs] ... Call Trace: xfs_iread_extents+0x379/0x540 [xfs] xfs_file_iomap_begin_delay+0x11a/0xb40 [xfs] ? xfs_attr_get+0xd1/0x120 [xfs] ? iomap_write_begin.constprop.40+0x2d0/0x2d0 xfs_file_iomap_begin+0x4c4/0x6d0 [xfs] ? __vfs_getxattr+0x53/0x70 ? iomap_write_begin.constprop.40+0x2d0/0x2d0 iomap_apply+0x63/0x130 ? iomap_write_begin.constprop.40+0x2d0/0x2d0 iomap_file_buffered_write+0x62/0x90 ? iomap_write_begin.constprop.40+0x2d0/0x2d0 xfs_file_buffered_aio_write+0xe4/0x3b0 [xfs] __vfs_write+0x150/0x1b0 vfs_write+0xba/0x1c0 ksys_pwrite64+0x64/0xa0 do_syscall_64+0x5a/0x1d0 entry_SYSCALL_64_after_hwframe+0x49/0xbe The crash occurs because xfs_iread_extents() attempts to release an uninitialized buffer pointer as the level == 0 value prevented the buffer from ever being allocated or read. Change the level > 0 assert to an explicit error check in xfs_iread_extents() to avoid crashing the kernel in the event of localized, in-core inode corruption. Signed-off-by: NBrian Foster <bfoster@redhat.com> Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Nzhengbin <zhengbin13@huawei.com> Reviewed-by: Nyu kuai <yukuai3@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Darrick J. Wong 提交于
mainline inclusion from mainline-5.1-rc1 commit 3d129e1b category: bugfix bugzilla: 19005 CVE: NA --------------------------- Fix a backwards endian conversion of a constant. Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Reviewed-by: NAllison Henderson <allison.henderson@oracle.com> Signed-off-by: Nzhengbin <zhengbin13@huawei.com> Reviewed-by: Nyu kuai <yukuai3@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Nishka Dasgupta 提交于
mainline inclusion from mainline-5.3-rc3 commit 321275f0 category: bugfix bugzilla: 20161 CVE: NA ------------------------------------------------- Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Add an of_node_put before the return in three places. Issue found with Coccinelle. Signed-off-by: NNishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: NMarc Zyngier <maz@kernel.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 Xue 提交于
driver inclusion category:bugfix bugzilla:4472 CVE:NA ----------------------------------------------------------------------- This patch deletes the job number in the comment and adds new file comment. Signed-off-by: NXue <xuechaojing@huawei.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
-
由 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>
-