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: <aAABOi6OTCidBAeC@kernel.org>
Date: Wed, 16 Apr 2025 22:12:58 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Elena Reshetova <elena.reshetova@...el.com>
Cc: dave.hansen@...el.com, linux-sgx@...r.kernel.org,
	linux-kernel@...r.kernel.org, x86@...nel.org,
	asit.k.mallick@...el.com, vincent.r.scarlata@...el.com,
	chongc@...gle.com, erdemaktas@...gle.com, vannapurve@...gle.com,
	dionnaglaze@...gle.com, bondarn@...gle.com, scott.raynor@...el.com
Subject: Re: [PATCH v3 1/2] x86/sgx: Use sgx_nr_used_pages for EPC page count
 instead of sgx_nr_free_pages

On Wed, Apr 16, 2025 at 09:50:44PM +0300, Jarkko Sakkinen wrote:
> On Tue, Apr 15, 2025 at 02:51:21PM +0300, Elena Reshetova wrote:
> > Note: The serialization for sgx_nr_total_pages is not needed because
> > the variable is only updated during the initialization and there's no
> > concurrent access.
> 
> No. It's
> 
> - not a side-note but core part of the rationale.
> - the reasoning here is nonsense, or more like it does not exist at all.
> 
> sgx_nr_free_pages can be substituted with sgx_nr_used_pages at the sites
> where sgx_free_pages was previously used *exactly* because
> sgx_reclaimer_init() is called only after sgx_page_cache_init(). This
> gives the invariant of it to be constant whenever sgx_alloc_epc_page()
> is called.
> 
> These type of changes give a proof of the legitimity of the invariant,
> which I addressed here.

Let's assume that this patch set had a bug just as a mind game.

If we have a reasoning of the change documented, we will end up having
better tools to reason what we did not consider while acking this patch
set per se.

With convoluted reasoning we have absolutely nothing.

This why what I'm saying is important.

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ