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-next>] [day] [month] [year] [list]
Date:	Mon,  1 Jun 2015 15:00:01 +0200
From:	Michal Hocko <mhocko@...e.cz>
To:	<linux-mm@...ck.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Dave Chinner <david@...morbit.com>, Neil Brown <neilb@...e.de>,
	Johannes Weiner <hannes@...xchg.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	Mel Gorman <mgorman@...e.de>, Rik van Riel <riel@...hat.com>,
	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-fsdevel@...r.kernel.org
Subject: [RFC 0/2] mapping_gfp_mask from the page fault path

Hi,
I somehow forgot about these patches. The previous version was
posted here: http://marc.info/?l=linux-mm&m=142668784122763&w=2. The
first attempt was broken but even when fixed it seems like ignoring
mapping_gfp_mask in page_cache_read is too fragile because
filesystems might use locks in their filemap_fault handlers
which could trigger recursion problems as pointed out by Dave
http://marc.info/?l=linux-mm&m=142682332032293&w=2.

The first patch should be straightforward fix to obey mapping_gfp_mask
when allocating for mapping. It can be applied even without the second
one.

The second patch is an attempt to handle mapping_gfp_mask from the
page fault path properly. GFP_IOFS should be safe from he page fault
path in general (we would be quite broken otherwise because there
are places where GFP_KERNEL is used - e.g. pte allocation). MM will
communicate this to the fs layer via struct vm_fault::gfp_mask.
If fs needs to change this allocation context in a fs callback it can
overwrite this mask. If the code flow gets back to MM we will obey this
gfp_mask (e.g. in page_cache_read). This should be more appropriate than
following mapping_gfp_mask blindly. See the patch description for more
details.

I am still not sure this is the right way to go so I am sending this as
an RFC so any comments are highly appreciated.

Thanks!

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