Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1425826
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number |
| Date | 2016-06-18 22:10 +0200 |
| Message-ID | <rLuJ3-kK-3@gated-at.bofh.it> (permalink) |
| References | <rLaU1-4aG-3@gated-at.bofh.it> <rLaU1-4aG-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 06/17/2016 03:54 PM, Pali Rohár wrote:
> ABI of I8K_BIOS_VERSION ioctl can return only number. But new BIOS versions
> contain also other characters, which does not fit into that ABI. So in case
> of non digit values return -EINVAL.
>
> Reported-by: Mario Limonciello <Mario_Limonciello@dell.com>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Applied.
Guenter
> ---
> drivers/hwmon/dell-smm-hwmon.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
> index c43318d..480b2fa 100644
> --- a/drivers/hwmon/dell-smm-hwmon.c
> +++ b/drivers/hwmon/dell-smm-hwmon.c
> @@ -35,6 +35,7 @@
> #include <linux/uaccess.h>
> #include <linux/io.h>
> #include <linux/sched.h>
> +#include <linux/ctype.h>
>
> #include <linux/i8k.h>
>
> @@ -387,6 +388,10 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
>
> switch (cmd) {
> case I8K_BIOS_VERSION:
> + if (!isdigit(bios_version[0]) || !isdigit(bios_version[1]) ||
> + !isdigit(bios_version[2]))
> + return -EINVAL;
> +
> val = (bios_version[0] << 16) |
> (bios_version[1] << 8) | bios_version[2];
> break;
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6] dell-smm-hwmon fixes Pali Rohár <pali.rohar@gmail.com> - 2016-06-18 01:00 +0200
[PATCH 5/6] hwmon: (dell-smm) Detect fan with index=2 Pali Rohár <pali.rohar@gmail.com> - 2016-06-18 01:00 +0200
Re: [PATCH 5/6] hwmon: (dell-smm) Detect fan with index=2 Tolga Cakir <cevelnet@gmail.com> - 2016-06-19 02:10 +0200
[PATCH 4/6] hwmon: (dell-smm) Cache fan_type() calls and change fan detection Pali Rohár <pali.rohar@gmail.com> - 2016-06-18 01:00 +0200
Re: [PATCH 4/6] hwmon: (dell-smm) Cache fan_type() calls and change fan detection Tolga Cakir <cevelnet@gmail.com> - 2016-06-19 02:10 +0200
[PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number Pali Rohár <pali.rohar@gmail.com> - 2016-06-18 01:00 +0200
Re: [PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number Guenter Roeck <linux@roeck-us.net> - 2016-06-18 22:10 +0200
[PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines Pali Rohár <pali.rohar@gmail.com> - 2016-06-18 01:00 +0200
Re: [PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines Guenter Roeck <linux@roeck-us.net> - 2016-06-18 22:10 +0200
Re: [PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines Pali Rohár <pali.rohar@gmail.com> - 2016-06-19 00:50 +0200
[PATCH 2/6] hwmon: (dell-smm) Restrict fan control and serial number to CAP_SYS_ADMIN by default Pali Rohár <pali.rohar@gmail.com> - 2016-06-18 01:00 +0200
Re: [PATCH 2/6] hwmon: (dell-smm) Restrict fan control and serial number to CAP_SYS_ADMIN by default Guenter Roeck <linux@roeck-us.net> - 2016-06-18 22:10 +0200
[PATCH 6/6] hwmon: (dell-smm) In debug mode log duration of SMM calls Pali Rohár <pali.rohar@gmail.com> - 2016-06-18 01:00 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár <pali.rohar@gmail.com> - 2016-06-18 14:30 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Guenter Roeck <linux@roeck-us.net> - 2016-06-18 17:20 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár <pali.rohar@gmail.com> - 2016-06-18 17:30 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Guenter Roeck <linux@roeck-us.net> - 2016-06-18 19:00 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár <pali.rohar@gmail.com> - 2016-06-19 00:40 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár <pali.rohar@gmail.com> - 2016-06-20 11:20 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Guenter Roeck <linux@roeck-us.net> - 2016-06-20 15:30 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár <pali.rohar@gmail.com> - 2016-06-23 14:20 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Guenter Roeck <linux@roeck-us.net> - 2016-06-23 16:00 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár <pali.rohar@gmail.com> - 2016-06-19 00:50 +0200
Re: [PATCH 0/6] dell-smm-hwmon fixes Michał Kępień <kernel@kempniu.pl> - 2016-06-22 10:10 +0200
csiph-web