Skip to content
Snippets Groups Projects
  1. Oct 11, 2022
  2. Oct 10, 2022
  3. Oct 09, 2022
  4. Sep 29, 2022
  5. Sep 28, 2022
    • Xingui Yang's avatar
      scsi: hisi_sas: Release resource directly in hisi_sas_abort_task() when NCQ error · 64d37f3f
      Xingui Yang authored
      driver inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5SXSB
      
      
      CVE: NA
      
      ------------------------------------------------
      
      When the port is detached, EH will clear ATA_EH_RESET in ehc->i.action when
      call ata_eh_reset(), and device reset won't be executed.
      
      As the disk won't return other I/Os normally after NCQ Error. In addition,
      the abort operation is added, then resource release is safe, so release NCQ
      command lldd resource directly in hisi_sas_abort_task() when NCQ error
      without soft reset to make sure read log command can be executed success
      later. But Soft reset still need to be used in other scenario.
      
      Signed-off-by: default avatarXingui Yang <yangxingui@huawei.com>
      Reviewed-by: default avatarkang fenglong <kangfenglong@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      64d37f3f
    • Xingui Yang's avatar
      scsi: hisi_sas: Enable force phy when SATA disk directly connected · f32bc74e
      Xingui Yang authored
      driver inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5QDH7
      
      
      CVE: NA
      
      ----------------------------------
      
      the SAS controller determines the disk to which I/Os are delivered based
      on the port id in the DQ entry when SATA disk directly connected.
      
      When the link is intermittently disconnected during I/O sending and the
      port id changes and is used by another link, data inconsistency on the
      SATA disk may occur during I/O retry. So enable force phy, then force the
      command to be executed in a certain phy, and if the port's phy does not
      match the phy configured in the command, the chip will stop delivering
      I/Os to disk.
      
      Signed-off-by: default avatarXingui Yang <yangxingui@huawei.com>
      Reviewed-by: default avatarkang fenglong <kangfenglong@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      f32bc74e
    • Xingui Yang's avatar
      scsi: hisi_sas: Modify v3 HW ATA completion process when SATA disk is in error status · 63c0c05a
      Xingui Yang authored
      driver inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5Q63H
      
      
      CVE: NA
      
      -------------------------------------
      
      When an NCQ error occurs, SAS controller will abnormally complete the I/Os
      that newly delivered to disk, and bit8 in CQ dw3 will be set to 1 to
      indicate current SATA disk is in error status. The current processing flow
      is set ts->stat to SAS_OPEN_REJECT and then sas_ata_task_done() will set
      fis stat to ATA_ERR. After analyzed by ata_eh_analyze_tf(), err_mask will
      set to AC_ERR_HSM. If media error occurs for four times within 10 minutes
      and the chip rejects new I/Os for four times, NCQ will be disabled due to
      excessive errors.
      
      However, if media error occurs multiple times, the NCQ mode shouldn't be
      disabled. Therefore, use sas_task_abort() to handle abnormally completed
      I/Os when SATA disk is in error status.
      
      [10253.397429] hisi_sas_v3_hw 0000:b4:02.0: erroneous completion disk err dev id=2 sas_addr=0x5000000000000605 CQ hdr: 0x400903 0x2007f 0x0 0x80470000
      [10253.397430] hisi_sas_v3_hw 0000:b4:02.0: erroneous completion iptt=135 task= pK-error dev id=2 sas_addr=0x5000000000000605 CQ hdr: 0x203 0x20087 0x0 0x100 Error info: 0x0 0x0 0x0 0x0
      [10253.397432] hisi_sas_v3_hw 0000:b4:02.0: erroneous completion iptt=136 task= pK-error dev id=2 sas_addr=0x5000000000000605 CQ hdr: 0x203 0x20088 0x0 0x100 Error info: 0x0 0x0 0x0 0x0
      
      Signed-off-by: default avatarXingui Yang <yangxingui@huawei.com>
      Reviewed-by: default avatarkang fenglong <kangfenglong@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      63c0c05a
    • Hui Tang's avatar
      sched: Fix invalid free for tsk->se.dyn_affi_stats · 46212545
      Hui Tang authored
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5TIOZ
      CVE: NA
      
      --------------------------------
      
      BUG: KASAN: double-free or invalid-free in sched_prefer_cpus_free[...]
      
      Freed by task 0:
       save_stack mm/kasan/kasan.c:448 [inline]
       set_track mm/kasan/kasan.c:460 [inline]
       __kasan_slab_free+0x120/0x228 mm/kasan/kasan.c:521
       kasan_slab_free+0x10/0x18 mm/kasan/kasan.c:528
       slab_free_hook mm/slub.c:1397 [inline]
       slab_free_freelist_hook mm/slub.c:1425 [inline]
       slab_free mm/slub.c:3004 [inline]
       kfree+0x84/0x250 mm/slub.c:3965
       sched_prefer_cpus_free+0x58/0x78 kernel/sched/core.c:7219
       free_task+0xb0/0xe8 kernel/fork.c:463
       __delayed_free_task+0x24/0x30 kernel/fork.c:1716
       __rcu_reclaim kernel/rcu/rcu.h:236 [inline]
       rcu_do_batch+0x200/0x5e0 kernel/rcu/tree.c:2584
       invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline]
       __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline]
       rcu_process_callbacks+0x470/0xb60 kernel/rcu/tree.c:...
      46212545
    • John Donnelly's avatar
      scsi: target: tcmu: Fix warning: 'page' may be used uninitialized · e71f2087
      John Donnelly authored
      mainline inclusion
      from mainline-v5.10-rc1
      commit 8c4e0f21
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5SXLB
      CVE: NA
      
      --------------------------------
      
      Corrects drivers/target/target_core_user.c:688:6: warning: 'page' may be
      used uninitialized.
      
      Link: https://lore.kernel.org/r/20200924001920.43594-1-john.p.donnelly@oracle.com
      
      
      Fixes: 3c58f737 ("scsi: target: tcmu: Optimize use of flush_dcache_page")
      Cc: Mike Christie <michael.christie@oracle.com>
      Acked-by: default avatarMike Christie <michael.christie@oracle.com>
      Signed-off-by: default avatarJohn Donnelly <john.p.donnelly@oracle.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarWenchao Hao <haowenchao@huawei.com>
      Reviewed-by: default avatarlijinlin <lijinlin3@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      e71f2087
    • Bodo Stroesser's avatar
      scsi: target: tcmu: Fix crash on ARM during cmd completion · d0b7519e
      Bodo Stroesser authored
      mainline inclusion
      from mainline-v5.9-rc1
      commit 5a0c256d
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5SXLB
      CVE: NA
      
      --------------------------------
      
      If tcmu_handle_completions() has to process a padding shorter than
      sizeof(struct tcmu_cmd_entry), the current call to
      tcmu_flush_dcache_range() with sizeof(struct tcmu_cmd_entry) as length
      param is wrong and causes crashes on e.g. ARM, because
      tcmu_flush_dcache_range() in this case calls
      flush_dcache_page(vmalloc_to_page(start)); with start being an invalid
      address above the end of the vmalloc'ed area.
      
      The fix is to use the minimum of remaining ring space and sizeof(struct
      tcmu_cmd_entry) as the length param.
      
      The patch was tested on kernel 4.19.118.
      
      See https://bugzilla.kernel.org/show_bug.cgi?id=208045#c10
      
      Link: https://lore.kernel.org/r/20200629093756.8947-1-bstroesser@ts.fujitsu.com
      
      
      Tested-by: default avatarJiangYu <lnsyyj@hotmail.com>
      Acked-by: default avatarMike Christie <michael.christie@oracle.com>
      Signed-off-by: default avatarBodo Stroesser <bstroesser@ts.fujitsu.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarWenchao Hao <haowenchao@huawei.com>
      Reviewed-by: default avatarlijinlin <lijinlin3@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      d0b7519e
    • Bodo Stroesser's avatar
      scsi: target: tcmu: Optimize use of flush_dcache_page · 75a8f1b4
      Bodo Stroesser authored
      mainline inclusion
      from mainline-v5.9-rc1
      commit 3c58f737
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5SXLB
      CVE: NA
      
      --------------------------------
      
      (scatter|gather)_data_area() need to flush dcache after writing data to or
      before reading data from a page in uio data area.  The two routines are
      able to handle data transfer to/from such a page in fragments and flush the
      cache after each fragment was copied by calling the wrapper
      tcmu_flush_dcache_range().
      
      That means:
      
      1) flush_dcache_page() can be called multiple times for the same page.
      
      2) Calling flush_dcache_page() indirectly using the wrapper does not make
         sense, because each call of the wrapper is for one single page only and
         the calling routine already has the correct page pointer.
      
      Change (scatter|gather)_data_area() such that, instead of calling
      tcmu_flush_dcache_range() before/after each memcpy, it now calls
      flush_dcache_page() before unmapping a page (when writing is complete for
      that page) or after mapping a page (when starting to read the page).
      
      After this change only calls to tcmu_flush_dcache_range() for addresses in
      vmalloc'ed command ring are left over.
      
      The patch was tested on ARM with kernel 4.19.118 and 5.7.2
      
      Link: https://lore.kernel.org/r/20200618131632.32748-2-bstroesser@ts.fujitsu.com
      
      
      Tested-by: default avatarJiangYu <lnsyyj@hotmail.com>
      Tested-by: default avatarDaniel Meyerholt <dxm523@gmail.com>
      Acked-by: default avatarMike Christie <michael.christie@oracle.com>
      Signed-off-by: default avatarBodo Stroesser <bstroesser@ts.fujitsu.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarWenchao Hao <haowenchao@huawei.com>
      Reviewed-by: default avatarlijinlin <lijinlin3@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      75a8f1b4
    • Bodo Stroesser's avatar
      scsi: target: tcmu: Fix size in calls to tcmu_flush_dcache_range · 1981211d
      Bodo Stroesser authored
      mainline inclusion
      from mainline-v5.8-rc1
      commit 8c4e0f21
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5SXLB
      CVE: NA
      
      --------------------------------
      
      1) If remaining ring space before the end of the ring is smaller then the
         next cmd to write, tcmu writes a padding entry which fills the remaining
         space at the end of the ring.
      
         Then tcmu calls tcmu_flush_dcache_range() with the size of struct
         tcmu_cmd_entry as data length to flush.  If the space filled by the
         padding was smaller then tcmu_cmd_entry, tcmu_flush_dcache_range() is
         called for an address range reaching behind the end of the vmalloc'ed
         ring.
      
         tcmu_flush_dcache_range() in a loop calls
         flush_dcache_page(virt_to_page(start)); for every page being part of the
         range. On x86 the line is optimized out by the compiler, as
         flush_dcache_page() is empty on x86.
      
         But I assume the above can cause trouble on other architectures that
         really have a flush_dcache_page().  For paddings only the header part of
         an entry is relevant due to alignment rules the header always fits in
         the remaining space, if padding is needed.  So tcmu_flush_dcache_range()
         can safely be called with sizeof(entry->hdr) as the length here.
      
      2) After it has written a command to cmd ring, tcmu calls
         tcmu_flush_dcache_range() using the size of a struct tcmu_cmd_entry as
         data length to flush.  But if a command needs many iovecs, the real size
         of the command may be bigger then tcmu_cmd_entry, so a part of the
         written command is not flushed then.
      
      Link: https://lore.kernel.org/r/20200528193108.9085-1-bstroesser@ts.fujitsu.com
      
      
      Acked-by: default avatarMike Christie <michael.christie@oracle.com>
      Signed-off-by: default avatarBodo Stroesser <bstroesser@ts.fujitsu.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarWenchao Hao <haowenchao@huawei.com>
      Reviewed-by: default avatarlijinlin <lijinlin3@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      1981211d
    • Ye Weihua's avatar
      signal: fix deadlock caused by calling printk() under sighand->siglock · ab099ea9
      Ye Weihua authored
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5T8FD
      
      
      CVE: NA
      
      --------------------------------
      
      __dend_signal_locked() invokes __sigqueue_alloc() which may invoke a
      normal printk() to print failure message. This can cause a deadlock in
      the scenario reported by syz-bot below (test in 5.10):
      
      	CPU0				CPU1
      	----				----
      	lock(&sighand->siglock);
      					lock(&tty->read_wait);
      					lock(&sighand->siglock);
      	lock(console_owner);
      
      This patch specities __GFP_NOWARN to __sigqueue_alloc(), so that printk
      will not be called, and this deadlock problem can be avoided.
      
      Syzbot reported the following lockdep error:
      
      ======================================================
      WARNING: possible circular locking dependency detected
      5.10.0-04424-ga472e3c833d3 #1 Not tainted
      ------------------------------------------------------
      syz-executor.2/31970 is trying to acquire lock:
      ffffa00014066a60 (console_owner){-.-.}-{0:0}, at: console_trylock_spinning+0xf0/0x2e0 kernel/printk/printk.c:1854
      
      but task is already holding lock:
      ffff0000ddb38a98 (&sighand->siglock){-.-.}-{2:2}, at: force_sig_info_to_task+0x60/0x260 kernel/signal.c:1322
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #4 (&sighand->siglock){-.-.}-{2:2}:
             validate_chain+0x6dc/0xb0c kernel/locking/lockdep.c:3728
             __lock_acquire+0x498/0x940 kernel/locking/lockdep.c:4954
             lock_acquire+0x228/0x580 kernel/locking/lockdep.c:5564
             __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
             _raw_spin_lock_irqsave+0xc0/0x15c kernel/locking/spinlock.c:159
             __lock_task_sighand+0xf0/0x370 kernel/signal.c:1396
             lock_task_sighand include/linux/sched/signal.h:699 [inline]
             task_work_add+0x1f8/0x2a0 kernel/task_work.c:58
             io_req_task_work_add+0x98/0x10c fs/io_uring.c:2115
             __io_async_wake+0x338/0x780 fs/io_uring.c:4984
             io_poll_wake+0x40/0x50 fs/io_uring.c:5461
             __wake_up_common+0xcc/0x2a0 kernel/sched/wait.c:93
             __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:123
             __wake_up+0x1c/0x24 kernel/sched/wait.c:142
             pty_set_termios+0x1ac/0x2d0 drivers/tty/pty.c:286
             tty_set_termios+0x310/0x46c drivers/tty/tty_ioctl.c:334
             set_termios.part.0+0x2dc/0xa50 drivers/tty/tty_ioctl.c:414
             set_termios drivers/tty/tty_ioctl.c:368 [inline]
             tty_mode_ioctl+0x4f4/0xbec drivers/tty/tty_ioctl.c:736
             n_tty_ioctl_helper+0x74/0x260 drivers/tty/tty_ioctl.c:883
             n_tty_ioctl+0x80/0x3d0 drivers/tty/n_tty.c:2516
             tty_ioctl+0x508/0x1100 drivers/tty/tty_io.c:2751
             vfs_ioctl fs/ioctl.c:48 [inline]
             __do_sys_ioctl fs/ioctl.c:753 [inline]
             __se_sys_ioctl fs/ioctl.c:739 [inline]
             __arm64_sys_ioctl+0x12c/0x18c fs/ioctl.c:739
             __invoke_syscall arch/arm64/kernel/syscall.c:36 [inline]
             invoke_syscall arch/arm64/kernel/syscall.c:48 [inline]
             el0_svc_common.constprop.0+0xf8/0x420 arch/arm64/kernel/syscall.c:155
             do_el0_svc+0x50/0x120 arch/arm64/kernel/syscall.c:217
             el0_svc+0x20/0x30 arch/arm64/kernel/entry-common.c:353
             el0_sync_handler+0xe4/0x1e0 arch/arm64/kernel/entry-common.c:369
             el0_sync+0x148/0x180 arch/arm64/kernel/entry.S:683
      
      -> #3 (&tty->read_wait){....}-{2:2}:
             validate_chain+0x6dc/0xb0c kernel/locking/lockdep.c:3728
             __lock_acquire+0x498/0x940 kernel/locking/lockdep.c:4954
             lock_acquire+0x228/0x580 kernel/locking/lockdep.c:5564
             __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
             _raw_spin_lock+0xa0/0x120 kernel/locking/spinlock.c:151
             spin_lock include/linux/spinlock.h:354 [inline]
             io_poll_double_wake+0x158/0x30c fs/io_uring.c:5093
             __wake_up_common+0xcc/0x2a0 kernel/sched/wait.c:93
             __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:123
             __wake_up+0x1c/0x24 kernel/sched/wait.c:142
             pty_close+0x1bc/0x330 drivers/tty/pty.c:68
             tty_release+0x1e0/0x88c drivers/tty/tty_io.c:1761
             __fput+0x1dc/0x500 fs/file_table.c:281
             ____fput+0x24/0x30 fs/file_table.c:314
             task_work_run+0xf4/0x1ec kernel/task_work.c:151
             tracehook_notify_resume include/linux/tracehook.h:188 [inline]
             do_notify_resume+0x378/0x410 arch/arm64/kernel/signal.c:718
             work_pending+0xc/0x198
      
      -> #2 (&tty->write_wait){....}-{2:2}:
             validate_chain+0x6dc/0xb0c kernel/locking/lockdep.c:3728
             __lock_acquire+0x498/0x940 kernel/locking/lockdep.c:4954
             lock_acquire+0x228/0x580 kernel/locking/lockdep.c:5564
             __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
             _raw_spin_lock_irqsave+0xc0/0x15c kernel/locking/spinlock.c:159
             __wake_up_common_lock+0xb0/0x130 kernel/sched/wait.c:122
             __wake_up+0x1c/0x24 kernel/sched/wait.c:142
             tty_wakeup+0x54/0xbc drivers/tty/tty_io.c:539
             tty_port_default_wakeup+0x38/0x50 drivers/tty/tty_port.c:50
             tty_port_tty_wakeup+0x3c/0x50 drivers/tty/tty_port.c:388
             uart_write_wakeup+0x38/0x60 drivers/tty/serial/serial_core.c:106
             pl011_tx_chars+0x530/0x5c0 drivers/tty/serial/amba-pl011.c:1418
             pl011_start_tx_pio drivers/tty/serial/amba-pl011.c:1303 [inline]
             pl011_start_tx+0x1b4/0x430 drivers/tty/serial/amba-pl011.c:1315
             __uart_start.isra.0+0xb4/0xcc drivers/tty/serial/serial_core.c:127
             uart_write+0x21c/0x460 drivers/tty/serial/serial_core.c:613
             process_output_block+0x120/0x3ac drivers/tty/n_tty.c:590
             n_tty_write+0x2c8/0x650 drivers/tty/n_tty.c:2383
             do_tty_write drivers/tty/tty_io.c:1028 [inline]
             file_tty_write.constprop.0+0x2d0/0x520 drivers/tty/tty_io.c:1118
             tty_write drivers/tty/tty_io.c:1125 [inline]
             redirected_tty_write+0xe4/0x104 drivers/tty/tty_io.c:1147
             call_write_iter include/linux/fs.h:1960 [inline]
             new_sync_write+0x264/0x37c fs/read_write.c:515
             vfs_write+0x694/0x9d0 fs/read_write.c:602
             ksys_write+0xfc/0x200 fs/read_write.c:655
             __do_sys_write fs/read_write.c:667 [inline]
             __se_sys_write fs/read_write.c:664 [inline]
             __arm64_sys_write+0x50/0x60 fs/read_write.c:664
             __invoke_syscall arch/arm64/kernel/syscall.c:36 [inline]
             invoke_syscall arch/arm64/kernel/syscall.c:48 [inline]
             el0_svc_common.constprop.0+0xf8/0x420 arch/arm64/kernel/syscall.c:155
             do_el0_svc+0x50/0x120 arch/arm64/kernel/syscall.c:217
             el0_svc+0x20/0x30 arch/arm64/kernel/entry-common.c:353
             el0_sync_handler+0xe4/0x1e0 arch/arm64/kernel/entry-common.c:369
             el0_sync+0x148/0x180 arch/arm64/kernel/entry.S:683
      
      -> #1 (&port_lock_key){-.-.}-{2:2}:
             validate_chain+0x6dc/0xb0c kernel/locking/lockdep.c:3728
             __lock_acquire+0x498/0x940 kernel/locking/lockdep.c:4954
             lock_acquire+0x228/0x580 kernel/locking/lockdep.c:5564
             __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
             _raw_spin_lock+0xa0/0x120 kernel/locking/spinlock.c:151
             spin_lock include/linux/spinlock.h:354 [inline]
             pl011_console_write+0x2f0/0x410 drivers/tty/serial/amba-pl011.c:2263
             call_console_drivers.constprop.0+0x1f8/0x3b0 kernel/printk/printk.c:1932
             console_unlock+0x36c/0x9ec kernel/printk/printk.c:2553
             vprintk_emit+0x40c/0x4b0 kernel/printk/printk.c:2075
             vprintk_default+0x48/0x54 kernel/printk/printk.c:2092
             vprintk_func+0x1f0/0x40c kernel/printk/printk_safe.c:404
             printk+0xbc/0xf0 kernel/printk/printk.c:2123
             register_console+0x580/0x790 kernel/printk/printk.c:2905
             uart_configure_port.constprop.0+0x4a0/0x4e0 drivers/tty/serial/serial_core.c:2431
             uart_add_one_port+0x378/0x550 drivers/tty/serial/serial_core.c:2944
             pl011_register_port+0xb4/0x210 drivers/tty/serial/amba-pl011.c:2686
             pl011_probe+0x334/0x3ec drivers/tty/serial/amba-pl011.c:2736
             amba_probe+0x14c/0x2f0 drivers/amba/bus.c:283
             really_probe+0x210/0xa5c drivers/base/dd.c:562
             driver_probe_device+0x1c8/0x280 drivers/base/dd.c:747
             __device_attach_driver+0x18c/0x260 drivers/base/dd.c:853
             bus_for_each_drv+0x120/0x1a0 drivers/base/bus.c:431
             __device_attach+0x16c/0x3b4 drivers/base/dd.c:922
             device_initial_probe+0x28/0x34 drivers/base/dd.c:971
             bus_probe_device+0x124/0x13c drivers/base/bus.c:491
             fw_devlink_resume+0x164/0x270 drivers/base/core.c:1601
             of_platform_default_populate_init+0xf4/0x114 drivers/of/platform.c:543
             do_one_initcall+0x11c/0x770 init/main.c:1217
             do_initcall_level+0x364/0x388 init/main.c:1290
             do_initcalls+0x90/0xc0 init/main.c:1306
             do_basic_setup init/main.c:1326 [inline]
             kernel_init_freeable+0x57c/0x63c init/main.c:1529
             kernel_init+0x1c/0x20c init/main.c:1417
             ret_from_fork+0x10/0x18 arch/arm64/kernel/entry.S:1034
      
      -> #0 (console_owner){-.-.}-{0:0}:
             check_prev_add+0xe0/0x105c kernel/locking/lockdep.c:2988
             check_prevs_add+0x1c8/0x3d4 kernel/locking/lockdep.c:3113
             validate_chain+0x6dc/0xb0c kernel/locking/lockdep.c:3728
             __lock_acquire+0x498/0x940 kernel/locking/lockdep.c:4954
             lock_acquire+0x228/0x580 kernel/locking/lockdep.c:5564
             console_trylock_spinning+0x130/0x2e0 kernel/printk/printk.c:1875
             vprintk_emit+0x268/0x4b0 kernel/printk/printk.c:2074
             vprintk_default+0x48/0x54 kernel/printk/printk.c:2092
             vprintk_func+0x1f0/0x40c kernel/printk/printk_safe.c:404
             printk+0xbc/0xf0 kernel/printk/printk.c:2123
             fail_dump lib/fault-inject.c:45 [inline]
             should_fail+0x2a0/0x370 lib/fault-inject.c:146
             __should_failslab+0x8c/0xe0 mm/failslab.c:33
             should_failslab+0x14/0x2c mm/slab_common.c:1181
             slab_pre_alloc_hook mm/slab.h:495 [inline]
             slab_alloc_node mm/slub.c:2842 [inline]
             slab_alloc mm/slub.c:2931 [inline]
             kmem_cache_alloc+0x8c/0xe64 mm/slub.c:2936
             __sigqueue_alloc+0x224/0x5a4 kernel/signal.c:437
             __send_signal+0x700/0xeac kernel/signal.c:1121
             send_signal+0x348/0x6a0 kernel/signal.c:1247
             force_sig_info_to_task+0x184/0x260 kernel/signal.c:1339
             force_sig_fault_to_task kernel/signal.c:1678 [inline]
             force_sig_fault+0xb0/0xf0 kernel/signal.c:1685
             arm64_force_sig_fault arch/arm64/kernel/traps.c:182 [inline]
             arm64_notify_die arch/arm64/kernel/traps.c:208 [inline]
             arm64_notify_die+0xdc/0x160 arch/arm64/kernel/traps.c:199
             do_sp_pc_abort+0x4c/0x60 arch/arm64/mm/fault.c:794
             el0_pc+0xd8/0x19c arch/arm64/kernel/entry-common.c:309
             el0_sync_handler+0x12c/0x1e0 arch/arm64/kernel/entry-common.c:394
             el0_sync+0x148/0x180 arch/arm64/kernel/entry.S:683
      
      other info that might help us debug this:
      
      Chain exists of:
      	console_owner --> &tty->read_wait --> &sighand->siglock
      
      Signed-off-by: default avatarYe Weihua <yeweihua4@huawei.com>
      Reviewed-by: default avatarKuohai Xu <xukuohai@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      ab099ea9
    • Qi Zheng's avatar
      mm: fix missing handler for __GFP_NOWARN · 027e2638
      Qi Zheng authored
      mainline inclusion
      from mainline-v5.19-rc1
      commit 3f913fc5f9745613088d3c569778c9813ab9c129
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5T8FD
      CVE: NA
      
      --------------------------------
      
      We expect no warnings to be issued when we specify __GFP_NOWARN, but
      currently in paths like alloc_pages() and kmalloc(), there are still some
      warnings printed, fix it.
      
      But for some warnings that report usage problems, we don't deal with them.
      If such warnings are printed, then we should fix the usage problems.
      Such as the following case:
      
      	WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1));
      
      [zhengqi.arch@bytedance.com: v2]
       Link: https://lkml.kernel.org/r/20220511061951.1114-1-zhengqi.arch@bytedance.com
      Link: https://lkml.kernel.org/r/20220510113809.80626-1-zhengqi.arch@bytedance.com
      
      
      Signed-off-by: default avatarQi Zheng <zhengqi.arch@bytedance.com>
      Cc: Akinobu Mita <akinobu.mita@gmail.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Greg Kroah-Hartman <gregkh@linuxfo...
      027e2638
  6. Sep 27, 2022