Commit c5d29d5
committed
Merge: CVE-2024-56601: net: inet: do not leave a dangling sk pointer in inet_create()
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6102
JIRA: https://issues.redhat.com/browse/RHEL-72304
CVE: CVE-2024-56601
```
net: inet: do not leave a dangling sk pointer in inet_create()
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: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
---
<small>Created 2025-01-07 03:12 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://gitlab.com/cki-project/kernel-workflow/-/issues/new?issue%5Btitle%5D=backporter%20webhook%20issue)</small>
Approved-by: Hangbin Liu <haliu@redhat.com>
Approved-by: Sabrina Dubroca <sdubroca@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>
Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>1 file changed
+10
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 382 | + | |
| 383 | + | |
386 | 384 | | |
387 | 385 | | |
388 | 386 | | |
389 | 387 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
| 388 | + | |
| 389 | + | |
394 | 390 | | |
395 | 391 | | |
396 | 392 | | |
397 | 393 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
| 394 | + | |
| 395 | + | |
402 | 396 | | |
403 | 397 | | |
404 | 398 | | |
405 | 399 | | |
406 | 400 | | |
407 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
408 | 406 | | |
409 | 407 | | |
410 | 408 | | |
| |||
0 commit comments