Skip to content

Conversation

@slp
Copy link
Collaborator

@slp slp commented 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.

This is an ABI breaking change, so we need to bump major to 5.x.x

slp added 2 commits September 12, 2025 05:22
Fix an issue where tsi_create may attempt to exit releasing
sockets that hasn't been allocated.

Fixes: containers#99

Signed-off-by: Sergio Lopez <[email protected]>
Replace ops->release with sock_release, which does that job and
also releases the associated inode.

Fixes: containers#80

Suggested-by: Xuewei Niu <[email protected]>
Signed-off-by: Sergio Lopez <[email protected]>
slp added 3 commits September 13, 2025 07:48
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 <[email protected]>
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 [containers#1] SMP
[    3.261464] CPU: 2 UID: 0 PID: 222 Comm: vsock Not tainted 6.12.44 containers#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 <[email protected]>
TSIv3 is an ABI breaking change, requiring a bump of the major
version.

Signed-off-by: Sergio Lopez <[email protected]>
@slp slp force-pushed the tsi-v3 branch 4 times, most recently from c54c689 to f3c7251 Compare September 18, 2025 09:56
@slp slp marked this pull request as ready for review September 18, 2025 10:21
@slp slp merged commit 23721f0 into containers:main Sep 26, 2025
6 checks passed
@slp slp deleted the tsi-v3 branch September 26, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant