diff options
| author | Luigi Leonardi <leonardi@redhat.com> | 2026-04-15 18:09:30 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-04-17 05:34:22 +0300 |
| commit | 2a2675ef619010912a5826297cd3cab00d7dc697 (patch) | |
| tree | 9eb155b2aefa533ea3b48473352c86f6aeba3c20 /include/linux/stringify.h | |
| parent | a3f77afbf67d5ddbc8938fd5627a11221d8a3368 (diff) | |
| download | linux-2a2675ef619010912a5826297cd3cab00d7dc697.tar.xz | |
vsock/test: add MSG_PEEK after partial recv test
Add a test that verifies MSG_PEEK works correctly after a partial
recv().
This is to test a bug that was present in the
`virtio_transport_stream_do_peek()` when computing the number of bytes to
copy: After a partial read, the peek function didn't take into
consideration the number of bytes that were already read. So peeking the
whole buffer would cause an out-of-bounds read, that resulted in a -EFAULT.
This test does exactly this: do a partial recv on a buffer, then try to
peek the whole buffer content. The test re-uses
`test_stream_msg_peek_client()` to also cover this scenario.
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Link: https://patch.msgid.link/20260415-fix_peek-v4-3-8207e872759e@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/stringify.h')
0 files changed, 0 insertions, 0 deletions
