Linux block layer
 help / color / mirror / Atom feed
* [PATCH] blktrace: zero out blk_io_trace2 pad
@ 2026-12-04  7:50 Johannes Thumshirn
  2026-12-04  8:02 ` Damien Le Moal
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Thumshirn @ 2026-12-04  7:50 UTC (permalink / raw)
  To: axboe@kernel.dk
  Cc: linux-block, Christoph Hellwig, Shinichiro Kawasaki,
	Damien Le Moal, Chaitanya Kulkarni, Johannes Thumshirn

In record_blktrace_event2() zero out struct blk_io_trace2::pad, so any
uninitialized data in it cannot be relayed to user-space.

Fixes: c44347d60626 ("blktrace: add definitions for struct blk_io_trace2")
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---

This is a prerequisite to the blktrace io prio series and I thought I
already sent it, but Shin'ichiro pointed out I forgot it


 kernel/trace/blktrace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 27936cd64fc2..04a450542389 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -107,6 +107,8 @@ static void record_blktrace_event2(struct blk_io_trace2 *t2, pid_t pid, int cpu,
 	t2->error = error;
 	t2->pdu_len = pdu_len + cgid_len;
 
+	memset(t2->pad, 0, sizeof(t2->pad));
+
 	if (cgid_len)
 		memcpy((void *)t2 + sizeof(*t2), &cgid, cgid_len);
 	if (pdu_len)
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] blktrace: zero out blk_io_trace2 pad
  2026-12-04  7:50 [PATCH] blktrace: zero out blk_io_trace2 pad Johannes Thumshirn
@ 2026-12-04  8:02 ` Damien Le Moal
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2026-12-04  8:02 UTC (permalink / raw)
  To: Johannes Thumshirn, axboe@kernel.dk
  Cc: linux-block, Christoph Hellwig, Shinichiro Kawasaki,
	Chaitanya Kulkarni

On 12/4/26 16:50, Johannes Thumshirn wrote:
> In record_blktrace_event2() zero out struct blk_io_trace2::pad, so any
> uninitialized data in it cannot be relayed to user-space.
> 
> Fixes: c44347d60626 ("blktrace: add definitions for struct blk_io_trace2")
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-04  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  7:50 [PATCH] blktrace: zero out blk_io_trace2 pad Johannes Thumshirn
2026-12-04  8:02 ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox