lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68c6df3f-f83b-48da-9ee2-351995479915@roeck-us.net>
Date:   Fri, 15 Sep 2023 15:56:29 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Mark Pearson <mpearson-lenovo@...ebb.ca>
Cc:     Guenter Roeck <groeck7@...il.com>,
        David Ober <dober6023@...il.com>, linux-hwmon@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        jdelvare@...e.com, corbet@....net, David Ober <dober@...ovo.com>
Subject: Re: [PATCH] hwmon:Add MEC172x Micro Chip driver for Lenovo
 motherboards

On Fri, Sep 15, 2023 at 06:43:02PM -0400, Mark Pearson wrote:
> Hi Guenter,
> 
> > From: Guenter Roeck <groeck7@...il.com> on behalf of Guenter Roeck 
> > On Fri, Sep 15, 2023 at 11:03:40AM -0400, David Ober wrote:
> >> This addition adds in the ability for the system to scan the
> >> MEC172x EC chip in Lenovo ThinkStation systems to get the
> >> current fan RPM speeds and the Maximum speed value for each
> >> fan also provides the current CPU and DIMM thermal status
> >>
> >> Signed-off-by: David Ober <dober6023@...il.com>
> >>
> >> Written by David Ober from Lenovo using this gmail address since
> >> my corporate email address does not comply with git email
> >
> > FWIW, this needs to be after '---'
> >
> > Anyway, thinking about this submission makes me even more concerned.
> >
> > This isn't really a driver for MEC172x; it is simply a driver
> > accessing an EC on a set of PCs and/or laptops from Lenovo
> > which uses a vertain API for communication between EC and main
> > CPU.
> >
> > Such ECs are typically accessed through ACPI. Yet, in this driver
> > there is no mention of ACPI, much less any protection against
> > parallel use by ACPI code (that access lock in get_ec_reg() doesn't
> > even protect against parallel access from userspace, much less
> > against parallel access from other drivers or ACPI, for example
> > by using request_region() to reserve the used memory ranges).
> >
> > There needs to be explanations and clarifications
> > - Why this driver will only be used for communication with MEC172X
> >   based chips, and why the exact EC chip is relevant in the first place
> >   to be mentioned as much as it is.
> > - How it is guaranteed that the EC is not and will never be accessed
> >   through ACPI.
> > - How it is guaranteed that there will never be any other kernel drivers
> >   accessing the chip.
> >
> I assume for this we just need confirmation from the BIOS team that this is how it will be handled and it's intentional by design?
> 
> Agreed this is normally done by ACPI, but my understanding is that it's not the case on these particular workstation platforms. FWIW Windows is also doing access by a separate driver. 
> I'm not sure why the design is done this way but will confirm to make sure.
> 
> With regards to guaranteeing that no other kernel drivers access the chip - I'm not sure how we can ensure that. Or do you mean if another vendor is using this chip but with different platform IDs and want to use a similar driver? 
> For this case we can make the driver generic (rename it mec172x.c) so others could add their platform support in the future (the platform IDs will be unique). Either that or I can confirm with Microchip if this particular chip is Lenovo specific.

This has nothing to do with the microcontroller you use as EC,
and you can not tell anyone that they must not use the same
microcontroller in their system.

If the chip is not accessed from another driver, you can use
request_region() to reserve the memory space used by the chip.

Guenter



> 
> Let me know if I'm misunderstanding or missing something obvious here. Ack on reserving the region.
> 
> >> ---
> >>  drivers/hwmon/Kconfig             |  10 +
> >>  drivers/hwmon/Makefile            |   1 +
> >>  drivers/hwmon/lenovo-ec-sensors.c | 471 ++++++++++++++++++++++++++++++
> >
> > Documentation missing.
> Ack. I assume under Documentation/hwmon
> 
> Thanks for the review
> Mark

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ