[oe-commits] [openembedded-core] 01/08: ltp: fix mmap15 failed on qemumips64

git at git.openembedded.org git at git.openembedded.org
Wed Sep 12 23:28:30 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit cbc026227fb9bafe71665a673104272e191bdef9
Author: Dengke Du <dengke.du at windriver.com>
AuthorDate: Wed Sep 12 16:55:56 2018 +0800

    ltp: fix mmap15 failed on qemumips64
    
    Actually, this is not a bug, mmap15 only run on 64bit system.
    On qemumips64, mmap15 return EINVAL, x86-64 and arm64 return
    ENOMEM. This is because mips system check the addr that passed
    to the syscall mmap15:
    
        https://github.com/torvalds/linux/blob/master/arch/mips/mm/mmap.c#L71
    
    If the addr larger than (TASK_SIZE - page_size), mips think it is invalid.
    
    Signed-off-by: Dengke Du <dengke.du at windriver.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 .../ltp/ltp/0001-mmap15-mips64-return-EINVAL.patch | 41 ++++++++++++++++++++++
 meta/recipes-extended/ltp/ltp_20180515.bb          |  1 +
 2 files changed, 42 insertions(+)

diff --git a/meta/recipes-extended/ltp/ltp/0001-mmap15-mips64-return-EINVAL.patch b/meta/recipes-extended/ltp/ltp/0001-mmap15-mips64-return-EINVAL.patch
new file mode 100644
index 0000000..18eba27
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-mmap15-mips64-return-EINVAL.patch
@@ -0,0 +1,41 @@
+From b909805b4fc1b72e0ce299afb4abc02720ee81da Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du at windriver.com>
+Date: Wed, 12 Sep 2018 14:24:35 +0800
+Subject: [PATCH] mmap15: mips64 return EINVAL
+
+In mips64 kernel, system check the addr that passed to mmap:
+
+    if (TASK_SIZE - len < addr)
+        return -EINVAL;
+
+Link: https://github.com/torvalds/linux/blob/master/arch/mips/mm/mmap.c#L71
+
+Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/394]
+
+Signed-off-by: Dengke Du <dengke.du at windriver.com>
+---
+ testcases/kernel/syscalls/mmap/mmap15.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/testcases/kernel/syscalls/mmap/mmap15.c b/testcases/kernel/syscalls/mmap/mmap15.c
+index eff27d6..a10b5c7 100644
+--- a/testcases/kernel/syscalls/mmap/mmap15.c
++++ b/testcases/kernel/syscalls/mmap/mmap15.c
+@@ -81,9 +81,14 @@ int main(int ac, char **av)
+ 		}
+ 
+ 		if (errno != ENOMEM) {
++#ifdef __mips__
++			tst_resm(TPASS | TERRNO, "mmap into high region "
++                                 "failed as expected");                        
++#else
+ 			tst_resm(TFAIL | TERRNO, "mmap into high region "
+ 				 "failed unexpectedly - expect "
+ 				 "errno=ENOMEM, got");
++#endif
+ 		} else {
+ 			tst_resm(TPASS | TERRNO, "mmap into high region "
+ 				 "failed as expected");
+-- 
+2.7.4
+
diff --git a/meta/recipes-extended/ltp/ltp_20180515.bb b/meta/recipes-extended/ltp/ltp_20180515.bb
index 7c364a6..9cd3489 100644
--- a/meta/recipes-extended/ltp/ltp_20180515.bb
+++ b/meta/recipes-extended/ltp/ltp_20180515.bb
@@ -31,6 +31,7 @@ CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
 SRCREV = "96cbf48313afa65ef4d693d3441cbfd60a8d9b27"
 
 SRC_URI = "git://github.com/linux-test-project/ltp.git \
+           file://0001-mmap15-mips64-return-EINVAL.patch \
            file://0004-build-Add-option-to-select-libc-implementation.patch \
            file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
            file://0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list