Skip to content

block: annotate lockless task ioprio accesses - #1461

Open
ghost wants to merge 1 commit into
linus-master_basefrom
series/1188204=>linus-master
Open

ghost wants to merge 1 commit into
linus-master_basefrom
series/1188204=>linus-master

Conversation

@ghost

@ghost ghost commented Oct 18, 2026

Copy link
Copy Markdown

Pull request for series with
subject: block: annotate lockless task ioprio accesses
version: 1
url: https://patchwork.kernel.org/series/1188204/

@ghost

ghost commented Oct 18, 2026

Copy link
Copy Markdown
Author

Upstream branch: 58161ea
series: https://patchwork.kernel.org/series/1188204/
version: 1

@ghost

ghost commented Oct 19, 2026

Copy link
Copy Markdown
Author

Upstream branch: c03c1a1
series: https://patchwork.kernel.org/series/1188204/
version: 1

@ghost
ghost force-pushed the series/1188204=>linus-master branch from 22387c4 to 775e5e5 Compare October 19, 2026 00:31
@ghost

ghost commented Oct 19, 2026

Copy link
Copy Markdown
Author

Upstream branch: c03c1a1
series: https://patchwork.kernel.org/series/1188904/
version: 2

@ghost ghost added V2 and removed V1 V1-ci-pass labels Oct 19, 2026
@ghost
ghost force-pushed the series/1188204=>linus-master branch from 775e5e5 to 231ea45 Compare October 19, 2026 13:16
@ghost ghost added the V2-ci-pass label Oct 20, 2026
@ghost

ghost commented Oct 20, 2026

Copy link
Copy Markdown
Author

Upstream branch: c03c1a1
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost ghost added V3 and removed V2 V2-ci-pass labels Oct 20, 2026
@ghost
ghost force-pushed the series/1188204=>linus-master branch from 231ea45 to 64cbf2c Compare October 20, 2026 13:22
@ghost ghost added the V3-ci-pass label Oct 20, 2026
@ghost
ghost force-pushed the linus-master_base branch from 90ea7e4 to 435b194 Compare October 22, 2026 07:21
@ghost

ghost commented Oct 22, 2026

Copy link
Copy Markdown
Author

Upstream branch: 7be4bc5
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from 64cbf2c to a8a3081 Compare October 22, 2026 07:29
@ghost
ghost force-pushed the linus-master_base branch from 435b194 to fd67522 Compare October 24, 2026 03:36
@ghost

ghost commented Oct 24, 2026

Copy link
Copy Markdown
Author

Upstream branch: 17bb0e2
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from a8a3081 to ebc7933 Compare October 24, 2026 03:42
@ghost
ghost force-pushed the linus-master_base branch from fd67522 to 3b53a63 Compare October 26, 2026 01:52
@ghost

ghost commented Oct 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 21a7f44
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from ebc7933 to e5b06b3 Compare October 26, 2026 01:59
@ghost
ghost force-pushed the linus-master_base branch from 3b53a63 to 5d84576 Compare October 26, 2026 07:01
@ghost

ghost commented Oct 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 6b4b543
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from e5b06b3 to c71ee38 Compare October 26, 2026 07:07
@ghost
ghost force-pushed the linus-master_base branch from 5d84576 to 6582ed2 Compare October 26, 2026 18:11
@ghost

ghost commented Oct 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: fb2c3f4
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from c71ee38 to dbc3627 Compare October 26, 2026 18:17
@ghost
ghost force-pushed the linus-master_base branch from 6582ed2 to b3a1abc Compare October 26, 2026 23:55
@ghost

ghost commented Oct 27, 2026

Copy link
Copy Markdown
Author

Upstream branch: d135ab4
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from dbc3627 to 29872b4 Compare October 27, 2026 00:00
@ghost
ghost force-pushed the linus-master_base branch from b3a1abc to 712496f Compare October 28, 2026 23:34
@ghost

ghost commented Oct 28, 2026

Copy link
Copy Markdown
Author

Upstream branch: c339f40
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from 29872b4 to e9eaa30 Compare October 28, 2026 23:54
@ghost
ghost force-pushed the linus-master_base branch from 712496f to a186880 Compare October 30, 2026 13:52
@ghost

ghost commented Oct 30, 2026

Copy link
Copy Markdown
Author

Upstream branch: d89e1d1
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from e9eaa30 to 51aebbd Compare October 30, 2026 14:18
@ghost
ghost force-pushed the linus-master_base branch from a186880 to 46206a3 Compare November 2, 2026 17:14
@ghost

ghost commented Nov 2, 2026

Copy link
Copy Markdown
Author

Upstream branch: 6628e7d
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from 51aebbd to 1a275ab Compare November 2, 2026 17:56
@ghost
ghost force-pushed the linus-master_base branch from 46206a3 to 220bd96 Compare November 3, 2026 23:41
@ghost

ghost commented Nov 4, 2026

Copy link
Copy Markdown
Author

Upstream branch: 05441d6
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from 1a275ab to 570de9c Compare November 4, 2026 00:09
@ghost
ghost force-pushed the linus-master_base branch from 220bd96 to 6c4625e Compare November 6, 2026 08:02
@ghost

ghost commented Nov 6, 2026

Copy link
Copy Markdown
Author

Upstream branch: f66469d
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from 570de9c to 92a8ea6 Compare November 6, 2026 08:50
@ghost
ghost force-pushed the linus-master_base branch from 6c4625e to c7f678d Compare November 7, 2026 03:08
@ghost

ghost commented Nov 7, 2026

Copy link
Copy Markdown
Author

Upstream branch: d487237
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from 92a8ea6 to 37242d9 Compare November 7, 2026 03:46
@ghost
ghost force-pushed the linus-master_base branch from c7f678d to 6aa6cd1 Compare November 10, 2026 07:53
__get_task_ioprio() reads task->io_context and ioc->ioprio without
task_lock() when called on current, e.g. from init_sync_kiocb() on every
write.  set_task_ioprio() can update both for another task at any time,
including the first publication of a new io_context.  KCSAN reports it:

  BUG: KCSAN: data-race in __kernel_write_iter / set_task_ioprio
  value changed: 0x0000000000000000 -> 0xffff888109813730

A stale or torn value is harmless, a task simply gets the old or new
priority, but the compiler may tear or refetch the accesses and the
io_context fields must be visible before the pointer is.

The io_context itself needs no extra protection: only the owning task
drops it, in exit_io_context(), so it cannot be freed under a lockless
reader running as current.

Publish the pointer with smp_store_release(), read it with READ_ONCE()
(address dependency orders the ioprio load), and mark the ioprio
accesses.

Reported-by: syzbot+feeb9b5352b9ff89618a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=feeb9b5352b9ff89618a
Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: b3dfbde
series: https://patchwork.kernel.org/series/1189726/
version: 3

@ghost
ghost force-pushed the series/1188204=>linus-master branch from 37242d9 to 101a123 Compare November 10, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant