lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-f0df4e1acf3d721958dcafb2c9c0bdf25189068d@git.kernel.org>
Date:   Tue, 18 Sep 2018 14:46:13 -0700
From:   tip-bot for Reinette Chatre <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     xiaochen.shen@...el.com, fenghua.yu@...el.com, tony.luck@...el.com,
        mingo@...nel.org, reinette.chatre@...el.com, tglx@...utronix.de,
        hpa@...or.com, linux-kernel@...r.kernel.org, yu.c.chen@...el.com
Subject: [tip:x86/urgent] x86/intel_rdt: Fix incorrect loop end condition

Commit-ID:  f0df4e1acf3d721958dcafb2c9c0bdf25189068d
Gitweb:     https://git.kernel.org/tip/f0df4e1acf3d721958dcafb2c9c0bdf25189068d
Author:     Reinette Chatre <reinette.chatre@...el.com>
AuthorDate: Sat, 15 Sep 2018 14:58:25 -0700
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Tue, 18 Sep 2018 23:38:06 +0200

x86/intel_rdt: Fix incorrect loop end condition

A loop is used to check if a CAT resource's CBM of one CLOSID
overlaps with the CBM of another CLOSID of the same resource. The loop
is run over all CLOSIDs supported by the resource.

The problem with running the loop over all CLOSIDs supported by the
resource is that its number of supported CLOSIDs may be more than the
number of supported CLOSIDs on the system, which is the minimum number of
CLOSIDs supported across all resources.

Fix the loop to only consider the number of system supported CLOSIDs,
not all that are supported by the resource.

Fixes: 49f7b4efa ("x86/intel_rdt: Enable setting of exclusive mode")
Signed-off-by: Reinette Chatre <reinette.chatre@...el.com>
Signed-off-by: Fenghua Yu <fenghua.yu@...el.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: "H Peter Anvin" <hpa@...or.com>
Cc: "Tony Luck" <tony.luck@...el.com>
Cc: "Xiaochen Shen" <xiaochen.shen@...el.com>
Cc: "Chen Yu" <yu.c.chen@...el.com>
Link: https://lkml.kernel.org/r/1537048707-76280-8-git-send-email-fenghua.yu@intel.com

---
 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index 74821bc457c0..afd93d45e21b 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -996,7 +996,7 @@ bool rdtgroup_cbm_overlaps(struct rdt_resource *r, struct rdt_domain *d,
 
 	/* Check for overlap with other resource groups */
 	ctrl = d->ctrl_val;
-	for (i = 0; i < r->num_closid; i++, ctrl++) {
+	for (i = 0; i < closids_supported(); i++, ctrl++) {
 		ctrl_b = (unsigned long *)ctrl;
 		mode = rdtgroup_mode_by_closid(i);
 		if (closid_allocated(i) && i != closid &&

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ