Commit 085cbbd
kcm: Check if sk_user_data already set in kcm_attach
commit e557124 upstream.
This is needed to prevent sk_user_data being overwritten.
The check is done under the callback lock. This should prevent
a socket from being attached twice to a KCM mux. It also prevents
a socket from being attached for other use cases of sk_user_data
as long as the other cases set sk_user_data under the lock.
Followup work is needed to unify all the use cases of sk_user_data
to use the same locking.
Reported-by: syzbot+114b15f2be420a8886c3@syzkaller.appspotmail.com
Fixes: ab7ac4e ("kcm: Kernel Connection Multiplexor module")
Signed-off-by: Tom Herbert <tom@quantonium.net>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent bd3ccdc commit 085cbbd
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1404 | 1404 | | |
1405 | 1405 | | |
1406 | 1406 | | |
1407 | | - | |
1408 | | - | |
1409 | 1407 | | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
1410 | 1419 | | |
1411 | 1420 | | |
1412 | 1421 | | |
1413 | 1422 | | |
1414 | 1423 | | |
1415 | 1424 | | |
1416 | 1425 | | |
| 1426 | + | |
1417 | 1427 | | |
1418 | 1428 | | |
| 1429 | + | |
| 1430 | + | |
1419 | 1431 | | |
1420 | 1432 | | |
1421 | 1433 | | |
| |||
0 commit comments