Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • kernel
  • workqueue.c
Find file BlameHistoryPermalink
  • Walter Wu's avatar
    workqueue: kasan: record workqueue stack · e89a85d6
    Walter Wu authored Dec 14, 2020
    Patch series "kasan: add workqueue stack for generic KASAN", v5.
    
    Syzbot reports many UAF issues for workqueue, see [1].
    
    In some of these access/allocation happened in process_one_work(), we
    see the free stack is useless in KASAN report, it doesn't help
    programmers to solve UAF for workqueue issue.
    
    This patchset improves KASAN reports by making them to have workqueue
    queueing stack.  It is useful for programmers to solve use-after-free or
    double-free memory issue.
    
    Generic KASAN also records the last two workqueue stacks and prints them
    in KASAN report.  It is only suitable for generic KASAN.
    
    [1] https://groups.google.com/g/syzkaller-bugs/search?q=%22use-after-free%22+process_one_work
    [2] https://bugzilla.kernel.org/show_bug.cgi?id=198437
    
    This patch (of 4):
    
    When analyzing use-after-free or double-free issue, recording the
    enqueuing work stacks is helpful to preserve usage history which
    potentially gives a hint about the affected code.
    
    For workqueue it has turned out to be useful to record the enqueuing work
    call stacks.  Because user can see KASAN report to determine whether it is
    root cause.  They don't need to enable debugobjects, but they have a
    chance to find out the root cause.
    
    Link: https://lkml.kernel.org/r/20201203022148.29754-1-walter-zh.wu@mediatek.com
    Link: https://lkml.kernel.org/r/20201203022442.30006-1-walter-zh.wu@mediatek.com
    
    
    Signed-off-by: default avatarWalter Wu <walter-zh.wu@mediatek.com>
    Suggested-by: default avatarMarco Elver <elver@google.com>
    Acked-by: default avatarMarco Elver <elver@google.com>
    Acked-by: default avatarTejun Heo <tj@kernel.org>
    Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
    Reviewed-by: default avatarAndrey Konovalov <andreyknvl@google.com>
    Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
    Cc: Alexander Potapenko <glider@google.com>
    Cc: Lai Jiangshan <jiangshanlai@gmail.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Matthias Brugger <matthias.bgg@gmail.com>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e89a85d6
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7