From: "Pali Rohár" <pali.rohar@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "Jean Delvare" <jdelvare@suse.com>,
Mario_Limonciello@dell.com,
"Gabriele Mazzotta" <gabriele.mzt@gmail.com>,
"Michał Kępień" <kernel@kempniu.pl>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: dell-smm-hwmon: security problems
Date: Wed, 8 Jun 2016 15:55:48 +0200 [thread overview]
Message-ID: <201606081555.48907@pali> (raw)
In-Reply-To: <57581C7A.30308@roeck-us.net>
[-- Attachment #1: Type: Text/Plain, Size: 2423 bytes --]
On Wednesday 08 June 2016 15:24:10 Guenter Roeck wrote:
> On 06/08/2016 02:57 AM, Pali Rohár wrote:
> > Hello!
> >
> > Mario wrote me about two I think security problems in
> > dell-smm-hwmon driver and I would like to ask you, how to fix
> > them.
> >
> > 1) File /proc/i8k (exists only when kernel is compiled with
> > CONFIG_I8K) exports DMI_PRODUCT_SERIAL and it can be read by
> > ordinary user, without root permission. Normally
> > DMI_PRODUCT_SERIAL can be read from sysfs file
> > /sys/class/dmi/id/product_serial but only by root user.
> >
> > 2) Via /proc/i8k ordinary user can set fan speed. This is because
> > how "restricted" parameter and variable works. Setting fan speed
> > by normal non-root user can be dangerous, e.g. malicious
> > application under user "nobody" could take control of fans.
> >
> > Do you have idea how to fix these problems? Just to note that
> > /proc/i8k has stable kernel ABI and changing it will break all
> > existing i8k* applications. But /proc/i8k is there only for old
> > legacy laptops (year 2000).
> >
> > There is module parameter "restricted" with default value false and
> > description: "Allow fan control if SYS_ADMIN capability set".
> > Current code do:
> >
> > case I8K_SET_FAN:
> > if (restricted && !capable(CAP_SYS_ADMIN))
> > return -EPERM;
> >
> > For me description is a bit ambiguous. What about setting
> > "restricted" by default to true and updating description to
> > something like this?
> >
> > "Disallow fan control when SYS_ADMIN capability is not set
> > (default: 1)"
>
> Sure. I am sure that someone will complain (we learned just recently
> that people still use the old commands, after all), but then the old
> behavior can be restored by setting the flag to 0.
Either setting that flag to 0 or running that tool under root or with
capability CAP_SYS_ADMIN.
> I would not use a double negative to describe it. Why not just
> something like "Allow fan control only if SYS_ADMIN capability set
> (default 1)" ?
I was thinking about that description too, but there is problem with
meaning too...
0 means fan control is allowed for any user
1 means fan control is allowed only for CAP_SYS_ADMIN
Description should be unambiguous for situation when flag is set to 0.
===
And do you have idea what to do with problem 1)?
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2016-06-08 13:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-08 9:57 dell-smm-hwmon: security problems Pali Rohár
2016-06-08 13:24 ` Guenter Roeck
2016-06-08 13:55 ` Pali Rohár [this message]
2016-06-08 17:37 ` Guenter Roeck
2016-06-08 17:54 ` Austin S. Hemmelgarn
2016-06-08 18:10 ` Pali Rohár
2016-06-08 18:10 ` Pali Rohár
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201606081555.48907@pali \
--to=pali.rohar@gmail.com \
--cc=Mario_Limonciello@dell.com \
--cc=gabriele.mzt@gmail.com \
--cc=jdelvare@suse.com \
--cc=kernel@kempniu.pl \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).