mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Armin Wolf <W_Armin@gmx.de>
Cc: "Barnabás Pőcze" <pobrn@protonmail.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Mark Gross" <markgross@kernel.org>
Subject: Re: [PATCH v1 1/2] platform/x86: wmi: Break possible infinite loop when parsing GUID
Date: Thu, 22 Jun 2023 11:43:20 +0300	[thread overview]
Message-ID: <ZJQJqHbZy+00qhsz@smile.fi.intel.com> (raw)
In-Reply-To: <b4dc2571-1163-805a-f92b-30dcc8b69246@gmx.de>

On Wed, Jun 21, 2023 at 11:50:51PM +0200, Armin Wolf wrote:
> Am 21.06.23 um 23:29 schrieb Barnabás Pőcze:
> > 2023. június 21., szerda 23:20 keltezéssel, Armin Wolf <W_Armin@gmx.de> írta:

[...]

> > > > -		if (WARN_ON(guid_parse(id->guid_string, &driver_guid)))
> > > 
> > > just an idea: how about printing an error/debug message in case of an
> > > malformed GUID?  This could be useful when searching for typos in GUIDs
> > > used by WMI drivers.

[...]

> > Wouldn't it be better to change `__wmi_driver_register()` to check that?
> 
> Good point, i guess we can just forget this idea. The original motivation for
> it was the WARN_ON() inside wmi_dev_match(), but your right that this is the
> wrong place to check the GUID formating.

I'm not sure what do you want me to do since patches are tested already.

I think that WARN_ON() is a bit bogus. First of all, it can be easily
transformed to BUG()-equivalent with panic_on_oops and hence kill the
entire system. If we need the message about wrong GUID format, it should
be done elsewhere (modpost ?). I.o.w. we shan't expect that code,
controlled by us, shoots to our foot.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-06-22  8:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 15:11 Andy Shevchenko
2023-06-21 15:11 ` [PATCH v1 2/2] platform/x86: wmi: Replace open coded guid_parse_and_compare() Andy Shevchenko
2023-06-21 21:21   ` Armin Wolf
2023-06-21 21:20 ` [PATCH v1 1/2] platform/x86: wmi: Break possible infinite loop when parsing GUID Armin Wolf
2023-06-21 21:29   ` Barnabás Pőcze
2023-06-21 21:50     ` Armin Wolf
2023-06-22  8:43       ` Andy Shevchenko [this message]
2023-06-22 15:00         ` Andy Shevchenko
2023-07-04 11:02           ` Hans de Goede
2023-07-06 10:49             ` Andy Shevchenko
2023-06-22  8:44   ` Andy Shevchenko
2023-07-11  9:36 ` Hans de Goede

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=ZJQJqHbZy+00qhsz@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

all inboxes | Powered by JetHome®