Commit 2673e19
committed
Merge: CVE-2024-53213: net: usb: lan78xx: Fix double free issue with interrupt buffer allocation
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6170
JIRA: https://issues.redhat.com/browse/RHEL-72355
CVE: CVE-2024-53213
```
net: usb: lan78xx: Fix double free issue with interrupt buffer allocation
In lan78xx_probe(), the buffer `buf` was being freed twice: once
implicitly through `usb_free_urb(dev->urb_intr)` with the
`URB_FREE_BUFFER` flag and again explicitly by `kfree(buf)`. This caused
a double free issue.
To resolve this, reordered `kmalloc()` and `usb_alloc_urb()` calls to
simplify the initialization sequence and removed the redundant
`kfree(buf)`. Now, `buf` is allocated after `usb_alloc_urb()`, ensuring
it is correctly managed by `usb_fill_int_urb()` and freed by
`usb_free_urb()` as intended.
Fixes: a6df95c ("lan78xx: Fix memory allocation bug")
Cc: John Efstathiades <john.efstathiades@pebblebay.com>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20241116130558.1352230-1-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 03819ab)
```
Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
---
<small>Created 2025-01-14 11:45 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: José Ignacio Tornos Martínez <jtornosm@redhat.com>
Approved-by: mheib <mheib@redhat.com>
Approved-by: Michal Schmidt <mschmidt@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>
Merged-by: Patrick Talbert <ptalbert@redhat.com>1 file changed
+14
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4412 | 4412 | | |
4413 | 4413 | | |
4414 | 4414 | | |
4415 | | - | |
4416 | | - | |
| 4415 | + | |
| 4416 | + | |
| 4417 | + | |
4417 | 4418 | | |
4418 | 4419 | | |
4419 | 4420 | | |
4420 | 4421 | | |
4421 | | - | |
4422 | | - | |
| 4422 | + | |
| 4423 | + | |
4423 | 4424 | | |
4424 | | - | |
4425 | | - | |
4426 | | - | |
4427 | | - | |
4428 | | - | |
4429 | | - | |
| 4425 | + | |
4430 | 4426 | | |
4431 | 4427 | | |
| 4428 | + | |
| 4429 | + | |
| 4430 | + | |
| 4431 | + | |
| 4432 | + | |
4432 | 4433 | | |
4433 | 4434 | | |
4434 | 4435 | | |
4435 | 4436 | | |
4436 | 4437 | | |
4437 | | - | |
| 4438 | + | |
4438 | 4439 | | |
4439 | 4440 | | |
4440 | 4441 | | |
4441 | 4442 | | |
4442 | 4443 | | |
4443 | 4444 | | |
4444 | 4445 | | |
4445 | | - | |
| 4446 | + | |
4446 | 4447 | | |
4447 | 4448 | | |
4448 | 4449 | | |
| |||
4464 | 4465 | | |
4465 | 4466 | | |
4466 | 4467 | | |
4467 | | - | |
| 4468 | + | |
4468 | 4469 | | |
4469 | | - | |
4470 | | - | |
4471 | 4470 | | |
4472 | 4471 | | |
4473 | 4472 | | |
| |||
0 commit comments