[PATCH v3 2/2] tests: add tests for PR_CAP_AMBIENT, PR_CAPBSET_READ, PR_CAPBSET_DROP, PR_[GS]ET_FP_MODE, PR_MCE_KILL, PR_SVE_[GS]ET_VL, PR_[GS]ET_UNALIGN

Dmitry V. Levin ldv at altlinux.org
Sun Jun 6 14:59:43 UTC 2021


On Thu, Jun 03, 2021 at 04:17:54PM -0400, Srikavin Ramkumar wrote:
[...]

Please do not make the first line of commit messages too long.

The first line of the first iteration was fine:
tests: improve test coverage of prctl syscall decoder

All details could be added after the first line.

Alternatively, you can split the commit into several separate commits.

> diff --git a/tests/prctl-fp-mode.test b/tests/prctl-fp-mode.test
> new file mode 100755
> index 000000000..bcd996753
> --- /dev/null
> +++ b/tests/prctl-fp-mode.test
> @@ -0,0 +1,33 @@
> +#!/bin/sh -efu
> +#
> +# Check decoding of prctl PR_GET_FP_MODE/PR_SET_FP_MODE operations.
> +#
> +# Copyright (c) 2021 The strace developers.
> +# All rights reserved.
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +. "${srcdir=.}/scno_tampering.sh"
> +
> +fault_args='-a21 -e trace=prctl -e inject=prctl:'
> +prog="../$NAME"
> +
> +test_run_rval()
> +{
> +	local rval injexpr
> +	rval="$1"; shift
> +	injexpr="$1"; shift
> +
> +	run_strace $fault_args$injexpr $prog $rval > "$EXP"
> +	LC_ALL=C grep -v '^prctl(PR_[GS]ET_[^F][^P][^_][^M][^O][^D][^E]' \
> +		< "$LOG" > "$OUT"

This is not likely to work on mips because mips executables may invoke
prctl(PR_GET_FP_MODE) on their own, see getuid.test and strace commit v5.6~35.

Could we use the same synchronization method as in ioctl-success.sh-based
tests?


-- 
ldv


More information about the Strace-devel mailing list