From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Barnabás Pőcze" <pobrn@protonmail.com>
Cc: linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org,
Mark Gross <markgross@kernel.org>,
Hans de Goede <hdegoede@redhat.com>, Armin Wolf <W_Armin@gmx.de>
Subject: Re: [RFC PATCH v1] platform/x86: wmi: Do not register driver with invalid GUID
Date: Thu, 20 Jul 2023 11:36:29 +0300 [thread overview]
Message-ID: <ZLjyDQ80QKWtKqUk@smile.fi.intel.com> (raw)
In-Reply-To: <kN5iBK5RwAEr8LXNTgb6dUk7zxuGFFtF2q_ReNezksLqaq7C4frYfo6ELswUu0wVoewy3UENAwFjjK48d2qBwf6q4is8ST28zpK6-ze_eIU=@protonmail.com>
On Wed, Jul 19, 2023 at 07:23:37PM +0000, Barnabás Pőcze wrote:
> 2023. július 17., hétfő 13:31 keltezéssel, Andy Shevchenko írta:
> > On Mon, Jul 17, 2023 at 11:23:50AM +0000, Barnabás Pőcze wrote:
> > > 2023. július 17., hétfő 11:49 keltezéssel, Andy Shevchenko <andriy.shevchenko@linux.intel.com> írta:
> > > On Sat, Jul 15, 2023 at 09:24:16PM +0000, Barnabás Pőcze wrote:
...
> > > > Besides using wrong API (uuid_*() vs. guid_*() one), I don't
> > >
> > > As far as I can see `guid_parse()` also uses `uuid_is_valid()`, the format is the same.
> >
> > Then add guid_is_valid() to complete the API. Perhaps with the renaming the
> > common part to something else.
>
> But that would be the exact same function. GUIDs are UUIDs, aren't they?
Yes and no. If we want to validate the respective bit for GUID vs. UUID, they
will be different. Currently they are the same as validation is relaxed in the
kernel.
> > > > think we need to validate it here. Why not in file2alias.c?
> > > > [...]
> > >
> > > 1) that seems like a more complicated change (duplicating `uuid_is_valid()`?);
> > > 2) that will only check the GUIDs specified by `MODULE_DEVICE_TABLE()`.
> > >
> > > Arguably the second point is not that significant since most users will indeed
> > > use `MODULE_DEVICE_TABLE()`. But I think the first point has some merit. And
> > > furthermore, I think this check should be here regardless of whether file2alias.c
> > > also contains an equivalent/similar check.
> >
> > Why do we need it? We never match against wrong GUID from ACPI, since it would
> > be very weird ACPI table.
> > [...]
>
> The point is to catch typos in drivers' WMI ID tables.
Yes, that's what file2alias is for. We trust modules we build, right?
If you don't trust, then we have much bigger problem than this patch
tries to address.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-07-20 8:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-15 21:24 [RFC PATCH v1] platform/x86: wmi: Do not register driver with invalid GUID Barnabás Pőcze
2023-07-17 9:49 ` Andy Shevchenko
2023-07-17 11:23 ` Barnabás Pőcze
2023-07-17 11:31 ` Andy Shevchenko
2023-07-19 19:23 ` Barnabás Pőcze
2023-07-20 8:36 ` Andy Shevchenko [this message]
2023-07-20 10:42 ` Barnabás Pőcze
2023-07-21 9:17 ` Andy Shevchenko
2023-07-26 8:45 ` Hans de Goede
2023-07-27 22:54 ` Barnabás Pőcze
2023-07-28 10:02 ` Andy Shevchenko
2023-07-28 14:39 ` Barnabás Pőcze
2023-07-31 19:52 ` 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=ZLjyDQ80QKWtKqUk@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=W_Armin@gmx.de \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=pobrn@protonmail.com \
/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