UBUNTU-CVE-2024-50020
In the Linux kernel, the following vulnerability has been resolved: ice: Fix improper handling of refcount in ice_sriov_set_msix_vec_count() This patch addresses an issue with improper reference count handling in the ice_sriov_set_msix_vec_count() function. First, the function calls ice_get_vf_by_id(), which increments the reference count of the vf pointer. If the subsequent call to ice_get_vf_vsi() fails, the function currently returns an error without decrementing the reference count of the vf pointer, leading to a reference count leak. The correct behavior, as implemented in this patch, is to decrement the reference count using ice_put_vf(vf) before returning an error when vsi is NULL. Second, the function calls ice_sriov_get_irqs(), which sets vf->first_vector_idx. If this call returns a negative value, indicating an error, the function returns an error without decrementing the reference count of the vf pointer, resulting in another reference count leak. The patch addresses this by adding a call to ice_put_vf(vf) before returning an error when vf->first_vector_idx < 0. This bug was identified by an experimental static analysis tool developed by our team. The tool specializes in analyzing reference count operations and identifying potential mismanagement of reference counts. In this case, the tool flagged the missing decrement operation as a potential issue, leading to this patch.
02 / AFFECTED SOFTWARE
Affected packages
14 explicit affected versions
29 explicit affected versions
10 explicit affected versions
11 explicit affected versions
1 explicit affected versions
6 explicit affected versions
2 explicit affected versions
13 explicit affected versions
7 explicit affected versions
26 explicit affected versions
37 explicit affected versions
17 explicit affected versions
10 explicit affected versions
10 explicit affected versions
10 explicit affected versions
13 explicit affected versions
13 explicit affected versions
1 explicit affected versions
37 explicit affected versions
8 explicit affected versions
4 explicit affected versions
14 explicit affected versions
8 explicit affected versions
19 explicit affected versions
18 explicit affected versions
23 explicit affected versions
7 explicit affected versions
10 explicit affected versions
33 explicit affected versions
11 explicit affected versions
16 explicit affected versions
13 explicit affected versions
12 explicit affected versions
38 explicit affected versions
1 explicit affected versions
51 explicit affected versions
13 explicit affected versions
16 explicit affected versions
10 explicit affected versions
10 explicit affected versions
13 explicit affected versions
11 explicit affected versions
1 explicit affected versions
1 explicit affected versions
10 explicit affected versions
1 explicit affected versions
20 explicit affected versions
8 explicit affected versions
17 explicit affected versions
1 explicit affected versions
13 explicit affected versions
21 explicit affected versions
6 explicit affected versions
13 explicit affected versions
12 explicit affected versions
7 explicit affected versions
14 explicit affected versions
18 explicit affected versions
12 explicit affected versions
26 explicit affected versions
1 explicit affected versions
23 explicit affected versions
7 explicit affected versions
14 explicit affected versions
22 explicit affected versions
5 explicit affected versions
14 explicit affected versions
19 explicit affected versions
3 explicit affected versions
23 explicit affected versions
23 explicit affected versions
26 explicit affected versions
12 explicit affected versions
13 explicit affected versions
15 explicit affected versions
44 explicit affected versions
4 explicit affected versions
4 explicit affected versions
16 explicit affected versions
9 explicit affected versions
12 explicit affected versions
7 explicit affected versions
13 explicit affected versions
14 explicit affected versions
7 explicit affected versions
19 explicit affected versions
13 explicit affected versions
7 explicit affected versions
10 explicit affected versions
14 explicit affected versions
18 explicit affected versions
3 explicit affected versions
16 explicit affected versions
43 explicit affected versions
24 explicit affected versions
20 explicit affected versions
19 explicit affected versions
11 explicit affected versions
12 explicit affected versions
35 explicit affected versions
12 explicit affected versions
13 explicit affected versions
6 explicit affected versions
12 explicit affected versions
1 explicit affected versions
50 explicit affected versions
11 explicit affected versions
12 explicit affected versions
27 explicit affected versions
12 explicit affected versions
7 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
In the Linux kernel, the following vulnerability has been resolved: ice: Fix improper handling of refcount in ice_sriov_set_msix_vec_count() This patch addresses an issue with improper reference count handling in the ice_sriov_set_msix_vec_count() function. First, the function calls ice_get_vf_by_id(), which increments the reference count of the vf pointer. If the subsequent call to ice_get_vf_vsi() fails, the function currently returns an error without decrementing the reference count of the vf pointer, leading to a reference count leak. The correct behavior, as implemented in this patch, is to decrement the reference count using ice_put_vf(vf) before returning an error when vsi is NULL. Second, the function calls ice_sriov_get_irqs(), which sets vf->first_vector_idx. If this call returns a negative value, indicating an error, the function returns an error without decrementing the reference count of the vf pointer, resulting in another reference count leak. The patch addresses this by adding a call to ice_put_vf(vf) before returning an error when vf->first_vector_idx < 0. This bug was identified by an experimental static analysis tool developed by our team. The tool specializes in analyzing reference count operations and identifying potential mismanagement of reference counts. In this case, the tool flagged the missing decrement operation as a potential issue, leading to this patch.
05 / REFERENCES
Further evidence
- https://git.kernel.org/linus/d517cf89874c6039e6294b18d66f40988e62502a
- https://git.kernel.org/stable/c/416dbb815ca69684de148328990ba0ec53e6dbc1
- https://git.kernel.org/stable/c/d517cf89874c6039e6294b18d66f40988e62502a
- https://ubuntu.com/security/CVE-2024-50020
- https://ubuntu.com/security/notices/USN-7276-1
- https://ubuntu.com/security/notices/USN-7277-1
- https://ubuntu.com/security/notices/USN-7310-1
- https://ubuntu.com/security/notices/USN-7383-1
- https://ubuntu.com/security/notices/USN-7383-2
- https://ubuntu.com/security/notices/USN-7384-1
- https://ubuntu.com/security/notices/USN-7384-2
- https://ubuntu.com/security/notices/USN-7385-1
- https://ubuntu.com/security/notices/USN-7386-1
- https://ubuntu.com/security/notices/USN-7403-1
- https://ubuntu.com/security/notices/USN-7451-1
- https://ubuntu.com/security/notices/USN-7468-1
- https://ubuntu.com/security/notices/USN-7523-1
- https://ubuntu.com/security/notices/USN-7524-1
- https://www.cve.org/CVERecord?id=CVE-2024-50020