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: <ZHYoj7NHKVIpUceK@kernkonzept.com>
Date:   Tue, 30 May 2023 18:47:11 +0200
From:   Stephan Gerhold <stephan.gerhold@...nkonzept.com>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
        Stephen Boyd <sboyd@...nel.org>, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] opp: Fix use-after-free in lazy_opp_tables after probe
 deferral

On Tue, May 30, 2023 at 02:43:30PM +0530, Viresh Kumar wrote:
> On 30-05-23, 10:31, Stephan Gerhold wrote:
> > Thanks, this seems to fix the crash as well. Are you going to handle it
> > or should I send a v2 with this diff?
> 
> Please send a V2 :)
> 

Done!

> > During _allocate_opp_table() it's accessed without the opp_table_lock,
> > because of
> > 
> > 	/* Drop the lock to reduce the size of critical section */
> > 	mutex_unlock(&opp_table_lock);
> > 
> > 	if (opp_table) {
> > 		/* ... */
> > 		mutex_lock(&opp_table_lock);
> > 	} else {
> > 		opp_table = _allocate_opp_table(dev, index);
> > 
> > 		mutex_lock(&opp_table_lock);
> > 		/* ... */
> > 	}
> > 
> > This doesn't seem to cause any problems in my case though so it's
> > unrelated to the crash I observed.
> 
> Hmm, right. Maybe we need a lock for that list, want to take that up ?
> 

Yeah, a lock would probably be good to be safe. I would appreciate if
you or someone else could create a patch for this though, since I'm not
too familiar with the overall OPP implementation. I would be happy to
test that it works properly for my apparently quite special use case
(I have several OPP tables with interconnects and required-opps).

Thanks!
Stephan
-- 
Kernkonzept GmbH at Dresden, Germany, HRB 31129, CEO Dr.-Ing. Michael Hohmuth

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ