linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Limonciello, Mario" <Mario.Limonciello@dell.com>,
	Divya Bharathi <divya27392@gmail.com>,
	"dvhart@infradead.org" <dvhart@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"platform-driver-x86@vger.kernel.org" 
	<platform-driver-x86@vger.kernel.org>,
	"Bharathi, Divya" <Divya.Bharathi@Dell.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	mark gross <mgross@linux.intel.com>,
	"Ksr, Prasanth" <Prasanth.Ksr@dell.com>
Subject: Re: [PATCH v3] Introduce support for Systems Management Driver over WMI for Dell Systems
Date: Wed, 23 Sep 2020 12:19:34 +0200	[thread overview]
Message-ID: <15cedffb-a0a3-a52a-fb6c-cdb674dc0972@redhat.com> (raw)
In-Reply-To: <DM6PR19MB26361E423C4430923850E1DCFA3A0@DM6PR19MB2636.namprd19.prod.outlook.com>

Hi,

On 9/21/20 8:23 PM, Limonciello, Mario wrote:
>>
>>> +
>>> +		"integer"-type specific properties:
>>> +
>>> +		min_value:	A file that can be read to obtain the lower
>>> +		bound value of the <attr>
>>> +
>>> +		max_value:	A file that can be read to obtain the upper
>>> +		bound value of the <attr>
>>> +
>>> +		scalar_increment:	A file that can be read to obtain the
>>> +		resolution of the incremental value this attribute accepts.
>>> +
>>> +		"string"-type specific properties:
>>> +
>>> +		max_length:	A file that can be read to obtain the maximum
>>> +		length value of the <attr>
>>> +
>>> +		min_length:	A file that can be read to obtain the minimum
>>> +		length value of the <attr>
>>> +
>>> +What:		/sys/devices/platform/dell-wmi-sysman/passwords/
>>> +Date:		December 2020
>>> +KernelVersion:	5.10
>>> +Contact:	Divya Bharathi <Divya.Bharathi@Dell.com>,
>>> +		Mario Limonciello <mario.limonciello@dell.com>,
>>> +		Prasanth KSR <prasanth.ksr@dell.com>
>>> +
>>> +		A BIOS Admin password and System Password can be set, reset or
>>> +		cleared using these attributes. An "Admin" password is used for
>>> +		preventing modification to the BIOS settings. A "System" password
>> is
>>> +		required to boot a machine.
>>> +
>>> +		is_password_set:	A file that can be read
>>> +		to obtain flag to see if a password is set on <attr>
>>> +
>>> +		max_password_length:	A file that can be read to obtain the
>>> +		maximum length of the Password
>>> +
>>> +		min_password_length:	A file that can be read to obtain the
>>> +		minimum length of the Password
>>> +
>>> +		current_password: A write only value used for privileged access
>>> +		such as setting attributes when a system or admin password is set
>>> +		or resetting to a new password
>>> +
>>> +		new_password: A write only value that when used in tandem with
>>> +		current_password will reset a system or admin password.
>>> +
>>> +		Note, password management is session specific. If Admin/System
>>> +		password is set, same password must be writen into current_password
>>> +		file (requied for pasword-validation) and must be cleared once the
>>> +		session	is over. For example,
>>> +			echo "password" > current_password
>>> +			echo "disabled" > TouchScreen/current_value
>>> +			echo "" > current_password
>>
>> So I know this was mentioned before already but one concern I have here
>> is that there is a race where other users with write access to say
>> TouchScreen/current_value
>> may change it between the setting and the clearing of the current_password
>> even if
>> they don't have the password.
> 
> I don't think there is much that can be done here other than move to something atomic
> like sending the password as part of the request.

Right, I'm not saying this scheme is bad per se I just wanted to make
sure that this was brought up and discussed.

> echo "foobar123|enabled" | sudo tee /sys/devices/platform/dell-wmi-sysman/
> 
> That isn't really pretty - and worse you can no longer have a process fetching
> authentication from escrow that is different from your "setter" process.

Note you will likely need some form of IPC, say dbus to your escrow process
anyways to ask it to unlock. So you could just change the "unlock" request
to a "set Camera=Enabled" request and have the process which has access
to the authentication token make the changes itself.

>> This is esp. relevant with containers. I'm not aware about all the intrinsics
>> of
>> sysfs and containers, at a minimum we need to check if it is possible to
>> disallow
>> all writes to the attributes when sysfs is mounted inside a container (so
>> outside of the
>> main filesystem namespace).
> 
> Containers by default mount sysfs as read only unless you use the '--privileged'
> flag.
> 
> https://www.redhat.com/sysadmin/privileged-flag-container-engines

Thanks that is good to know and does address most of my concerns. What I was
wondering about is if we can enforce this in the kernel even for --privileged
containers.  I guess another question would be if we can do that, should we?

Regards,

Hans


  reply	other threads:[~2020-09-23 10:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17  6:55 [PATCH v3] Introduce support for Systems Management Driver over WMI for Dell Systems Divya Bharathi
2020-09-17 12:01 ` kernel test robot
2020-09-21 10:57 ` Hans de Goede
2020-09-21 18:23   ` Limonciello, Mario
2020-09-23 10:19     ` Hans de Goede [this message]
2020-09-21 11:38 ` Hans de Goede
2020-09-21 12:08   ` Andy Shevchenko
2020-09-21 12:08     ` Andy Shevchenko

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=15cedffb-a0a3-a52a-fb6c-cdb674dc0972@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=Divya.Bharathi@Dell.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=Prasanth.Ksr@dell.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=divya27392@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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).