diff options
| author | Alexander Popov <[email protected]> | 2021-02-01 08:47:19 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2021-02-02 03:54:30 +0000 |
| commit | c518adafa39f37858697ac9309c6cf1805581446 (patch) | |
| tree | 3210f168d0994023031222b8cce28bc546e3137a /net/lapb/lapb_out.c | |
| parent | net: sched: replaced invalid qdisc tree flush helper in qdisc_replace (diff) | |
| download | kernel-c518adafa39f37858697ac9309c6cf1805581446.tar.gz kernel-c518adafa39f37858697ac9309c6cf1805581446.zip | |
vsock: fix the race conditions in multi-transport support
There are multiple similar bugs implicitly introduced by the
commit c0cfa2d8a788fcf4 ("vsock: add multi-transports support") and
commit 6a2c0962105ae8ce ("vsock: prevent transport modules unloading").
The bug pattern:
[1] vsock_sock.transport pointer is copied to a local variable,
[2] lock_sock() is called,
[3] the local variable is used.
VSOCK multi-transport support introduced the race condition:
vsock_sock.transport value may change between [1] and [2].
Let's copy vsock_sock.transport pointer to local variables after
the lock_sock() call.
Fixes: c0cfa2d8a788fcf4 ("vsock: add multi-transports support")
Signed-off-by: Alexander Popov <[email protected]>
Reviewed-by: Stefano Garzarella <[email protected]>
Reviewed-by: Jorgen Hansen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/lapb/lapb_out.c')
0 files changed, 0 insertions, 0 deletions
