Bug 7625 - virtio-mmio: fix memory leak of vm_dev
Summary: virtio-mmio: fix memory leak of vm_dev
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: zhujun
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-24 10:48 UTC by zhujun
Modified: 2023-12-18 16:03 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhujun cmss_group 2023-11-24 10:48:44 UTC
With the recent removal of vm_dev from devres its memory is only freed
via the callback virtio_mmio_release_dev. However, this only takes
effect after device_add is called by register_virtio_device. Until then
it's an unmanaged resource and must be explicitly freed on error exit.

This bug was discovered and resolved using Coverity Static Analysis
Security Testing (SAST) by Synopsys, Inc.

Additional info:

社区有patch已经解决
llc: verify mac len before reading mac header

commit f2c0b571a5fc511daf23c060e7a9c1c502069a06

Reference:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=f2c0b571a5fc511daf23c060e7a9c1c502069a06

git cherry-pick -s f2c0b571a5(with stable-v5.10.201 repo added)
Comment 1 小龙 admin 2023-11-24 10:51:19 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2461
Comment 2 Joseph Qi alibaba_cloud_group 2023-12-18 16:02:26 UTC
(In reply to 小龙 from comment #1)
> The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2461

merged
Comment 3 Joseph Qi alibaba_cloud_group 2023-12-18 16:03:51 UTC
The PR is problematic and fixed in a new one:
https://gitee.com/anolis/cloud-kernel/pulls/2487