Re: [PATCH] media: vidtv: fix uninitialized args.buf_sz passed by value

From: Abd-Alrhman Masalkhi

Date: Fri Feb 20 2026 - 09:54:04 EST



Hi Yihan Ding,

On Fri, Feb 20, 2026 at 21:39 +0800, Ding Yihan wrote:
> Hi Thomas and Abd-Alrhman,
>
> While looking into this exact same syzbot report, I noticed that
> `vidtv_ts_pcr_write_into()` in the same file also suffers from the
> exact same pass-by-value anti-pattern (passing `struct pcr_write_args` by value).
>
> Since `pcr_write_args` also contains implicit padding, it remains a potential trigger
> for identical KMSAN uninit-value warnings during fuzzing in the future.
>
> Also, regarding Thomas's concern about modifying shared data: passing the struct
> as a `const pointer` (e.g., `const struct null_packet_write_args *`)
> would perfectly guarantee that the state remains read-only.
>
> Thomas, would it be worth submitting a separate patch now to fix `vidtv_ts_pcr_write_into()`
> to prevent future KMSAN errors? Or would you prefer this to be addressed together in Abd-Alrhman's v2?
>
> Best regards,
> Yihan Ding
>

Thanks for pointing that out. I agree that vidtv_ts_pcr_write_into()
should be updated in the same way, since it has identical padding issues.

For v2 I’ll incorporate both fixes together and switch both parameters
add the const modifier, as you and Thomas suggested.

Thanks again for the helpful review.

--
Best Regards,
Abd-Alrhman