lkml.org 
[lkml]   [2021]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3 8/9] kernel: export task_work_add
    Date
    The task_work_add function is needed to prevent userspace races with
    DRM modesetting rights.

    Some DRM ioctls can change modesetting permissions while other
    concurrent users are performing modesetting. To prevent races with
    userspace, such functions should flush readers of old permissions
    before returning to user mode. As the function that changes
    permissions might itself be a reader of the old permissions, we intend
    to schedule this flush using task_work_add.

    However, when DRM is compiled as a loadable kernel module without
    exporting task_work_add, we get the following compilation error:

    ERROR: modpost: "task_work_add" [drivers/gpu/drm/drm.ko] undefined!

    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
    ---
    kernel/task_work.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/kernel/task_work.c b/kernel/task_work.c
    index 1698fbe6f0e1..90000404af2b 100644
    --- a/kernel/task_work.c
    +++ b/kernel/task_work.c
    @@ -60,6 +60,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,

    return 0;
    }
    +EXPORT_SYMBOL(task_work_add);

    /**
    * task_work_cancel_match - cancel a pending work added by task_work_add()
    --
    2.25.1
    \
     
     \ /
      Last update: 2021-08-18 09:42    [W:4.705 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site