[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANpmjNO9LKPvyPaebk8JcGEg5jjkm6iz3x6hPqsRLgOetkzSnA@mail.gmail.com>
Date: Mon, 14 Oct 2024 14:42:07 +0200
From: Marco Elver <elver@...gle.com>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: syzbot <syzbot+e75157f5b04f8ff40e17@...kaller.appspotmail.com>, acme@...nel.org,
adrian.hunter@...el.com, alexander.shishkin@...ux.intel.com,
irogers@...gle.com, jolsa@...nel.org, kan.liang@...ux.intel.com,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
mark.rutland@....com, mingo@...hat.com, namhyung@...nel.org,
peterz@...radead.org, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [perf?] KCSAN: data-race in _free_event /
perf_pending_task (2)
On Mon, 14 Oct 2024 at 12:30, Dmitry Vyukov <dvyukov@...gle.com> wrote:
[...]
> But that task is later using 'current' to do something with regard to
> this event:
>
> /*
> * If the task is queued to the current task's queue, we
> * obviously can't wait for it to complete. Simply cancel it.
> */
> if (task_work_cancel(current, head)) {
>
> Is this current wrong here? So it may both not cancel it for the real
> owner, and cancel something else for itself (?).
That's fine - task_work_cancel() looks for the event in the passed
task_struct, and does nothing if not found. If the task_work is owned
by another task, task_work_cancel() will never find a match, and this
is a no-op. The later rcuwait_wait_event() will wait for the task_work
to complete in the other task.
Powered by blists - more mailing lists