From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/2] syscalls/setrlimit02.c: Add a test for EFAULT
Date: Tue, 10 Oct 2017 14:55:00 +0200 [thread overview]
Message-ID: <20171010125459.GD4970@rei.lan> (raw)
In-Reply-To: <1507600371-29126-1-git-send-email-yangx.jy@cn.fujitsu.com>
Hi!
> + * DESCRIPTION
> + * 1) Test for EINVAL when resource is invalid.
> + * 2) Test for EFAULT when rlim points outside the accessible address space.
> + * 3) Test for EPERM when an unprivileged process tries to increase the
> + * hard limit.
> */
> #include <pwd.h>
> #include <errno.h>
> @@ -33,6 +37,7 @@ static struct tcase {
> int exp_errno;
> } tcases[] = {
> {-1, &rlim, EINVAL},
> + {RLIMIT_NOFILE, (void *) -1, EFAULT},
> {RLIMIT_NOFILE, &rlim, EPERM}
> };
I've rembered why there is no EFAULT test for the setrlimit:
commit 259db6fed55f88ab32a0875e66803eee44d298be
Author: Cyril Hrubis <chrubis@suse.cz>
Date: Thu Aug 17 13:42:20 2017 +0200
syscalls/setrlimit02: Remove the EFAULT test
...
https://github.com/linux-test-project/ltp/issues/193
So if we really want to add this one, we have to either run the test in
the child and produce PASS on SegFault or call the raw syscall for the
EFAULT test. Either way I think that we should put it in a seprate
testcase if the test is really needed.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2017-10-10 12:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-04 5:51 [LTP] [PATCH 1/2] syscalls/setrlimit02.c: Add a test for EFAULT Xiao Yang
2017-10-04 5:52 ` [LTP] [PATCH 2/2] syscalls/setrlimit03.c: Cleanup && Convert to new API Xiao Yang
2017-10-09 14:23 ` [LTP] [PATCH 1/2] syscalls/setrlimit02.c: Add a test for EFAULT Cyril Hrubis
2017-10-10 1:52 ` [LTP] [PATCH v2 " Xiao Yang
2017-10-10 1:52 ` [LTP] [PATCH v2 2/2] syscalls/setrlimit03.c: Cleanup && Convert to new API Xiao Yang
2017-10-19 5:12 ` Xiao Yang
2017-10-26 8:31 ` Cyril Hrubis
2017-10-10 12:55 ` Cyril Hrubis [this message]
2017-10-11 4:43 ` [LTP] [PATCH v3 1/2] syscalls/setrlimit05.c: Add a test for EFAULT Xiao Yang
2017-10-11 11:46 ` Cyril Hrubis
2017-10-11 12:26 ` [LTP] [PATCH v4 " Xiao Yang
2017-10-12 14:15 ` Cyril Hrubis
2017-10-16 10:30 ` [LTP] [PATCH v5 " Xiao Yang
2017-10-18 15:07 ` 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=20171010125459.GD4970@rei.lan \
--to=chrubis@suse.cz \
--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