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]
Date:	Wed, 12 Aug 2009 16:39:17 +0100
From:	Catalin Marinas <catalin.marinas@....com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: kmemleak: Protect the seq start/next/stop sequence by
	rcu_read_lock()

On Wed, 2009-08-12 at 08:32 -0700, Linus Torvalds wrote:
> 
> On Wed, 12 Aug 2009, Catalin Marinas wrote:
> > 
> > If the object size is bigger than a predefined value (4K in this case),
> > release the object lock during scanning and call cond_resched().
> 
> What guarantees that the object isn't released during this?

There is no guarantee but the while() loop rechecks that object->flags
still has the OBJECT_ALLOCATED bit set after every cond_resched():

+               while (start < end && (object->flags & OBJECT_ALLOCATED)) {
+                       scan_block(start, min(start + MAX_SCAN_SIZE, end),
+                                  object, 0);
+                       start += MAX_SCAN_SIZE;
+
+                       spin_unlock_irqrestore(&object->lock, flags);
+                       cond_resched();
+                       spin_lock_irqsave(&object->lock, flags);
+               }

It seems to be working fine with LTP running in parallel with kmemleak
scanning for nearly a day.

-- 
Catalin

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ