From: cdong <chuang.dong@windriver.com>
To: <Openembedded-core@lists.openembedded.org>
Subject: ltp: vma03 fix the alginment of page size
Date: Wed, 3 Jun 2015 16:06:00 +0800 [thread overview]
Message-ID: <556EB568.30901@windriver.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 437 bytes --]
Hi,
This patch fix a vma03 bug,the info below detail it:
the offset which is parameter of mmap2() function doesn't align the
page size,but,this parameter is allowed multiple of the page size
as returned by sysconf(_SC_PAGE_SIZE),meanwhile offset * 4096 must be
a multiple of the system page size,so modify the input parameter
pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
Regards
Chuang
[-- Attachment #2: 0001-ltp-vma03-fix-the-alginment-of-page-size.patch --]
[-- Type: text/x-patch, Size: 3044 bytes --]
From 1685976a18cf9b4d255434731336a820578c7647 Mon Sep 17 00:00:00 2001
From: Chuang Dong <chuang.dong@windriver.com>
Date: Wed, 3 Jun 2015 15:53:30 +0800
Subject: [PATCH] ltp: vma03 fix the alginment of page size
the offset which is parameter of mmap2() function doesn't align the
page size,but,this parameter is allowed multiple of the page size
as returned by sysconf(_SC_PAGE_SIZE),meanwhile offset * 4096 must be
a multiple of the system page size,so modify the input parameter
pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
Upstream-Status: Submitted
Signed-off-by: Chuang Dong <chuang.dong@windriver.com>
---
...-ltp-vma03-fix-the-alginment-of-page-size.patch | 32 ++++++++++++++++++++++
meta/recipes-extended/ltp/ltp_20150119.bb | 1 +
2 files changed, 33 insertions(+)
create mode 100644 meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch
diff --git a/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch b/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch
new file mode 100644
index 0000000..0e5678d
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch
@@ -0,0 +1,32 @@
+From dd53725b162707bd09db0dce5ae141c997042fa6 Mon Sep 17 00:00:00 2001
+From: Chuang Dong <chuang.dong@windriver.com>
+Date: Wed, 3 Jun 2015 15:44:35 +0800
+Subject: [PATCH] ltp: vma03 fix the alginment of page size
+
+the offset which is parameter of mmap2() function doesn't align the
+page size,but,this parameter is allowed multiple of the page size
+as returned by sysconf(_SC_PAGE_SIZE),meanwhile offset * 4096 must be
+a multiple of the system page size,so modify the input parameter
+pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
+
+Signed-off-by: Chuang Dong <chuang.dong@windriver.com>
+---
+ testcases/kernel/mem/vma/vma03.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/mem/vma/vma03.c b/testcases/kernel/mem/vma/vma03.c
+index 270097b..72ac470 100644
+--- a/testcases/kernel/mem/vma/vma03.c
++++ b/testcases/kernel/mem/vma/vma03.c
+@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
+ if (fd == -1)
+ tst_brkm(TBROK | TERRNO, NULL, "open %s", TESTFILE);
+
+- pgoff = ULONG_MAX - 1;
++ pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
+ map = mmap2(NULL, pgsz, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+ fd, pgoff);
+ if (map == MAP_FAILED)
+--
+1.9.1
+
diff --git a/meta/recipes-extended/ltp/ltp_20150119.bb b/meta/recipes-extended/ltp/ltp_20150119.bb
index 90c5973..9c5c762 100644
--- a/meta/recipes-extended/ltp/ltp_20150119.bb
+++ b/meta/recipes-extended/ltp/ltp_20150119.bb
@@ -28,6 +28,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
file://make-setregid02-work.patch \
file://add-knob-for-numa.patch \
file://add-knob-for-tirpc.patch \
+ file://0001-ltp-vma03-fix-the-alginment-of-page-size.patch \
"
S = "${WORKDIR}/git"
--
1.9.1
next reply other threads:[~2015-06-03 8:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 8:06 cdong [this message]
2015-06-26 6:39 ` ltp: vma03 fix the alginment of page size Robert Yang
2015-06-30 9:09 ` wenzong fan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=556EB568.30901@windriver.com \
--to=chuang.dong@windriver.com \
--cc=Openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox