Implement TSIv3#101
Merged
Merged
Conversation
Fix an issue where tsi_create may attempt to exit releasing sockets that hasn't been allocated. Fixes: libkrun#99 Signed-off-by: Sergio Lopez <slp@redhat.com>
Replace ops->release with sock_release, which does that job and also releases the associated inode. Fixes: libkrun#80 Suggested-by: Xuewei Niu <niuxuewei.nxw@antgroup.com> Signed-off-by: Sergio Lopez <slp@redhat.com>
This was referenced Sep 12, 2025
TSIv3 generalizes socket addresses to be able to support multiple kinds of addresses with a only small amount of additional code. Then, building on top of this generalization, we add AF_INET6 and AF_UNIX to the existing AF_INET support. Signed-off-by: Sergio Lopez <slp@redhat.com>
The DGRAM patches introduce an additional vsock table lock, in addition to the original vsock_table_lock, to operate on the vsock dgram bound table. But the knowledge of whether the socket is dgram or not is not properly propagated, so there are code paths that can operate on one list while having a lock on the wrong one. As the gains of having two table locks are minimal, unify the table locks on the original one. This fixes a kernel bug like this one: [ 3.260602] list_del corruption. prev->next should be ffff0000823a3748, but was ffff000080c379c8. (prev=ffff80008151e828) [ 3.261075] ------------[ cut here ]------------ [ 3.261286] kernel BUG at lib/list_debug.c:62! [ 3.261382] Internal error: Oops - BUG: 00000000f2000800 [libkrun#1] SMP [ 3.261464] CPU: 2 UID: 0 PID: 222 Comm: vsock Not tainted 6.12.44 libkrun#3 [ 3.261658] Hardware name: linux,dummy-virt (DT) [ 3.261799] pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) [ 3.262017] pc : __list_del_entry_valid_or_report+0xa0/0xd8 [ 3.262210] lr : __list_del_entry_valid_or_report+0xa0/0xd8 [ 3.262314] sp : ffff800082cc3c80 [ 3.262349] x29: ffff800082cc3c80 x28: ffff000082c62100 x27: 0000000000000000 [ 3.262615] x26: 0000000000000000 x25: ffff80008151fa58 x24: 0000000000000000 [ 3.262818] x23: ffff0000823a3840 x22: ffff0000823a3748 x21: ffff80008151d878 [ 3.263021] x20: ffff80008151fa58 x19: ffff0000823a3440 x18: 000000000000000a [ 3.263224] x17: 20747562202c3834 x16: 3733613332383030 x15: 3030666666662065 [ 3.263428] x14: ffff8000813ec7f0 x13: 38666666663d7665 x12: 727028202e386339 [ 3.263644] x11: ffff8000813ec7f0 x10: 000000000002bfa8 x9 : 00000000000000c6 [ 3.263847] x8 : ffff8000814187f0 x7 : 80000000fffff800 x6 : ffff8000814187f0 [ 3.264052] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 00000000fffff7ff [ 3.264200] x2 : ffff8000813ec720 x1 : ffff8000813ec720 x0 : 000000000000006d [ 3.264270] Call trace: [ 3.264295] __list_del_entry_valid_or_report+0xa0/0xd8 [ 3.264459] vsock_bind_common+0x2bc/0x2c0 [ 3.264577] __vsock_bind+0xa8/0x200 [ 3.264686] vsock_bind+0x44/0x70 [ 3.264793] __sys_bind+0x64/0xc4 [ 3.264950] __arm64_sys_bind+0x1c/0x38 [ 3.265061] invoke_syscall.constprop.0+0x40/0xf0 [ 3.265203] el0_svc_common.constprop.0+0x38/0xd8 [ 3.265344] do_el0_svc+0x1c/0x28 [ 3.265451] el0_svc+0x38/0x150 [ 3.265560] el0t_64_sync_handler+0x120/0x12c [ 3.265722] el0t_64_sync+0x194/0x198 [ 3.265834] Code: b00034c0 aa0403e2 912a0000 97ffd025 (d4210000) [ 3.266005] ---[ end trace 0000000000000000 ]--- Signed-off-by: Sergio Lopez <slp@redhat.com>
TSIv3 is an ABI breaking change, requiring a bump of the major version. Signed-off-by: Sergio Lopez <slp@redhat.com>
c54c689 to
f3c7251
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TSIv3 generalizes socket addresses to be able to support multiple kinds of addresses with a only small amount of additional code.
Then, building on top of this generalization, we add AF_INET6 and AF_UNIX to the existing AF_INET support.
This is an ABI breaking change, so we need to bump major to 5.x.x