Skip to content
Snippets Groups Projects
  1. Sep 26, 2022
    • Wang Wensheng's avatar
      mm/sharepool: Fix UAF reported by KASAN · 89f5304b
      Wang Wensheng authored
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5PD4P
      
      
      CVE: NA
      
      --------------------------------
      
      [ 2058.802818][  T290] BUG: KASAN: use-after-free in get_process_sp_res+0x70/0x134
      [ 2058.810194][  T290] Read of size 8 at addr ffff00088dc6ab28 by task test_debug_loop/290
      [ 2058.820520][  T290] CPU: 5 PID: 290 Comm: test_debug_loop Tainted: G        W  OE     5.10.0+ #2
      [ 2058.829377][  T290] Hardware name: EVB(EP) (DT)
      [ 2058.833982][  T290] Call trace:
      [ 2058.837217][  T290]  dump_backtrace+0x0/0x30c
      [ 2058.841660][  T290]  show_stack+0x20/0x30
      [ 2058.845758][  T290]  dump_stack+0x120/0x1b0
      [ 2058.850028][  T290]  print_address_description.constprop.0+0x2c/0x1fc
      [ 2058.856555][  T290]  __kasan_report+0xfc/0x160
      [ 2058.861086][  T290]  kasan_report+0x44/0xb0
      [ 2058.865356][  T290]  __asan_load8+0x94/0xd0
      [ 2058.869623][  T290]  get_process_sp_res+0x70/0x134
      [ 2058.874501][  T290]  proc_usage_show+0x1ac/0x304
      [ 2058.879208][  T290]  seq_read_iter+0x254/0x750
      [ 2058.883728][  T290]  proc_reg_read_iter+0x100/0x140
      [ 2058.888689][  T290]  new_sync_read+0x1cc/0x2c0
      [ 2058.893215][  T290]  vfs_read+0x1f4/0x250
      [ 2058.897304][  T290]  ksys_read+0xcc/0x170
      [ 2058.901399][  T290]  __arm64_sys_read+0x4c/0x60
      [ 2058.906016][  T290]  el0_svc_common.constprop.0+0xb4/0x2a0
      [ 2058.911584][  T290]  do_el0_svc+0x8c/0xb0
      [ 2058.915677][  T290]  el0_svc+0x20/0x30
      [ 2058.919503][  T290]  el0_sync_handler+0xb0/0xbc
      [ 2058.924114][  T290]  el0_sync+0x180/0x1c0
      [ 2058.928190][  T290]
      [ 2058.930444][  T290] Allocated by task 2176:
      [ 2058.934714][  T290]  kasan_save_stack+0x28/0x60
      [ 2058.939328][  T290]  __kasan_kmalloc.constprop.0+0xc8/0xf0
      [ 2058.944909][  T290]  kasan_kmalloc+0x10/0x20
      [ 2058.949268][  T290]  kmem_cache_alloc_trace+0x128/0xabc
      [ 2058.954577][  T290]  create_spg_node+0x58/0x214
      [ 2058.959188][  T290]  local_group_add_task+0x30/0x14c
      [ 2058.964231][  T290]  init_local_group+0xd0/0x1a0
      [ 2058.968936][  T290]  sp_init_group_master_locked.part.0+0x19c/0x290
      [ 2058.975298][  T290]  mg_sp_group_add_task+0x73c/0xdb0
      [ 2058.980456][  T290]  dev_sp_add_group+0x124/0x2dc [sharepool_dev]
      [ 2058.986647][  T290]  dev_ioctl+0x21c/0x2ec [sharepool_dev]
      [ 2058.992222][  T290]  __arm64_sys_ioctl+0xd8/0x120
      [ 2058.997010][  T290]  el0_svc_common.constprop.0+0xb4/0x2a0
      [ 2059.002572][  T290]  do_el0_svc+0x8c/0xb0
      [ 2059.006662][  T290]  el0_svc+0x20/0x30
      [ 2059.010489][  T290]  el0_sync_handler+0xb0/0xbc
      [ 2059.015101][  T290]  el0_sync+0x180/0x1c0
      [ 2059.019176][  T290]
      [ 2059.021427][  T290] Freed by task 4125:
      [ 2059.025343][  T290]  kasan_save_stack+0x28/0x60
      [ 2059.029949][  T290]  kasan_set_track+0x28/0x40
      [ 2059.034476][  T290]  kasan_set_free_info+0x24/0x50
      [ 2059.039347][  T290]  __kasan_slab_free+0x104/0x1ac
      [ 2059.044227][  T290]  kasan_slab_free+0x14/0x20
      [ 2059.048744][  T290]  kfree+0x164/0xb94
      [ 2059.052576][  T290]  sp_group_post_exit+0xf0/0x980
      [ 2059.057448][  T290]  mmput.part.0+0xb4/0x220
      [ 2059.061790][  T290]  mmput+0x2c/0x40
      [ 2059.065450][  T290]  exit_mm+0x27c/0x3a0
      [ 2059.069450][  T290]  do_exit+0x2a0/0x790
      [ 2059.073448][  T290]  do_group_exit+0x64/0x100
      [ 2059.077884][  T290]  get_signal+0x1fc/0x9fc
      [ 2059.082144][  T290]  do_signal+0x110/0x2cc
      [ 2059.086320][  T290]  do_notify_resume+0x158/0x2b0
      [ 2059.091108][  T290]  work_pending+0xc/0x6d4
      [ 2059.095358][  T290]
      
      Signed-off-by: default avatarWang Wensheng <wangwensheng4@huawei.com>
      Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      89f5304b
    • David Jeffery's avatar
      blk-mq: avoid extending delays of active hctx from blk_mq_delay_run_hw_queues · 9c7724ae
      David Jeffery authored
      mainline inclusion
      from mainline-v5.18-rc1
      commit 8f5fea65b06de1cc51d4fc23fb4d378d1abd6ed7
      category: bugfix
      bugzilla: 187541, https://gitee.com/openeuler/kernel/issues/I5RUM6
      
      
      CVE: NA
      
      --------------------------------
      
      When blk_mq_delay_run_hw_queues sets an hctx to run in the future, it can
      reset the delay length for an already pending delayed work run_work. This
      creates a scenario where multiple hctx may have their queues set to run,
      but if one runs first and finds nothing to do, it can reset the delay of
      another hctx and stall the other hctx's ability to run requests.
      
      To avoid this I/O stall when an hctx's run_work is already pending,
      leave it untouched to run at its current designated time rather than
      extending its delay. The work will still run which keeps closed the race
      calling blk_mq_delay_run_hw_queues is needed for while also avoiding the
      I/O stall.
      
      Signed-off-by: default avatarDavid Jeffery <djeffery@redhat.com>
      Reviewed-by: Ming ...
      9c7724ae
    • Ma Wupeng's avatar
      mm: mem_reliable: Start fallback if no suitable zone found · f8f0da00
      Ma Wupeng authored
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S
      
      
      CVE: NA
      
      --------------------------------
      
      For reliable memory allocation bind to nodes which do not hvve any
      reliable zones, its memory allocation will fail and then warn message
      will be produced at the end of __alloc_pages_slowpath().
      
      Though this memory allocation can fallback to movable zone in
      check_after_alloc() if fallback is enabled, something should be done to
      prevent this pointless warn log.
      
      To solve this problem, fallback to movable zone if no suitable zone found.
      
      Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
      Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      f8f0da00
  2. Sep 22, 2022
  3. Sep 20, 2022
  4. Sep 14, 2022
  5. Sep 13, 2022
  6. Sep 07, 2022