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: <20061006154058.4190075f.akpm@osdl.org>
Date:	Fri, 6 Oct 2006 15:40:58 -0700
From:	Andrew Morton <akpm@...l.org>
To:	Trond Myklebust <Trond.Myklebust@...app.com>
Cc:	Steve Dickson <SteveD@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] VM: Fix the gfp_mask in invalidate_complete_page2

On Fri, 06 Oct 2006 18:19:27 -0400
Trond Myklebust <Trond.Myklebust@...app.com> wrote:

> On Fri, 2006-10-06 at 18:16 -0400, Trond Myklebust wrote:
> > Yeah using mapping_gfp_mask(mapping) sounds like a better option.
> 
> Revised patch is attached...

Well, it wasn't attached, but I can simulate it.

invalidate_complete_page() wants to be called from inside spinlocks by
drop_pagecache(), so if we wanted to pull the same trick there we'd need to
pass a new flag into invalidate_inode_pages().

It's not 100% clear what the gfp_t _means_ in the try_to_release_page()
context.  Callees will rarely want to allocate memory (true?).  So it
conveys two concepts: 

a) can sleep. (__GFP_WAIT).  That's fairly straightforward

b) can take fs locks (__GFP_FS).  This is less clear.  By passing down
   __GFP_FS we're telling the callee that it's OK to take i_mutex, even
   lock_page().  That sounds pretty unsafe in this context, particularly
   the latter, as we're already holding a page lock.

So perhaps the safer and more appropriate solution here is to pass in a
bare __GFP_WAIT.

-
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