Commit cf81307
committed
net: inet: do not leave a dangling sk pointer in inet_create()
jira VULN-41185
cve CVE-2024-56601
commit-author Ignat Korchagin <ignat@cloudflare.com>
commit 9365fa5
sock_init_data() attaches the allocated sk object to the provided sock
object. If inet_create() fails later, the sk object is freed, but the
sock object retains the dangling pointer, which may create use-after-free
later.
Clear the sk pointer in the sock object on error.
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20241014153808.51894-7-ignat@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 9365fa5)
Signed-off-by: Anmol Jain <ajain@ciq.com>1 parent bd7c69d commit cf81307
1 file changed
+10
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
| 370 | + | |
| 371 | + | |
374 | 372 | | |
375 | 373 | | |
376 | 374 | | |
377 | 375 | | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
| 376 | + | |
| 377 | + | |
382 | 378 | | |
383 | 379 | | |
384 | 380 | | |
385 | 381 | | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
| 382 | + | |
| 383 | + | |
390 | 384 | | |
391 | 385 | | |
392 | 386 | | |
393 | 387 | | |
394 | 388 | | |
395 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
396 | 394 | | |
397 | 395 | | |
398 | 396 | | |
| |||
0 commit comments