public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/4] Add safe functions for io_uring to LTP library
Date: Fri, 5 Feb 2021 18:06:08 +0100	[thread overview]
Message-ID: <YB17ABVa99GD/vLD@pevik> (raw)
In-Reply-To: <28ce5f25-ee74-adad-ba59-d25e3e72aa1d@suse.cz>

Hi Martin,

> >> +++ b/lib/tst_safe_io_uring.c
> > ...
> >> +	uring->sqr_base = safe_mmap(file, lineno, NULL, uring->sqr_mapsize,
> >> +		PROT_READ | PROT_WRITE, MAP_SHARED | MAP_POPULATE, uring->fd,
> >> +		IORING_OFF_SQ_RING);
> >> +
> >> +	if (uring->sqr_base == MAP_FAILED)
> >> +		return -1;
> > IMHO this is not needed, safe_mmap() breaks on rval == MAP_FAILED.

> Except when called in cleanup() where it prints a warning and returns as
> usual. That's why safe_io_uring_init() returns int instead of void in
> the first place.

> I don't expect that safe_io_uring_init() will be used in cleanup() very
> often but I've made all the other SAFE_*() functions cleanup()-safe and
> I want to stick with that here as well.

Good point, makes sense. Thanks for an explanation.

Kind regards,
Petr

  reply	other threads:[~2021-02-05 17:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 11:03 [LTP] [PATCH v2 1/4] Prevent linker issues in lapi/io_uring.h Martin Doucha
2021-02-04 11:03 ` [LTP] [PATCH v2 2/4] Add safe functions for io_uring to LTP library Martin Doucha
2021-02-05 15:56   ` Petr Vorel
2021-02-05 16:03     ` Martin Doucha
2021-02-05 17:06       ` Petr Vorel [this message]
2021-02-04 11:03 ` [LTP] [PATCH v2 3/4] Add CAP_SYS_CHROOT to lapi/capability.h Martin Doucha
2021-02-04 11:03 ` [LTP] [PATCH v2 4/4] Add test for CVE 2020-29373 Martin Doucha
2021-02-05 16:49   ` Petr Vorel
2021-02-08  9:37     ` Martin Doucha
2021-02-08  9:48       ` Petr Vorel
2021-02-05 16:09 ` [LTP] [PATCH v2 1/4] Prevent linker issues in lapi/io_uring.h Petr Vorel

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=YB17ABVa99GD/vLD@pevik \
    --to=pvorel@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