lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 9 May 2018 13:24:58 -0500
From:   Daniel Díaz <daniel.diaz@...aro.org>
To:     Jeffrin Jose T <ahiliation@...oo.co.in>, shuah@...nel.org,
        kstewart@...uxfoundation.org, pombredanne@...b.com,
        gregkh@...uxfoundation.org, thomas@...3r.de
Cc:     linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jeffrin Jose T <jeffrin@...agiritech.edu.in>
Subject: Re: [PATCH] selftests: intel_pstate: Fix a condition which does not
 notify user that root permission is useful

Hello!


On 05/09/2018 12:38 PM, Jeffrin Jose T wrote:
> aperf program uses /dev/cpu which is normally a root only
> access area. so in that case to successfully run thet test,
> root permissions are required.This patch is in the file run.sh.
> 
> Signed-off-by: Jeffrin Jose T <jeffrin@...agiritech.edu.in>
> ---
>  tools/testing/selftests/intel_pstate/run.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
> index 23a2e4e9880e..05d35392dcfd 100755
> --- a/tools/testing/selftests/intel_pstate/run.sh
> +++ b/tools/testing/selftests/intel_pstate/run.sh
> @@ -31,6 +31,14 @@
>  
>  EVALUATE_ONLY=0
>  
> +uid=$(id -u)
> +if [ $uid -ne 0 ]; then
> +    echo     "-----------------------"
> +    echo $msg please run this as root >&2
> +    echo     "-----------------------"
> +    exit 0
> +fi
> +

Other tests simply use $UID. See:
  cpufreq/main.sh
  cpu-hotplug/cpu-on-off-test.sh
  efivarfs/efivarfs.sh
  gpio/gpio-mockup.sh
  memory-hotplug/mem-on-off-test.sh

This doesn't take into account the conditions for EVALUATE_ONLY: When
it's set non-zero, neither aperf nor cpupower run at all.

While this is under review, you might want to base your change on
Shuah's patch for skipping:

https://lists.linaro.org/pipermail/linux-kselftest-mirror/2018-May/001074.html


>  if ! uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ | grep -q x86; then
>  	echo "$0 # Skipped: Test can only run on x86 architectures."
>  	exit 0

I'd leave this check at the forefront, as this "hurdle" is
insurmountable in other architectures, whereas becoming root is attainable.

Thanks and greetings!

Daniel Díaz
daniel.diaz@...aro.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ