hv_sock: Report EOF instead of -EIO for FIN#124
hv_sock: Report EOF instead of -EIO for FIN#124dcui wants to merge 2 commits intomicrosoft:product/hcl-main/6.18from
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a Hyper-V vsock regression where receiving a FIN could cause the final read() to return -EIO instead of EOF (0), by adjusting hvs_stream_has_data() FIN handling.
Changes:
- Update
hvs_stream_has_data()to return0(EOF) instead of-EIOwhen a FIN has been encountered andrecv_descis already set. - Remove the local
need_refillflag and replace the prior error return with a FIN-specific early return.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aee8991 to
e05e03e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e05e03e to
e04639f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The first patch is in the upstream net.git tree: A second patch is pending in review: |
c0b55c1 to
699e374
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Commit f0c5827 unluckily causes a regression for the FIN packet, and the final read syscall gets an error rather than 0. Ideally, we would want to fix hvs_channel_readable_payload() so that it could return 0 in the FIN scenario, but it's not good for the hv_sock driver to use the VMBus ringbuffer's cached priv_read_index, which is internal data in the VMBus driver. Fix the regression in hv_sock by returning 0 rather than -EIO. Fixes: f0c5827 ("hv_sock: Return the readable bytes in hvs_stream_has_data()") Cc: stable@vger.kernel.org Reported-by: Ben Hillis <Ben.Hillis@microsoft.com> Reported-by: Mitchell Levy <levymitchell0@gmail.com> Signed-off-by: Dexuan Cui <decui@microsoft.com> Acked-by: Stefano Garzarella <sgarzare@redhat.com> Link: https://patch.msgid.link/20260416191433.840637-1-decui@microsoft.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> As of today (4/21/2026), the patch is in the upstream net.git tree: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=f6315295899415f1ddcf39f7c9cb46d25e2c6c6a
699e374 to
6c811b3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Commit f63152958994 fixes a regression, however it fails to report an
error for malformed/short packets -- normally we should never see such
packets, but let's report an error for them just in case.
Fixes: f63152958994 ("hv_sock: Report EOF instead of -EIO for FIN")
Cc: stable@vger.kernel.org
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20260423064811.1371749-1-decui@microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
As of today (4/23/2026), the patch is in the upstream net.git tree:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=3d1f20727a635811f6b77801a7b57b8995268abd
6c811b3 to
a1deac5
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Commit f0c5827 unluckily causes a regression for the FIN packet, and the final read syscall gets an error rather than 0.
Ideally, we would want to fix hvs_channel_readable_payload() so that it could return 0 in the FIN scenario, but it's not good for the hv_sock driver to use the VMBus ringbuffer's cached priv_read_index, which is internal data in the VMBus driver.
Fix the regression in hv_sock by returning 0 rather than -EIO.
Fixes: f0c5827 ("hv_sock: Return the readable bytes in hvs_stream_has_data()")
Cc: stable@vger.kernel.org
Reported-by: Ben Hillis Ben.Hillis@microsoft.com
Reported-by: Mitchell Levy levymitchell0@gmail.com
Signed-off-by: Dexuan Cui decui@microsoft.com
( As of 4/20/2026, the v2 patch is not in the mainline kernel yet:
https://lore.kernel.org/linux-hyperv/aeHor6IpXUDyMtnW@sgarzare-redhat/T/#t )