From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 6/11 v2] mmap/mmap12: Testcase failed for non-root user
Date: Tue, 3 Nov 2015 03:24:57 -0500 (EST) [thread overview]
Message-ID: <547742230.1412756.1446539097815.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <563869D2.2060607@huawei.com>
----- Original Message -----
> From: "Cui Bixuan" <cuibixuan@huawei.com>
> To: "Cyril Hrubis" <chrubis@suse.cz>
> Cc: "Jan Stancek" <jstancek@redhat.com>, zhuyanpeng@huawei.com, zhanyongming@huawei.com, ltp@lists.linux.it
> Sent: Tuesday, 3 November, 2015 9:01:22 AM
> Subject: [LTP] [PATCH 6/11 v2] mmap/mmap12: Testcase failed for non-root user
>
> Unprivileged user open /proc/self/pagemap fail so add check for it
>
> Signed-off-by: Cui Bixuan <cuibixuan@huawei.com>
Pushed with more verbose commit message and small changes to style.
Regards,
Jan
> ---
> testcases/kernel/syscalls/mmap/mmap12.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/mmap/mmap12.c
> b/testcases/kernel/syscalls/mmap/mmap12.c
> index ba8c646..ebc44ae 100644
> --- a/testcases/kernel/syscalls/mmap/mmap12.c
> +++ b/testcases/kernel/syscalls/mmap/mmap12.c
> @@ -108,8 +108,14 @@ static int page_check(void)
> index = (vmstart / page_sz) * sizeof(uint64_t);
>
> pm = open("/proc/self/pagemap", O_RDONLY);
> - if (pm == -1)
> - tst_brkm(TFAIL | TERRNO, NULL, "Open dev pagemap failed");
> + if (pm == -1) {
> + if ((0 != geteuid()) && (errno == EPERM))
> + tst_brkm(TCONF | TERRNO, NULL,
> + "don't have permission to open dev pagemap");
> + else
> + tst_brkm(TFAIL | TERRNO, NULL,
> + "Open dev pagemap failed");
> + }
>
> offset = lseek(pm, index, SEEK_SET);
> if (offset != index)
> --
> 1.6.0.2
>
next prev parent reply other threads:[~2015-11-03 8:24 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 3:11 [LTP] [PATCH 1/11] bind/bind02: Testcase failed when no root user run it Cui Bixuan
2015-10-28 3:11 ` [LTP] [PATCH 2/11] capset/capset02: " Cui Bixuan
2015-10-28 3:11 ` [LTP] [PATCH 3/11] chroot/chroot04: " Cui Bixuan
2015-10-28 3:11 ` [LTP] [PATCH 4/11] execve/execve03: " Cui Bixuan
2015-10-28 3:11 ` [LTP] [PATCH 5/11] syscalls/fcntl: Testcases " Cui Bixuan
2015-10-28 3:11 ` [LTP] [PATCH 6/11] mmap/mmap12: Testcase " Cui Bixuan
2015-10-29 11:57 ` Cyril Hrubis
2015-10-30 8:56 ` Cui Bixuan
2015-10-30 9:29 ` Jan Stancek
2015-10-31 0:54 ` Cui Bixuan
2015-10-31 8:15 ` Jan Stancek
2015-11-02 11:54 ` Cyril Hrubis
2015-11-03 8:01 ` [LTP] [PATCH 6/11 v2] mmap/mmap12: Testcase failed for non-root user Cui Bixuan
2015-11-03 8:24 ` Jan Stancek [this message]
2015-11-03 8:45 ` Cui Bixuan
2015-10-30 9:19 ` [LTP] [PATCH 6/11] mmap/mmap12: Testcase failed when no root user run it Cui Bixuan
2015-10-28 3:11 ` [LTP] [PATCH 7/11] mq_open/mq_open01: " Cui Bixuan
2015-10-28 3:11 ` [LTP] [PATCH 8/11] ipc/msgctl: Testcases " Cui Bixuan
2015-10-28 3:11 ` [LTP] [PATCH 9/11] ipc/semctl: " Cui Bixuan
2015-10-29 12:45 ` Cyril Hrubis
2015-10-28 3:11 ` [LTP] [PATCH 10/11] ipc/shmctl: Testcase " Cui Bixuan
2015-10-28 7:12 ` Zeng Linggang
2015-10-28 7:31 ` [LTP] [PATCH 10/11 v2] " Cui Bixuan
2015-10-28 7:33 ` [LTP] [PATCH 10/11] " Cui Bixuan
2015-10-29 12:46 ` Cyril Hrubis
2015-10-28 3:11 ` [LTP] [PATCH 11/11] unshare/unshare01: " Cui Bixuan
2015-10-29 12:52 ` Cyril Hrubis
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=547742230.1412756.1446539097815.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ltp@lists.linux.it \
/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