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-634b0e0491d6f6e882b922eb41c278d01a743bab@git.kernel.org>
Date:   Thu, 20 Apr 2017 07:04:27 -0700
From:   tip-bot for Vikas Shivappa <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     vikas.shivappa@...ux.intel.com, linux-kernel@...r.kernel.org,
        sai.praneeth.prakhya@...el.com, mingo@...nel.org,
        tglx@...utronix.de, hpa@...or.com
Subject: [tip:x86/cpu] x86/intel_rdt: Trim whitespace while parsing schemata
 input

Commit-ID:  634b0e0491d6f6e882b922eb41c278d01a743bab
Gitweb:     http://git.kernel.org/tip/634b0e0491d6f6e882b922eb41c278d01a743bab
Author:     Vikas Shivappa <vikas.shivappa@...ux.intel.com>
AuthorDate: Wed, 19 Apr 2017 16:50:03 -0700
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 20 Apr 2017 15:57:59 +0200

x86/intel_rdt: Trim whitespace while parsing schemata input

Schemata is displayed in tabular format which introduces some whitespace
to show data in a tabular format.

Writing back the same data fails as the parser does not handle the
whitespace.

Trim the leading and trailing whitespace before parsing.

Reported-by: Prakhya, Sai Praneeth <sai.praneeth.prakhya@...el.com>
Signed-off-by: Vikas Shivappa <vikas.shivappa@...ux.intel.com>
Tested-by: Prakhya, Sai Praneeth <sai.praneeth.prakhya@...el.com>
Cc: fenghua.yu@...el.com
Cc: tony.luck@...el.com
Cc: ravi.v.shankar@...el.com
Cc: vikas.shivappa@...el.com
Link: http://lkml.kernel.org/r/1492645804-17465-3-git-send-email-vikas.shivappa@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>

---
 arch/x86/kernel/cpu/intel_rdt_schemata.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/intel_rdt_schemata.c b/arch/x86/kernel/cpu/intel_rdt_schemata.c
index 9467a00..e64b2cf 100644
--- a/arch/x86/kernel/cpu/intel_rdt_schemata.c
+++ b/arch/x86/kernel/cpu/intel_rdt_schemata.c
@@ -141,6 +141,7 @@ next:
 	id = strsep(&dom, "=");
 	if (!dom || kstrtoul(id, 10, &dom_id))
 		return -EINVAL;
+	dom = strim(dom);
 	list_for_each_entry(d, &r->domains, list) {
 		if (d->id == dom_id) {
 			if (r->parse_ctrlval(dom, r, d))
@@ -214,7 +215,7 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of,
 			dom->have_new_ctrl = false;
 
 	while ((tok = strsep(&buf, "\n")) != NULL) {
-		resname = strsep(&tok, ":");
+		resname = strim(strsep(&tok, ":"));
 		if (!tok) {
 			ret = -EINVAL;
 			goto out;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ