Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp235410pxb; Wed, 18 Aug 2021 00:44:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO9zzmj64qWLuSxY9ld0hQqhPDRdCz0jqpgs7HDJUGbauRxXfzJDr7yELSLWBI+Ve95TrV X-Received: by 2002:a05:6638:358e:: with SMTP id v14mr7038152jal.0.1629272662767; Wed, 18 Aug 2021 00:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629272662; cv=none; d=google.com; s=arc-20160816; b=qBPUO5HKi1vXwJAD3PBiouwhuRXzIpYw8OeFKjBIrQ7K15tNws1AiWR7mweezjTZe8 DRXn3HE6giZgMkQKSUXid1SHLX6JoSEg3cjsmvGeDm+1tmo5XCvgEv13kA8rLe4hbIN+ xvxsVW3Sh/VHwkm90wGbCjq+QDSbBZiw/oH98ZQUt5/Tyrl8/Fp+zuKN2v1msnF2Lg1F 8wexoiV6k0hmjVdL3t9QWzo5DSG0uWnK6rHcTZPTMYPpBoVsXSaXM/A5vaPuvnkEB1RL M8H2lQb1r0y1cT40vv+LUQXjRvA46emIZ7th654v1ytT5LQP1xbh0StPKD5E6901Uzg7 qOgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=E3tKLo4xSINmwLRhCWFdK6hj3HPWsZp310jfHIOH2bI=; b=eS6DPdFGmyqnBALxaeoZxJD4o19mTOePUE/0Ay/m3Wo5fR2Im2EWF3UAbhRHNJovx3 oG8Vb8s9libJ78ciOtgtBzJK0+B0fTCR8wW+d6ogHESkn0dbkj9vYjPYySRMSACol0nM x+pC8/ykt3Xs3W3UPZrASu8tDpdYf7sT/IjgA+Tf+4rOrTDWpV0GLgWn6M7v0ryHlONY DiiM6U3o1OEs+txc7M5NmWwTDRhywwPU1sYnnd96chsdd3NSUJWukz56icWByyTFyz48 nfeLWpwoWA4sksJwtRQLJOcpXW9gaft38JXw0Y3Ubenq4HweqAJ5wrCmAUYPsRzMVxaM QQng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eYlqI7+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b135si4880511iof.27.2021.08.18.00.44.11; Wed, 18 Aug 2021 00:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eYlqI7+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239334AbhHRHmA (ORCPT + 99 others); Wed, 18 Aug 2021 03:42:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239402AbhHRHlz (ORCPT ); Wed, 18 Aug 2021 03:41:55 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BAB6C0613CF; Wed, 18 Aug 2021 00:41:21 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id nt11so2089295pjb.2; Wed, 18 Aug 2021 00:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E3tKLo4xSINmwLRhCWFdK6hj3HPWsZp310jfHIOH2bI=; b=eYlqI7+uh+RIUCvEG+ElTKQ65oYiO/7b9n5s4gD+lLB6dI3+1tBTrfM+E9gHq8+ghC pG+mnIdCtT+Qw/TcAMOTN1jsKNfeHJwUKNjPciJDepeHxgQuMRRs7kyHxyN3OR70HFEk fH+FOFElAQ4Gsek+UHpdno02wP1O8QQA6kKroGAfCuSk73VvPdce0uYe68NM9b0/lhWN +ViMb30Poox2EIE3XtkHQvZtKdTkqedODzSILqubxYNdgynB3qc8Ix+Nz5Uqdi4f6qGm 3QkmjB9cvkubT2qFaKfHNev6sn1lvzQ9lLvI0mmtvOsFiagT4KeuiRaSXnwiqAQmm3v2 i6Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E3tKLo4xSINmwLRhCWFdK6hj3HPWsZp310jfHIOH2bI=; b=bE++CX6RJfneruJRdoRxu26NzZ7JweDNUkOzLxemORezbM5Il7vdcPJYem2fKAvA/+ XRpoJkDEh55n/JmbFLiWsvxygTkffjS7NCSHwIYoyBsxkykn7ZVOmV2SLh+EXr+jR9ie U5k+24c4LQiIKS+QknrmoUaWVgj1pwxRZKnRfF5TQtd8aAqdeiebGOHyjL/1qgji6ARU xz3XYEHnFH/wxPt2aXDx8wJr2lh7B97mkSH1bVEkpZETXc4eEoKJNOv8iAekX+pnN++r SpH6iRkI2434leuKJmJ92OqD3Lp7Jj+CM1pRzAWIhX6FMeeAgSGfKuqBKtLXipHrf0k5 Skug== X-Gm-Message-State: AOAM531Kz1lE3M+L9sAQvU6icBACf5NStKb/TJswg+iCpYRRtkuU9a3P qXz8vq7Pt9KYKeOZVwvk+Fc= X-Received: by 2002:a17:902:a406:b029:12b:c50a:4289 with SMTP id p6-20020a170902a406b029012bc50a4289mr6303191plq.56.1629272480446; Wed, 18 Aug 2021 00:41:20 -0700 (PDT) Received: from localhost.localdomain ([118.200.190.93]) by smtp.gmail.com with ESMTPSA id u3sm3886729pjr.2.2021.08.18.00.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 00:41:20 -0700 (PDT) From: Desmond Cheong Zhi Xi To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch, sumit.semwal@linaro.org, christian.koenig@amd.com, axboe@kernel.dk, oleg@redhat.com, tglx@linutronix.de, dvyukov@google.com, walter-zh.wu@mediatek.com Cc: Desmond Cheong Zhi Xi , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, skhan@linuxfoundation.org, gregkh@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, kernel test robot Subject: [PATCH v3 8/9] kernel: export task_work_add Date: Wed, 18 Aug 2021 15:38:23 +0800 Message-Id: <20210818073824.1560124-9-desmondcheongzx@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818073824.1560124-1-desmondcheongzx@gmail.com> References: <20210818073824.1560124-1-desmondcheongzx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Desmond Cheong Zhi Xi --- 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