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: <e7834fb2-bafe-4738-be9e-d6ad6a3dd32d@gmx.de>
Date: Wed, 6 Nov 2024 04:36:10 +0100
From: Armin Wolf <W_Armin@....de>
To: Mario Limonciello <mario.limonciello@....com>,
 Hans de Goede <hdegoede@...hat.com>,
 Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: "Rafael J . Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
 Maximilian Luz <luzmaximilian@...il.com>, Lee Chun-Yi <jlee@...e.com>,
 Shyam Sundar S K <Shyam-sundar.S-k@....com>,
 Corentin Chary <corentin.chary@...il.com>, "Luke D . Jones"
 <luke@...nes.dev>, Ike Panhc <ike.pan@...onical.com>,
 Henrique de Moraes Holschuh <hmh@....eng.br>,
 Alexis Belmonte <alexbelm48@...il.com>,
 Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
 Ai Chao <aichao@...inos.cn>, Gergo Koteles <soyer@....hu>,
 open list <linux-kernel@...r.kernel.org>,
 "open list:ACPI" <linux-acpi@...r.kernel.org>,
 "open list:MICROSOFT SURFACE PLATFORM PROFILE DRIVER"
 <platform-driver-x86@...r.kernel.org>,
 "open list:THINKPAD ACPI EXTRAS DRIVER"
 <ibm-acpi-devel@...ts.sourceforge.net>,
 Mark Pearson <mpearson-lenovo@...ebb.ca>,
 Matthew Schwartz <matthew.schwartz@...ux.dev>
Subject: Re: [PATCH v4 06/20] ACPI: platform_profile: Move matching string for
 new profile out of mutex

Am 05.11.24 um 16:33 schrieb Mario Limonciello:

> Holding the mutex is not necessary while scanning the string passed into
> platform_profile_store().

Reviewed-by: Armin Wolf <W_Armin@....de>

> Signed-off-by: Mario Limonciello <mario.limonciello@....com>
> ---
>   drivers/acpi/platform_profile.c | 12 +++++-------
>   1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> index 4e8a155589c21..70e7f1ba68676 100644
> --- a/drivers/acpi/platform_profile.c
> +++ b/drivers/acpi/platform_profile.c
> @@ -83,6 +83,11 @@ static ssize_t platform_profile_store(struct device *dev,
>   {
>   	int err, i;
>
> +	/* Scan for a matching profile */
> +	i = sysfs_match_string(profile_names, buf);
> +	if (i < 0)
> +		return -EINVAL;
> +
>   	err = mutex_lock_interruptible(&profile_lock);
>   	if (err)
>   		return err;
> @@ -92,13 +97,6 @@ static ssize_t platform_profile_store(struct device *dev,
>   		return -ENODEV;
>   	}
>
> -	/* Scan for a matching profile */
> -	i = sysfs_match_string(profile_names, buf);
> -	if (i < 0) {
> -		mutex_unlock(&profile_lock);
> -		return -EINVAL;
> -	}
> -
>   	/* Check that platform supports this profile choice */
>   	if (!test_bit(i, cur_profile->choices)) {
>   		mutex_unlock(&profile_lock);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ