Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1732067 > unrolled thread

[PATCH] intel-wmi-thunderbolt: fix some error cases

Started byMario Limonciello <mario.limonciello@dell.com>
First post2017-09-14 08:50 +0200
Last post2017-09-15 09:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] intel-wmi-thunderbolt: fix some error cases Mario Limonciello <mario.limonciello@dell.com> - 2017-09-14 08:50 +0200
    Re: [PATCH] intel-wmi-thunderbolt: fix some error cases Darren Hart <dvhart@infradead.org> - 2017-09-15 09:40 +0200

#1732067 — [PATCH] intel-wmi-thunderbolt: fix some error cases

FromMario Limonciello <mario.limonciello@dell.com>
Date2017-09-14 08:50 +0200
Subject[PATCH] intel-wmi-thunderbolt: fix some error cases
Message-ID<upw8h-1A4-9@gated-at.bofh.it>
These were raised by Lukas Wunner as potential DOS attacks against
the system log by passing bad data to sysfs.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
 drivers/platform/x86/intel-wmi-thunderbolt.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c b/drivers/platform/x86/intel-wmi-thunderbolt.c
index 32fb6cc..c2257bd 100644
--- a/drivers/platform/x86/intel-wmi-thunderbolt.c
+++ b/drivers/platform/x86/intel-wmi-thunderbolt.c
@@ -41,13 +41,10 @@ static ssize_t force_power_store(struct device *dev,
 	if (mode == 0 || mode == 1) {
 		status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
 					     &input, NULL);
-		if (ACPI_FAILURE(status)) {
-			pr_err("intel-wmi-thunderbolt: failed setting %s\n",
-			       buf);
+		if (ACPI_FAILURE(status))
 			return -ENODEV;
-		}
 	} else {
-		pr_err("intel-wmi-thunderbolt: unsupported mode: %d", mode);
+		return -EINVAL;
 	}
 	return count;
 }
-- 
2.7.4

[toc] | [next] | [standalone]


#1732751

FromDarren Hart <dvhart@infradead.org>
Date2017-09-15 09:40 +0200
Message-ID<upTod-86L-3@gated-at.bofh.it>
In reply to#1732067
On Thu, Sep 14, 2017 at 01:41:55AM -0500, Mario Limonciello wrote:
> These were raised by Lukas Wunner as potential DOS attacks against
> the system log by passing bad data to sysfs.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>

Queued for review/testing with a minor subject change.

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web