sched: sch_cake: add bounds checks to host bulk flow fairness counts
Even though we fixed a logic error in the commit cited below, syzbot
still managed to trigger an underflow of the per-host bulk flow
counters, leading to an out of bounds memory access.
To avoid any such logic errors causing out of bounds memory accesses,
this commit factors out all accesses to the per-host bulk flow counters
to a series of helpers that perform bounds-checking before any
increments and decrements. This also has the benefit of improving
readability by moving the conditional checks for the flow mode into
these helpers, instead of having them spread out throughout the
code (which was the cause of the original logic error).
As part of this change, the flow quantum calculation is consolidated
into a helper function, which means that the dithering applied to the
ost load scaling is now applied both in the DRR rotation and when a
sparse flow's quantum is first initiated. The only user-visible effect
of this is that the maximum packet size that can be sent while a flow
stays sparse will now vary with +/- one byte in some cases. This should
not make a noticeable difference in practice, and thus it's not worth
complicating the code to preserve the old behaviour.
Metrics
Affected Vendors & Products
| Source | ID | Title | 
|---|---|---|
  Debian DLA | 
                DLA-4076-1 | linux-6.1 security update | 
  Debian DLA | 
                DLA-4178-1 | linux security update | 
  EUVD | 
                EUVD-2025-2596 | In the Linux kernel, the following vulnerability has been resolved: sched: sch_cake: add bounds checks to host bulk flow fairness counts Even though we fixed a logic error in the commit cited below, syzbot still managed to trigger an underflow of the per-host bulk flow counters, leading to an out of bounds memory access. To avoid any such logic errors causing out of bounds memory accesses, this commit factors out all accesses to the per-host bulk flow counters to a series of helpers that perform bounds-checking before any increments and decrements. This also has the benefit of improving readability by moving the conditional checks for the flow mode into these helpers, instead of having them spread out throughout the code (which was the cause of the original logic error). As part of this change, the flow quantum calculation is consolidated into a helper function, which means that the dithering applied to the ost load scaling is now applied both in the DRR rotation and when a sparse flow's quantum is first initiated. The only user-visible effect of this is that the maximum packet size that can be sent while a flow stays sparse will now vary with +/- one byte in some cases. This should not make a noticeable difference in practice, and thus it's not worth complicating the code to preserve the old behaviour. | 
  Ubuntu USN | 
                USN-7379-1 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7379-2 | Linux kernel (Raspberry Pi) vulnerabilities | 
  Ubuntu USN | 
                USN-7380-1 | Linux kernel (Low Latency) vulnerabilities | 
  Ubuntu USN | 
                USN-7381-1 | Linux kernel (Low Latency) vulnerabilities | 
  Ubuntu USN | 
                USN-7382-1 | Linux kernel (OEM) vulnerabilities | 
  Ubuntu USN | 
                USN-7510-1 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7510-2 | Linux kernel (FIPS) vulnerabilities | 
  Ubuntu USN | 
                USN-7510-3 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7510-4 | Linux kernel (Real-time) vulnerabilities | 
  Ubuntu USN | 
                USN-7510-5 | Linux kernel (Azure FIPS) vulnerabilities | 
  Ubuntu USN | 
                USN-7510-6 | Linux kernel (AWS FIPS) vulnerabilities | 
  Ubuntu USN | 
                USN-7510-7 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7510-8 | Linux kernel (AWS) vulnerabilities | 
  Ubuntu USN | 
                USN-7511-1 | Linux kernel (GCP) vulnerabilities | 
  Ubuntu USN | 
                USN-7511-2 | Linux kernel (GCP FIPS) vulnerabilities | 
  Ubuntu USN | 
                USN-7511-3 | Linux kernel (GKE) vulnerabilities | 
  Ubuntu USN | 
                USN-7512-1 | Linux kernel (GCP) vulnerabilities | 
  Ubuntu USN | 
                USN-7513-1 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7513-2 | Linux kernel (Real-time) vulnerabilities | 
  Ubuntu USN | 
                USN-7513-3 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7513-4 | Linux kernel (HWE) vulnerabilities | 
  Ubuntu USN | 
                USN-7513-5 | Linux kernel (Oracle) vulnerabilities | 
  Ubuntu USN | 
                USN-7514-1 | Linux kernel (NVIDIA) vulnerabilities | 
  Ubuntu USN | 
                USN-7515-1 | Linux kernel (GKE) vulnerabilities | 
  Ubuntu USN | 
                USN-7515-2 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7516-1 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7516-2 | Linux kernel (GCP FIPS) vulnerabilities | 
  Ubuntu USN | 
                USN-7516-3 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7516-4 | Linux kernel (Oracle) vulnerabilities | 
  Ubuntu USN | 
                USN-7516-5 | Linux kernel (HWE) vulnerabilities | 
  Ubuntu USN | 
                USN-7516-6 | Linux kernel (IBM) vulnerabilities | 
  Ubuntu USN | 
                USN-7516-7 | Linux kernel (AWS) vulnerabilities | 
  Ubuntu USN | 
                USN-7516-8 | Linux kernel (FIPS) vulnerabilities | 
  Ubuntu USN | 
                USN-7516-9 | Linux kernel (AWS) vulnerabilities | 
  Ubuntu USN | 
                USN-7517-1 | Linux kernel (Xilinx ZynqMP) vulnerabilities | 
  Ubuntu USN | 
                USN-7517-2 | Linux kernel (IBM) vulnerabilities | 
  Ubuntu USN | 
                USN-7517-3 | Linux kernel (BlueField) vulnerabilities | 
  Ubuntu USN | 
                USN-7518-1 | Linux kernel (Azure FIPS) vulnerabilities | 
  Ubuntu USN | 
                USN-7522-1 | Linux kernel (Azure, N-Series) vulnerabilities | 
  Ubuntu USN | 
                USN-7523-1 | Linux kernel (Raspberry Pi Real-time) vulnerabilities | 
  Ubuntu USN | 
                USN-7524-1 | Linux kernel (Raspberry Pi) vulnerabilities | 
  Ubuntu USN | 
                USN-7539-1 | Linux kernel (Raspberry Pi) vulnerabilities | 
  Ubuntu USN | 
                USN-7540-1 | Linux kernel (Raspberry Pi) vulnerabilities | 
  Ubuntu USN | 
                USN-7593-1 | Linux kernel (HWE) vulnerabilities | 
  Ubuntu USN | 
                USN-7602-1 | Linux kernel (Xilinx ZynqMP) vulnerabilities | 
  Ubuntu USN | 
                USN-7640-1 | Linux kernel (IoT) vulnerabilities | 
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
Mon, 03 Nov 2025 21:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References | 
         | 
Mon, 03 Nov 2025 20:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References | 
         | 
Fri, 26 Sep 2025 20:00:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| First Time appeared | 
        
        Linux
         Linux linux Kernel  | 
|
| CPEs | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.11:-:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.11:rc7:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc3:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc4:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc5:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc6:*:*:*:*:*:*  | 
|
| Vendors & Products | 
        
        Linux
         Linux linux Kernel  | 
Thu, 13 Mar 2025 12:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References | 
         | 
Thu, 13 Feb 2025 01:00:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| Weaknesses | CWE-125 | |
| Metrics | 
        
        
        cvssV3_1
         
 
  | 
    
        
        
        cvssV3_1
         
 
  | 
Tue, 21 Jan 2025 03:15:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References | 
         | |
| Metrics | 
        
        
        threat_severity
         
  | 
    
        
        cvssV3_1
         
 
  | 
Sun, 19 Jan 2025 10:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| Description | In the Linux kernel, the following vulnerability has been resolved: sched: sch_cake: add bounds checks to host bulk flow fairness counts Even though we fixed a logic error in the commit cited below, syzbot still managed to trigger an underflow of the per-host bulk flow counters, leading to an out of bounds memory access. To avoid any such logic errors causing out of bounds memory accesses, this commit factors out all accesses to the per-host bulk flow counters to a series of helpers that perform bounds-checking before any increments and decrements. This also has the benefit of improving readability by moving the conditional checks for the flow mode into these helpers, instead of having them spread out throughout the code (which was the cause of the original logic error). As part of this change, the flow quantum calculation is consolidated into a helper function, which means that the dithering applied to the ost load scaling is now applied both in the DRR rotation and when a sparse flow's quantum is first initiated. The only user-visible effect of this is that the maximum packet size that can be sent while a flow stays sparse will now vary with +/- one byte in some cases. This should not make a noticeable difference in practice, and thus it's not worth complicating the code to preserve the old behaviour. | |
| Title | sched: sch_cake: add bounds checks to host bulk flow fairness counts | |
| References | 
         | 
Status: PUBLISHED
Assigner: Linux
Published:
Updated: 2025-11-03T20:58:27.786Z
Reserved: 2024-12-29T08:45:45.728Z
Link: CVE-2025-21647
No data.
Status : Modified
Published: 2025-01-19T11:15:10.307
Modified: 2025-11-03T21:19:00.843
Link: CVE-2025-21647
                        OpenCVE Enrichment
                    No data.
 Debian DLA
 EUVD
 Ubuntu USN