Bug 4109 - BUG:potential null-ptr-deref in start_task()
Summary: BUG:potential null-ptr-deref in start_task()
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: 5.10.y-13
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: GuixinLiu
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-17 17:16 UTC by ljubomir
Modified: 2023-02-28 19:38 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ljubomir inspur_group 2023-02-17 17:16:36 UTC
Description of problem:

start_task() calls create_singlethread_workqueue() and not checked the
ret value, which may return NULL. And a null-ptr-deref may happen:

start_task()
    create_singlethread_workqueue() # failed, led_wq is NULL
    queue_delayed_work()
        queue_delayed_work_on()
            __queue_delayed_work()  # warning here, but continue
                __queue_work()      # access wq->flags, null-ptr-deref
Comment 1 maqiao alibaba_cloud_group 2023-02-28 19:38:53 UTC
merged: https://gitee.com/anolis/cloud-kernel/pulls/1214