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] [day] [month] [year] [list]
Message-ID: <h46ki6cfmrflbw4fhebsb646cpzba6iqq6cozq4prveqhowdtj@ifwsk64zo73k>
Date: Thu, 20 Mar 2025 11:38:46 +0200
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Nikolay Borisov <nik.borisov@...e.com>
Cc: dave.hansen@...ux.intel.com, linux-coco@...ts.linux.dev, 
	x86@...nel.org, linux-kernel@...r.kernel.org, vannapurve@...gle.com, 
	Elena Reshetova <elena.reshetova@...el.com>
Subject: Re: [RFC PATCH] /dev/mem: Disable /dev/mem under TDX guest

On Tue, Mar 18, 2025 at 04:21:21PM +0200, Nikolay Borisov wrote:
> 
> 
> On 18.03.25 г. 15:27 ч., Kirill A. Shutemov wrote:
> > On Tue, Mar 18, 2025 at 02:53:34PM +0200, Nikolay Borisov wrote:
> > > > I think we need to think wider. What about applying a subset of LOCKDOWN_*
> > > > in all coco guests by default. Many of them are relevant for the guest security.
> > > 
> > > How do you envision this to work, by introducing another
> > > CONFIG_LOCK_DOWN_KERNEL_FORCE_COCO or some such ? Will it be opt-in or
> > > mandatory?
> > 
> > I think cc_platform_has(CC_ATTR_xxx) should enabled some subset of
> > LOCKDOWN_*. No need in new config options.
> 
> Care to suggest which ones should be included? The way lockdown works at the
> moment is that it only supports 2 levels (check lock_kernel_down() and
> lockdown_is_locked_down()) at which you can lockdown - INTEGRITY_MAX and
> CONFIDENTIALITY_MAX,  where each level includes everything below it. So by
> choosing integrity max you get:
> 
>     19         LOCKDOWN_MODULE_SIGNATURE,
> 
>     18         LOCKDOWN_DEV_MEM,
> 
>     17         LOCKDOWN_EFI_TEST,
> 
>     16         LOCKDOWN_KEXEC,
> 
>     15         LOCKDOWN_HIBERNATION,
> 
>     14         LOCKDOWN_PCI_ACCESS,
> 
>     13         LOCKDOWN_IOPORT,
> 
>     12         LOCKDOWN_MSR,
> 
>     11         LOCKDOWN_ACPI_TABLES,
> 
>     10         LOCKDOWN_DEVICE_TREE,
> 
>      9         LOCKDOWN_PCMCIA_CIS,
> 
>      8         LOCKDOWN_TIOCSSERIAL,
> 
>      7         LOCKDOWN_MODULE_PARAMETERS,
> 
>      6         LOCKDOWN_MMIOTRACE,
> 
>      5         LOCKDOWN_DEBUGFS,
> 
>      4         LOCKDOWN_XMON_WR,
> 
>      3         LOCKDOWN_BPF_WRITE_USER,
> 
>      2         LOCKDOWN_DBG_WRITE_KERNEL,
> 
>      1         LOCKDOWN_RTAS_ERROR_INJECTION,
> 
> Given this if we for example choose to lockdown the kernel for DEV_MEM,
> we'll also get the MODULE_SIGNATURE lockdown as well. I find this somewhat
> inflexible as we might have to rejuggle the current ordering.

Urgh.. I thought we track the lockdown level for each feature separately,
but it is lockdown depth instead :/

Maybe it is worth reworking internals to have bitmap of lockdown features?
It will allow us to pick and choose features to lockdown.

-- 
  Kiryl Shutsemau / Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ