Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Jake Freeland <jfree@freebsd.org>,
	Petri Latvala <petri.latvala@intel.com>,
	Jake Freeland <jake@technologyfriends.net>
Subject: Re: [igt-dev] [PATCH i-g-t] lib/tests/igt_fork.c: Fix error in mmap() flags
Date: Fri, 7 Oct 2022 21:08:09 +0200	[thread overview]
Message-ID: <Y0B5GS3uCf3+ltXT@kamilkon-desk1> (raw)
In-Reply-To: <20221007145241.44592-1-jfree@freebsd.org>

Hi Jake,

On 2022-10-07 at 09:52:41 -0500, Jake Freeland wrote:
> In subtest_leak(), mmap() is called with the flag PROT_WRITE,
> but no PROT_READ. Later in the function, the mapped memory is
> read using `children[i]`. In FreeBSD, the lack of PROT_READ
> causes SIGSEGV. Adding the PROT_READ flag to the mmap() call
> fixes this.
> 
> Signed-off-by: Jake Freeland <jfree@freebsd.org>

Please note that when you got r-b (review-by) and you do just
resend with no modifications to your patch, you can add r-b
tag to this one patch which got r-b and send it. It will save
time for other people.

Please also read e-mails from CI when it says there was a
failure and if that is unrelated, replay with cc: to Lakshmi
Lakshminarayana Vudum <lakshminarayana.vudum@intel.com> 
and ask for adding exception and rescan.

Regards,
Kamil

Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> ---
>  lib/tests/igt_fork.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/tests/igt_fork.c b/lib/tests/igt_fork.c
> index d19d0945..d883aba4 100644
> --- a/lib/tests/igt_fork.c
> +++ b/lib/tests/igt_fork.c
> @@ -109,7 +109,7 @@ __noreturn static void igt_fork_timeout_leak(void)
>  __noreturn static void subtest_leak(void)
>  {
>  	pid_t *children =
> -		mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
> +		mmap(0, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
>  	const int num_children = 4096 / sizeof(*children);
>  
>  	igt_subtest_init(fake_argc, fake_argv);
> -- 
> 2.37.0 (Apple Git-136)
> 

  parent reply	other threads:[~2022-10-07 19:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-07 14:52 [igt-dev] [PATCH i-g-t] lib/tests/igt_fork.c: Fix error in mmap() flags Jake Freeland
2022-10-07 15:04 ` Ville Syrjälä
2022-10-07 15:44   ` Ville Syrjälä
2022-10-07 15:35 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2022-10-07 19:10   ` Kamil Konieczny
2022-10-09 16:28     ` Vudum, Lakshminarayana
2022-10-07 19:08 ` Kamil Konieczny [this message]
2022-10-07 20:18   ` [igt-dev] [PATCH i-g-t] " Jake Freeland
2022-10-09 16:08 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2022-10-09 16:18 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2022-10-09 17:42 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=Y0B5GS3uCf3+ltXT@kamilkon-desk1 \
    --to=kamil.konieczny@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jake@technologyfriends.net \
    --cc=jfree@freebsd.org \
    --cc=petri.latvala@intel.com \
    /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