Commit bb39de6
committed
Merge: CVE-2024-53088: i40e: fix race condition by adding filter's intermediate sync state
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5832
JIRA: https://issues.redhat.com/browse/RHEL-68274
CVE: CVE-2024-53088
```
i40e: fix race condition by adding filter's intermediate sync state
Fix a race condition in the i40e driver that leads to MAC/VLAN filters
becoming corrupted and leaking. Address the issue that occurs under
heavy load when multiple threads are concurrently modifying MAC/VLAN
filters by setting mac and port VLAN.
1. Thread T0 allocates a filter in i40e_add_filter() within
i40e_ndo_set_vf_port_vlan().
2. Thread T1 concurrently frees the filter in __i40e_del_filter() within
i40e_ndo_set_vf_mac().
3. Subsequently, i40e_service_task() calls i40e_sync_vsi_filters(), which
refers to the already freed filter memory, causing corruption.
Reproduction steps:
1. Spawn multiple VFs.
2. Apply a concurrent heavy load by running parallel operations to change
MAC addresses on the VFs and change port VLANs on the host.
3. Observe errors in dmesg:
"Error I40E_AQ_RC_ENOSPC adding RX filters on VF XX,
please set promiscuous on manually for VF XX".
Exact code for stable reproduction Intel can't open-source now.
The fix involves implementing a new intermediate filter state,
I40E_FILTER_NEW_SYNC, for the time when a filter is on a tmp_add_list.
These filters cannot be deleted from the hash list directly but
must be removed using the full process.
Fixes: 278e7d0 ("i40e: store MAC/VLAN filters in a hash with the MAC Address as key")
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Reviewed-by: Michal Schmidt <mschmidt@redhat.com>
Tested-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
(cherry picked from commit f30490e)
```
Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
---
<small>Created 2024-11-19 21:36 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: Michal Schmidt <mschmidt@redhat.com>
Approved-by: Kamal Heib <kheib@redhat.com>
Approved-by: Corinna Vinschen <vinschen@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>
Merged-by: Patrick Talbert <ptalbert@redhat.com>File tree
3 files changed
+12
-2
lines changed- drivers/net/ethernet/intel/i40e
3 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
| 760 | + | |
760 | 761 | | |
761 | 762 | | |
762 | 763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1255 | 1255 | | |
1256 | 1256 | | |
1257 | 1257 | | |
| 1258 | + | |
1258 | 1259 | | |
1259 | 1260 | | |
1260 | 1261 | | |
| |||
1441 | 1442 | | |
1442 | 1443 | | |
1443 | 1444 | | |
| 1445 | + | |
| 1446 | + | |
1444 | 1447 | | |
1445 | 1448 | | |
1446 | 1449 | | |
| |||
1550 | 1553 | | |
1551 | 1554 | | |
1552 | 1555 | | |
| 1556 | + | |
| 1557 | + | |
1553 | 1558 | | |
1554 | 1559 | | |
1555 | 1560 | | |
| |||
2437 | 2442 | | |
2438 | 2443 | | |
2439 | 2444 | | |
2440 | | - | |
| 2445 | + | |
| 2446 | + | |
2441 | 2447 | | |
2442 | 2448 | | |
2443 | 2449 | | |
| |||
2611 | 2617 | | |
2612 | 2618 | | |
2613 | 2619 | | |
| 2620 | + | |
2614 | 2621 | | |
2615 | 2622 | | |
2616 | 2623 | | |
| |||
2762 | 2769 | | |
2763 | 2770 | | |
2764 | 2771 | | |
2765 | | - | |
| 2772 | + | |
| 2773 | + | |
2766 | 2774 | | |
2767 | 2775 | | |
2768 | 2776 | | |
| |||
0 commit comments