Commit 1c6d2d8
committed
vsock: unify table locks
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 [#1] SMP
[ 3.261464] CPU: 2 UID: 0 PID: 222 Comm: vsock Not tainted 6.12.44 #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]>1 parent 4a6259f commit 1c6d2d8
File tree
18 files changed
+34
-54
lines changed- patches-tee
- patches
18 files changed
+34
-54
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | 176 | | |
178 | 177 | | |
179 | 178 | | |
180 | | - | |
| 179 | + | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| |||
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
190 | | - | |
| 189 | + | |
191 | 190 | | |
192 | 191 | | |
193 | 192 | | |
| |||
198 | 197 | | |
199 | 198 | | |
200 | 199 | | |
201 | | - | |
| 200 | + | |
202 | 201 | | |
203 | 202 | | |
204 | 203 | | |
| |||
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
210 | | - | |
| 209 | + | |
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
216 | | - | |
| 215 | + | |
217 | 216 | | |
218 | 217 | | |
219 | 218 | | |
| |||
222 | 221 | | |
223 | 222 | | |
224 | 223 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 224 | + | |
241 | 225 | | |
242 | 226 | | |
243 | 227 | | |
244 | 228 | | |
245 | | - | |
246 | | - | |
247 | 229 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 230 | + | |
| 231 | + | |
252 | 232 | | |
253 | 233 | | |
254 | 234 | | |
255 | 235 | | |
256 | | - | |
| 236 | + | |
257 | 237 | | |
258 | 238 | | |
259 | 239 | | |
| |||
267 | 247 | | |
268 | 248 | | |
269 | 249 | | |
270 | | - | |
| 250 | + | |
271 | 251 | | |
272 | 252 | | |
273 | | - | |
| 253 | + | |
274 | 254 | | |
275 | 255 | | |
276 | 256 | | |
277 | 257 | | |
278 | 258 | | |
279 | 259 | | |
280 | | - | |
| 260 | + | |
281 | 261 | | |
282 | 262 | | |
283 | 263 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments