[LTP] [PATCH v3] syscalls/mmap04: Validate mapping perms in /proc/self/maps

Petr Vorel pvorel@suse.cz
Mon Oct 9 10:01:31 CEST 2023


Hi Avinesh,

> Validating the various combinations of prot+flags arguments in mmap()
> call and parsing the /proc/self/maps file to verifying resulting mapping
> has the permission bits as requested in mmap() call.

LGTM + you fixed all Cyril's comments.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

...
> +	if (!strcmp(perms, tc->exp_perms))
> +		tst_res(TPASS, "mapping permissions in /proc matched: %s", perms);
> +	else
> +		tst_res(TFAIL, "mapping permissions in /proc mismatched,"
> +						" expected: %s, found: %s",
> +						tc->exp_perms, perms);
Very nit: I wouldn't split the string. IMHO it's better to have easier git
grepping, than follow 80 line rules. Also checkpatch does not complain on this:

	else
		tst_res(TFAIL,
			"mapping permissions in /proc mismatched, expected: %s, found: %s",
			tc->exp_perms, perms);

This can be fixed before merge.

Kind regards,
Petr


More information about the ltp mailing list