public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 11/11] Add landlock06 test
Date: Thu, 11 Jul 2024 10:45:20 +0200	[thread overview]
Message-ID: <20240711084520.GA35371@pevik> (raw)
In-Reply-To: <20240710-landlock-v2-11-ff79db017d57@suse.com>

Hi Andrea,

...
> +static void run(void)
> +{
> +	if (!SAFE_FORK()) {
> +		int flag;
> +		size_t sz = 0;
> +
> +		TST_EXP_PASS(ioctl(file_fd, FIONREAD, &sz));
> +
> +		/* check unrestrictable commands */
> +		TST_EXP_PASS(ioctl(dev_fd, FIOCLEX));
> +		TST_EXP_PASS(ioctl(dev_fd, FIONCLEX));
> +		TST_EXP_PASS(ioctl(dev_fd, FIONBIO, &flag));
> +		TST_EXP_PASS(ioctl(dev_fd, FIOASYNC, &flag));
> +
> +		_exit(0);
> +	}
nit: I would avoid indentation with return:

	if (SAFE_FORK())
		return;

	int flag;
	size_t sz = 0;

	TST_EXP_PASS(ioctl(file_fd, FIONREAD, &sz));

	/* check unrestrictable commands */
	TST_EXP_PASS(ioctl(dev_fd, FIOCLEX));
	TST_EXP_PASS(ioctl(dev_fd, FIONCLEX));
	TST_EXP_PASS(ioctl(dev_fd, FIONBIO, &flag));
	TST_EXP_PASS(ioctl(dev_fd, FIOASYNC, &flag));

	_exit(0);

(minor detail, I can change it during merge)

...
> +	.format_device = 1,
> +	.mount_device = 1,
> +	.mntpoint = MNTPOINT,
> +	.all_filesystems = 1,
> +	.skip_filesystems = (const char *[]) {
> +		"vfat",
Unfortunately also exfat needs to be skipped (can be done during merge).
> +		NULL

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Thanks!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2024-07-11  8:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 18:01 [LTP] [PATCH v2 00/11] landlock testing suite Andrea Cervesato
2024-07-10 18:01 ` [LTP] [PATCH v2 01/11] Add landlock syscalls definitions Andrea Cervesato
2024-07-11  1:16   ` Li Wang
2024-07-10 18:01 ` [LTP] [PATCH v2 02/11] Add lapi/landlock.h fallback Andrea Cervesato
2024-07-11  1:30   ` Li Wang
2024-07-10 18:01 ` [LTP] [PATCH v2 03/11] Added three more SAFE_* macros for landlock sandbox: Andrea Cervesato
2024-07-11  3:47   ` Li Wang
2024-07-10 18:01 ` [LTP] [PATCH v2 04/11] Add SAFE_PRCTL macro Andrea Cervesato
2024-07-10 18:02 ` [LTP] [PATCH v2 05/11] Add landlock01 test Andrea Cervesato
2024-07-11  3:16   ` Li Wang
2024-07-11  7:06     ` Andrea Cervesato via ltp
2024-07-11  7:30       ` Li Wang
2024-07-10 18:02 ` [LTP] [PATCH v2 06/11] Add landlock02 test Andrea Cervesato
2024-07-10 18:02 ` [LTP] [PATCH v2 07/11] Add landlock03 test Andrea Cervesato
2024-07-10 18:02 ` [LTP] [PATCH v2 08/11] Add CAP_MKNOD fallback in lapi/capability.h Andrea Cervesato
2024-07-11  3:49   ` Li Wang
2024-07-10 18:02 ` [LTP] [PATCH v2 09/11] Add landlock04 test Andrea Cervesato
2024-07-11  9:33   ` Li Wang
2024-07-11 10:33     ` Andrea Cervesato via ltp
2024-07-11 11:01       ` Cyril Hrubis
2024-07-11 11:14         ` Li Wang
2024-07-10 18:02 ` [LTP] [PATCH v2 10/11] Add landlock05 test Andrea Cervesato
2024-07-10 18:02 ` [LTP] [PATCH v2 11/11] Add landlock06 test Andrea Cervesato
2024-07-11  8:45   ` Petr Vorel [this message]

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=20240711084520.GA35371@pevik \
    --to=pvorel@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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