From: Henry Martin <redacted>
The `struct virtio_vsock_pkt_info` is declared on the stack but only
partially initialized (only `op`, `flags`, and `vsk` are set)
The uninitialized fields (including `pkt_len`, `remote_cid`,
`remote_port`, etc.) contain residual kernel stack data. This structure
is passed to `virtio_transport_send_pkt_info()`, which uses the
uninitialized fields.
Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
Reported-by: TCS Robot <redacted>
Signed-off-by: Henry Martin <redacted>
---
net/vmw_vsock/virtio_transport_common.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
From: Wang Liang <hidden> Date: 2025-08-05 06:55:40
在 2025/8/5 13:10, bsdhenrymartin@gmail.com 写道:
quoted hunk
From: Henry Martin <redacted>
The `struct virtio_vsock_pkt_info` is declared on the stack but only
partially initialized (only `op`, `flags`, and `vsk` are set)
The uninitialized fields (including `pkt_len`, `remote_cid`,
`remote_port`, etc.) contain residual kernel stack data. This structure
is passed to `virtio_transport_send_pkt_info()`, which uses the
uninitialized fields.
Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
Reported-by: TCS Robot <redacted>
Signed-off-by: Henry Martin <redacted>
---
net/vmw_vsock/virtio_transport_common.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
On Tue, Aug 05, 2025 at 01:10:09PM +0800, bsdhenrymartin@gmail.com wrote:
quoted hunk
From: Henry Martin <redacted>
The `struct virtio_vsock_pkt_info` is declared on the stack but only
partially initialized (only `op`, `flags`, and `vsk` are set)
The uninitialized fields (including `pkt_len`, `remote_cid`,
`remote_port`, etc.) contain residual kernel stack data. This structure
is passed to `virtio_transport_send_pkt_info()`, which uses the
uninitialized fields.
Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
Reported-by: TCS Robot <redacted>
Signed-off-by: Henry Martin <redacted>
---
net/vmw_vsock/virtio_transport_common.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
The compiler sets all other fields to 0, so I don't understand what this patch solves.
Can you give an example of the problem you found?
Furthermore, even if this fix were valid, why do it for just one function?
Stefano
From: henry martin <hidden> Date: 2025-08-05 08:53:16
Thanks for the quick review. You're right—this patch is a false
positive. Modern compilers zero out the remaining fields, so the fix
isn't needed.
I'll be withdrawing all the patches and will ensure we more carefully
evaluate our robot's findings before submitting in the future.
Thanks for your help!
Stefano Garzarella [off-list ref] 于2025年8月5日周二 15:01写道:
On Tue, Aug 05, 2025 at 01:10:09PM +0800, bsdhenrymartin@gmail.com wrote:
quoted
From: Henry Martin <redacted>
The `struct virtio_vsock_pkt_info` is declared on the stack but only
partially initialized (only `op`, `flags`, and `vsk` are set)
The uninitialized fields (including `pkt_len`, `remote_cid`,
`remote_port`, etc.) contain residual kernel stack data. This structure
is passed to `virtio_transport_send_pkt_info()`, which uses the
uninitialized fields.
Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
Reported-by: TCS Robot <redacted>
Signed-off-by: Henry Martin <redacted>
---
net/vmw_vsock/virtio_transport_common.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
The compiler sets all other fields to 0, so I don't understand what this
patch solves.
Can you give an example of the problem you found?
Furthermore, even if this fix were valid, why do it for just one
function?
Stefano