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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00b87c5f-b4ed-7593-827c-0e1114b8b456@intel.com>
Date:   Tue, 1 Feb 2022 09:45:03 -0800
From:   Dave Hansen <dave.hansen@...el.com>
To:     ira.weiny@...el.com, Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Dan Williams <dan.j.williams@...el.com>
Cc:     Fenghua Yu <fenghua.yu@...el.com>,
        Rick Edgecombe <rick.p.edgecombe@...el.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH V8 19/44] mm/pkeys: PKS Testing, add pks_mk_*() tests

On 1/27/22 09:54, ira.weiny@...el.com wrote:
>  bool pks_test_callback(void)
>  {
> -	return false;
> +	bool armed = (test_armed_key != 0);
> +
> +	if (armed) {
> +		pks_mk_readwrite(test_armed_key);
> +		fault_cnt++;
> +	}
> +
> +	return armed;
> +}

Where's the locking for all this?  I don't think we need anything fancy,
but is there anything preventing the test from being started from
multiple threads at the same time?  I think a simple global test mutex
would probably suffice.

Also, pks_test_callback() needs at least a comment or two about what
it's doing.

Does this work if you have a test armed and then you get an unrelated
PKS fault on another CPU?  I think this will disarm the test from the
unrelated thread.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ