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, 4 Feb 2009 13:57:45 +0900
From:	MinChan Kim <minchan.kim@...il.com>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux mm <linux-mm@...ck.org>,
	linux kernel <linux-kernel@...r.kernel.org>,
	Nick Piggin <npiggin@...e.de>, Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH v2] fix mlocked page counter mistmatch

On Wed, Feb 04, 2009 at 11:51:43AM +0900, KOSAKI Motohiro wrote:
> > > Could you please teach me why this issue doesn't happend on munlockall()?
> > > your scenario seems to don't depend on exit_mmap().
> > 
> > 
> > Good question.
> > It's a different issue.
> > It is related to mmap_sem locking issue. 
> > 
> > Actually, I am about to make a patch.
> > But, I can't understand that Why try_do_mlock_page should downgrade mm_sem ?
> > Is it necessary ? 
> > 
> > In munlockall path, mmap_sem already is holding in write-mode of mmap_sem.
> > so, try_to_mlock_page always fail to downgrade mmap_sem.
> > It's why it looks like working well about mlocked counter. 
> 
> lastest linus tree don't have downgrade mmap_sem.
> (recently it was removed)

Thnaks for information.

what is 'latest linus tree' ?
You mean '29-rc3-git5'?


With '29-rc3-git5', I found,

static int try_to_mlock_page(struct page *page, struct vm_area_struct *vma)
{
  int mlocked = 0; 

  if (down_read_trylock(&vma->vm_mm->mmap_sem)) {
    if (vma->vm_flags & VM_LOCKED) {
      mlock_vma_page(page);
      mlocked++;  /* really mlocked the page */
    }    
    up_read(&vma->vm_mm->mmap_sem);
  }
  return mlocked;
}

It still try to downgrade mmap_sem.
Do I miss something ?

> 
> please see it.
> 

-- 
Kinds Regards
MinChan Kim

--
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