linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Is expand_stack buggy wrt locked_vm?
@ 1999-06-01 21:25 Kanoj Sarcar
  0 siblings, 0 replies; only message in thread
From: Kanoj Sarcar @ 1999-06-01 21:25 UTC (permalink / raw)
  To: linux-mm

I think there might be a problem with the way expand_stack
updates locked_vm. 

Assume the kernel is trying to copyout some amount(512b) of 
data into the user's stack, and the underlying pages are not 
yet allocated, and the stack is marked VM_LOCKED. The page 
fault will trigger an expand_stack, which will update the 
locked_vm by an amount depending on where the kernel is trying 
to write out the data. Back in the fault handling code, 
handle_mm_fault will allocate just one page and be done. So,
although the process has incremented its number of locked pages
by 1, expand_stack has updated locked_vm by a possibly bigger
amount.

I think the right fix is for expand_stack to fault in all the
intermediate pages, by something like

	if (vma->vm_flags & VM_LOCKED) {
		make_pages_present(address, old vma->vm_start);
	}

Comments?

Kanoj
kanoj@engr.sgi.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address'
in the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-06-01 21:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-01 21:25 Is expand_stack buggy wrt locked_vm? Kanoj Sarcar

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