linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* 2.4.14 + Bug in swap_out.
@ 2001-11-21  6:01 Eric W. Biederman
  2001-11-21  6:29 ` David S. Miller
  2001-11-21 12:13 ` Rik van Riel
  0 siblings, 2 replies; 10+ messages in thread
From: Eric W. Biederman @ 2001-11-21  6:01 UTC (permalink / raw)
  To: Linus Torvalds, linux-mm, linux-kernel

In swap_out we have the following code:

	spin_lock(&mmlist_lock);
	mm = swap_mm;
	while (mm->swap_address == TASK_SIZE || mm == &init_mm) {
		mm->swap_address = 0;
		mm = list_entry(mm->mmlist.next, struct mm_struct, mmlist);
		if (mm == swap_mm)
			goto empty;
		swap_mm = mm;
	}

	/* Make sure the mm doesn't disappear when we drop the lock.. */
	atomic_inc(&mm->mm_users);
	spin_unlock(&mmlist_lock);

	nr_pages = swap_out_mm(mm, nr_pages, &counter, classzone);

	mmput(mm);


And looking in fork.c mmput under with right circumstances becomes.
kmem_cache_free(mm_cachep, (mm)))

So it appears that there is nothing that keeps the mm_struct that
swap_mm points to as being valid. 

I guess the easy fix would be to increment the count on swap_mm,
and then do an mmput we assign something else to the value of swap_mm.  But
I don't know if that is what we want.

Thoughts?

Eric








--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <Pine.LNX.4.21.0111211515210.1357-100000@localhost.localdomain>]
[parent not found: <Pine.LNX.4.21.0111211558160.1394-100000@localhost.localdomain>]

end of thread, other threads:[~2001-11-21 16:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-21  6:01 2.4.14 + Bug in swap_out Eric W. Biederman
2001-11-21  6:29 ` David S. Miller
2001-11-21  6:37   ` Eric W. Biederman
2001-11-21 12:17     ` Rik van Riel
2001-11-21 13:31       ` Eric W. Biederman
2001-11-21 14:20         ` Rik van Riel
2001-11-21 14:21           ` Eric W. Biederman
2001-11-21 12:13 ` Rik van Riel
     [not found] <Pine.LNX.4.21.0111211515210.1357-100000@localhost.localdomain>
2001-11-21 15:39 ` Rik van Riel
     [not found] <Pine.LNX.4.21.0111211558160.1394-100000@localhost.localdomain>
2001-11-21 16:26 ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox