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] [day] [month] [year] [list]
Message-ID: <5f593905-b829-03bd-7a6a-160dea55ed46@linux.intel.com>
Date: Thu, 18 Jul 2024 11:17:01 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Hans de Goede <hdegoede@...hat.com>
cc: Gergo Koteles <soyer@....hu>, Ike Panhc <ike.pan@...onical.com>, 
    platform-driver-x86@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 4/4] platform/x86: ideapad-laptop: add a mutex to
 synchronize VPC commands

On Thu, 18 Jul 2024, Hans de Goede wrote:

> Hi,
> 
> On 7/18/24 10:06 AM, Ilpo Järvinen wrote:
> > On Thu, 18 Jul 2024, Gergo Koteles wrote:
> > 
> >> Calling VPC commands consists of several VPCW and VPCR ACPI calls.
> >> These calls and their results can get mixed up if they are called
> >> simultaneously from different threads, like acpi notify handler,
> >> sysfs, debugfs, notification chain.
> >>
> >> Add a mutex to synchronize VPC commands.
> >>
> >> Signed-off-by: Gergo Koteles <soyer@....hu>
> >> ---
> > 
> >> @@ -2027,6 +2053,8 @@ static int ideapad_acpi_add(struct platform_device *pdev)
> >>  	priv->adev = adev;
> >>  	priv->platform_device = pdev;
> >>  
> >> +	mutex_init(&priv->vpc_mutex);
> >> +
> >>  	ideapad_check_features(priv);
> >>  
> >>  	err = ideapad_sysfs_init(priv);
> > 
> > mutex_destroy() missing from rollback and ideapad_acpi_remove().
> 
> Right, note the easiest way to fix this is to use the new devm_mutex_init()
> instead of plain mutex_init() that will also take care of destroying the mutex
> on any exit-on-error cases from probe().

Right, of course. I though one existed but it seems I tried to grep for 
dev_mutex_init() while searching for it... :-/

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ