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: <c51a7a9e-5d37-4c30-b1e5-c873cfb64cd5@roeck-us.net>
Date: Tue, 3 Sep 2024 18:28:24 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: SeongJae Park <sj@...nel.org>, "Liam R. Howlett" <Liam.Howlett@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
 "Matthew Wilcox (Oracle)" <willy@...radead.org>,
 David Hildenbrand <david@...hat.com>,
 Brendan Higgins <brendanhiggins@...gle.com>, David Gow
 <davidgow@...gle.com>, damon@...ts.linux.dev, linux-mm@...ck.org,
 kunit-dev@...glegroups.com, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/damon/tests/vaddr-kunit: don't use mas_lock for
 MM_MT_FLAGS-initialized maple tree

On 9/3/24 17:58, SeongJae Park wrote:
> On Tue, 3 Sep 2024 20:48:53 -0400 "Liam R. Howlett" <Liam.Howlett@...cle.com> wrote:
> 
>> * SeongJae Park <sj@...nel.org> [240903 20:45]:
>>> damon_test_three_regions_in_vmas() initializes a maple tree with
>>> MM_MT_FLAGS.  The flags contains MT_FLAGS_LOCK_EXTERN, which means
>>> mt_lock of the maple tree will not be used.  And therefore the maple
>>> tree initialization code skips initialization of the mt_lock.  However,
>>> __link_vmas(), which adds vmas for test to the maple tree, uses the
>>> mt_lock.  In other words, the uninitialized spinlock is used.  The
>>> problem becomes celar when spinlock debugging is turned on, since it

Just in case you need to resend: s/celar/clear/

>>> reports spinlock bad magic bug.  Fix the issue by not using the mt_lock
>>> as promised.
>>
>> You can't do this, lockdep will tell you this is wrong.
> 
> Hmm, but lockdep was silence on my setup?
> 
>> We need a lock and to use the lock for writes.
> 
> This code is executed by a single-thread test code.  Do we still need the lock?
> 
>>
>> I'd suggest using different flags so the spinlock is used.
> 
> The reporter mentioned simply dropping MT_FLAGS_LOCK_EXTERN from the flags
> causes suspicious RCU usage message.  May I ask if you have a suggestion of
> better flags?
> 

Correct. I don't see those messages with your patch. From my perspective, this is

Tested-by: Guenter Roeck <linux@...ck-us.net>

Thanks,
Guenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ