From: Greg Ungerer Date: Fri, 2 Sep 2005 00:42:52 +0000 (+1000) Subject: [PATCH] uclinux: use MAP_PRIVATE when mmaping code regions in flat binary loader X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=213b24c93b6c43d96973b9db453bf845c97bbe18;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [PATCH] uclinux: use MAP_PRIVATE when mmaping code regions in flat binary loader Use MAP_PRIVATE when calling mmap to get memory for the code region. The flat loader was using MAP_SHARED, but underlying changes to the MMUless mmap means this is now wrong. Signed-off-by: Greg Ungerer Signed-off-by: Linus Torvalds --- diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index c8998dc6688..7974efa107b 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c @@ -520,7 +520,7 @@ static int load_flat_file(struct linux_binprm * bprm, DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n"); down_write(¤t->mm->mmap_sem); - textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, MAP_SHARED, 0); + textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, MAP_PRIVATE, 0); up_write(¤t->mm->mmap_sem); if (!textpos || textpos >= (unsigned long) -4096) { if (!textpos)