linux-stable/fs/romfs
Greg Ungerer e4ba4fc2b9 romfs: fix nommu map length to keep inside filesystem
Checks introduced in commit 4991e7251 ("romfs: do not use
mtd->get_unmapped_area directly") re-introduce problems fixed in the earlier
commit 2b4b2482e ("romfs: fix romfs_get_unmapped_area() argument check").

If a flat binary app is located at the end of a romfs, its page aligned
length may be outside of the romfs filesystem. The flat binary loader, via
nommu do_mmap_pgoff(), page aligns the length it is mmaping. So simple
offset+size checks will fail - returning EINVAL.

We can truncate the length to keep it inside the romfs filesystem, and that
also keeps the call to mtd_get_unmapped_area() happy.

Are there any side effects to truncating the size here though?

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
2013-04-29 09:17:57 +10:00
..
internal.h ROMFS: romfs_lookup() shouldn't be doing a partial name comparison 2009-04-24 13:28:31 -07:00
Kconfig NOMMU: Fix the RomFS Kconfig to ensure at least one backing store is selected 2009-03-24 09:02:39 +00:00
Makefile NOMMU: Make it possible for RomFS to use MTD devices directly 2009-03-24 09:01:32 +00:00
mmap-nommu.c romfs: fix nommu map length to keep inside filesystem 2013-04-29 09:17:57 +10:00
storage.c romfs: switch to new MTD API 2012-03-27 00:19:30 +01:00
super.c fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00