From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] kernel/syscall/setrlimit05.c: use a legal bad address for mips
Date: Mon, 5 Nov 2018 15:51:18 +0800 [thread overview]
Message-ID: <5BDFF676.7020408@cn.fujitsu.com> (raw)
In-Reply-To: <1541403031-141386-1-git-send-email-hongzhi.song@windriver.com>
On 2018/11/05 15:30, Hongzhi.Song wrote:
> This testcase fails on mips32. The process is killed by SIGBUS which
> doesn't return EFAULT as expect.
>
> This is because:
> ((void *)-1) is not a legal bad address which causes the process
> killed by SIGBUG on mips.
>
> 'tst_get_bad_addr()' returns an address that should work on mips
> and other arches.
>
> Signed-off-by: Hongzhi.Song<hongzhi.song@windriver.com>
> ---
> testcases/kernel/syscalls/setrlimit/setrlimit05.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit05.c b/testcases/kernel/syscalls/setrlimit/setrlimit05.c
> index e716722..57b0b82 100644
> --- a/testcases/kernel/syscalls/setrlimit/setrlimit05.c
> +++ b/testcases/kernel/syscalls/setrlimit/setrlimit05.c
> @@ -31,9 +31,13 @@ static void verify_setrlimit(void)
> int status;
> pid_t pid;
>
> + void *bad_addr;
> +
> + bad_addr = tst_get_bad_addr(NULL);
> +
Hi Hongzhi,
Please use tab to do indention instead.
Other than that, it looks good to me.
Best Regards,
Xiao Yang
> pid = SAFE_FORK();
> if (!pid) {
> - TEST(setrlimit(RLIMIT_NOFILE, (void *) -1));
> + TEST(setrlimit(RLIMIT_NOFILE,(struct rlimit *)bad_addr));
> if (TST_RET != -1) {
> tst_res(TFAIL, "setrlimit() succeeded unexpectedly");
> exit(0);
next prev parent reply other threads:[~2018-11-05 7:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 7:30 [LTP] [PATCH] kernel/syscall/setrlimit05.c: use a legal bad address for mips Hongzhi.Song
2018-11-05 7:51 ` Xiao Yang [this message]
2018-11-06 7:07 ` Hongzhi, Song
2018-11-05 15:22 ` Cyril Hrubis
2018-11-06 6:36 ` Hongzhi, Song
2018-11-06 16:05 ` Cyril Hrubis
2018-11-06 2:01 ` Xiao Yang
2018-11-06 6:48 ` Hongzhi, Song
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=5BDFF676.7020408@cn.fujitsu.com \
--to=yangx.jy@cn.fujitsu.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