forked from microsoft/azurelinux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch irqbalance to fix incorrect balancing behavior (microsoft#6359)
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 2a66a666d3e202dec5b1a4309447e32d5f292871 Mon Sep 17 00:00:00 2001 | ||
From: liuchao173 <[email protected]> | ||
Date: Tue, 24 Aug 2021 20:50:18 +0800 | ||
Subject: [PATCH] fix unsigned integer subtraction sign overflow | ||
|
||
Min_load, adjustment_load and load are unsigned integers, so it overflows when (lb_info->min_load + info->load) < (lb_info->adjustment_load - info->load). The result will be greater than zero. Therefore the irq cannot be selected to rebalanced. | ||
|
||
Signed-off-by: Henry Beberman <[email protected]> | ||
--- | ||
irqlist.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/irqlist.c b/irqlist.c | ||
index 9ab321a..4dd4a83 100644 | ||
--- a/irqlist.c | ||
+++ b/irqlist.c | ||
@@ -97,7 +97,7 @@ static void move_candidate_irqs(struct irq_info *info, void *data) | ||
} | ||
|
||
/* If we can migrate an irq without swapping the imbalance do it. */ | ||
- if ((lb_info->min_load + info->load) - (lb_info->adjustment_load - info->load) < delta_load) { | ||
+ if ((lb_info->min_load + info->load) < delta_load + (lb_info->adjustment_load - info->load)) { | ||
lb_info->adjustment_load -= info->load; | ||
lb_info->min_load += info->load; | ||
if (lb_info->min_load > lb_info->adjustment_load) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
Summary: Irqbalance daemon | ||
Name: irqbalance | ||
Version: 1.8.0 | ||
Release: 3%{?dist} | ||
Release: 4%{?dist} | ||
License: GPLv2 | ||
URL: https://github.com/Irqbalance/irqbalance | ||
Group: System Environment/Services | ||
Vendor: Microsoft Corporation | ||
Distribution: Mariner | ||
Source0: https://github.com/Irqbalance/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz | ||
Patch0: fix-format-security.patch | ||
Patch1: fix-load-unsigned-overflow.patch | ||
BuildRequires: systemd-devel | ||
BuildRequires: glib-devel | ||
Requires: systemd | ||
|
@@ -57,6 +58,9 @@ make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck} | |
%{_datadir}/* | ||
|
||
%changelog | ||
* Fri Oct 06 2023 Henry Beberman <[email protected]> - 1.8.0-4 | ||
- Apply upstream fix for unsigned subtraction overflow in load calculation | ||
|
||
* Wed Sep 20 2023 Jon Slobodzian <[email protected]> - 1.8.0-3 | ||
- Recompile with stack-protection fixed gcc version (CVE-2023-4039) | ||
|
||
|