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: <5961c2655b49a7d384140c33d6897e53f89cb5fe.camel@intel.com>
Date: Thu, 22 Jan 2026 20:56:56 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "tianwentong2000@...il.com" <tianwentong2000@...il.com>,
	"jarkko@...nel.org" <jarkko@...nel.org>, "dave.hansen@...ux.intel.com"
	<dave.hansen@...ux.intel.com>
CC: "linux-sgx@...r.kernel.org" <linux-sgx@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>, "mingo@...hat.com"
	<mingo@...hat.com>, "tglx@...nel.org" <tglx@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "bp@...en8.de"
	<bp@...en8.de>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v2] x86/sgx: use vm_flags_t for vm_prot_bits

On Thu, 2026-01-22 at 21:36 +0800, Wentong Tian wrote:
> The vm_flags_t type is the dedicated type for virtual memory flags.
> Architecture and driver code should use this type instead of assuming
> vm_flags is an unsigned long, as the underlying type may change in the
> future.
> 
> This follows the cleanup in commit d75fa3c94750 ("mm: update
> architecture and driver code to use vm_flags_t") by converting the
> remaining vm_prot_bits usage in SGX code. Also, update the vm_max_prot_bits
> type in struct sgx_encl_page to vm_flags_t for consistency.
> 
> No functional change intended.
> 
> Signed-off-by: Wentong Tian <tianwentong2000@...il.com>
> ---
> v2:
>  - Also convert the type of vm_max_prot_bits in struct sgx_encl_page
>    to vm_flags_t, as suggested.

Hmm I was actually just pointing out, but not suggesting, since I am not
sure (honestly).

Back to technical:

Gcc doc says:

  A structure field declaration with an integer type can specify the 
  number of bits the field should occupy. We call that a bit field.

With vm_flags_t I think "theoretically" it could stop being integer type
someday.  But I guess the advantage is when someone does that that can
trigger build error here (so that we can be aware) which perhaps isn't a
bad thing?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ