summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2026-05-25 12:51:21 -0400
committerPaolo Abeni <pabeni@redhat.com>2026-05-28 13:35:31 +0200
commit204a5efde5ed52932840ee1d15d3b581cfda48e2 (patch)
treea29c53a814cae5340e110dc1a48de301dff20e48 /tools
parent5da98f55b13173c08f003011b76531b25c821c07 (diff)
net/handshake: Verify file-reference balance in submit paths
The new file-reference contract on struct handshake_req is silently breakable: a missing get_file() at submit or a missing fput() on an error path leaves the file leaked but does not crash the test, so the existing absence-of-crash checks pass either way. Snapshot file_count(filp) before each handshake_req_submit() in the submit-success, EAGAIN, EBUSY, and cancel tests, and assert the expected balance after submit and again after cancel. The already-completed cancel test also asserts the post-complete balance, which pins down that handshake_complete() drops the reference and that the subsequent cancel does not double-fput. The destroy test gets the same treatment before __fput_sync(), which double-checks that cancel's fput() ran and the only remaining reference is the one sock_alloc_file() established. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260525-handshake-file-pin-v3-7-66c616906ead@oracle.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions