blktrace: always record ftrace events as blk_io_trace2 - #166
Open
blktests-ci-block-trial[bot] wants to merge 1 commit into
Open
blktrace: always record ftrace events as blk_io_trace2#166blktests-ci-block-trial[bot] wants to merge 1 commit into
blktests-ci-block-trial[bot] wants to merge 1 commit into
Conversation
Author
|
Upstream branch: 841e384 |
blktests-ci-block-trial
Bot
force-pushed
the
master_base
branch
from
September 3, 2026 22:51
3595ceb to
4061e04
Compare
Author
|
Upstream branch: a500db7 |
The ftrace ring buffer always uses the v2 (blk_io_trace2) format, but __blk_add_trace() switched the reserve size and record format on bt->version. That field only describes the relay/classic blktrace record format and must not change what goes into the ftrace buffer: the ftrace readers (print_one_line() and friends) unconditionally parse blk_io_trace2. The BLKTRACESETUP ioctl sets bt->version to 1. With the blk tracer also enabled, __blk_add_trace() recorded a 48-byte v1 event into the ftrace ring buffer, but the reader parses the 64-byte v2 layout, so pdu_start() points 16 bytes past the PDU and blk_log_remap() reads out of bounds - a use-after-free when the ring buffer page is resized concurrently. Always use the v2 format in the blk_tracer path, and initialize bt->version to 2 in blk_trace_setup_queue() so the sysfs-enabled path no longer leaves it uninitialized. Fixes: e48886b ("blktrace: for ftrace use correct trace format ver") Reported-by: syzbot+4dfd96209d744263a972@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=4dfd96209d744263a972 Tested-by: syzbot+4dfd96209d744263a972@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Signed-off-by: Adriano Cordova <adrianox@gmail.com>
blktests-ci-block-trial
Bot
force-pushed
the
series/792=>master
branch
from
September 3, 2026 23:18
94564f3 to
e36b3b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: blktrace: always record ftrace events as blk_io_trace2
version: 1
url: http://redsun45:8000/project/linux-block/list/?series=792