Commit 6e54ea3
net: mctp: hold key reference when looking up a general key
Currently, we have a race where we look up a sock through a "general"
(ie, not directly associated with the (src,dest,tag) tuple) key, then
drop the key reference while still holding the key's sock.
This change expands the key reference until we've finished using the
sock, and hence the sock reference too.
Commit message changes from Jeremy Kerr <[email protected]>.
Reported-by: Noam Rathaus <[email protected]>
Fixes: 73c6184 ("mctp: locking, lifetime and validity changes for sk_keys")
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Jeremy Kerr <[email protected]>
Signed-off-by: David S. Miller <[email protected]>1 parent 5f41ae6 commit 6e54ea3
1 file changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
320 | 321 | | |
321 | | - | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
367 | | - | |
368 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
369 | 369 | | |
370 | | - | |
371 | | - | |
372 | | - | |
| 370 | + | |
373 | 371 | | |
374 | 372 | | |
375 | 373 | | |
| |||
475 | 473 | | |
476 | 474 | | |
477 | 475 | | |
| 476 | + | |
| 477 | + | |
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
| |||
0 commit comments