summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch
new file mode 100644
index 00000000..dc75f169
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch
@@ -0,0 +1,43 @@
1From d94e9fcf553861cd10a1780c6aeaa6a4419ba5ce Mon Sep 17 00:00:00 2001
2From: Henrik Rydberg <rydberg@euromail.se>
3Date: Thu, 7 Jun 2012 04:54:29 -0400
4Subject: [PATCH 06/46] hwmon: (applesmc) Limit key length in warning messages
5
6commit ac852edb47b15900886ba2564eeeb13b3b526e3e upstream.
7
8Key lookups may call read_smc() with a fixed-length key string,
9and if the lookup fails, trailing stack content may appear in the
10kernel log. Fixed with this patch.
11
12Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
13Signed-off-by: Guenter Roeck <linux@roeck-us.net>
14Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
15---
16 drivers/hwmon/applesmc.c | 4 ++--
17 1 file changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
20index 4c07436..d99aa84 100644
21--- a/drivers/hwmon/applesmc.c
22+++ b/drivers/hwmon/applesmc.c
23@@ -215,7 +215,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len)
24 int i;
25
26 if (send_command(cmd) || send_argument(key)) {
27- pr_warn("%s: read arg fail\n", key);
28+ pr_warn("%.4s: read arg fail\n", key);
29 return -EIO;
30 }
31
32@@ -223,7 +223,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len)
33
34 for (i = 0; i < len; i++) {
35 if (__wait_status(0x05)) {
36- pr_warn("%s: read data fail\n", key);
37+ pr_warn("%.4s: read data fail\n", key);
38 return -EIO;
39 }
40 buffer[i] = inb(APPLESMC_DATA_PORT);
41--
421.7.10
43