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: <d2c23029-307f-4691-af13-e57bedd2ea33@oracle.com>
Date: Tue, 15 Apr 2025 14:04:03 -0700
From: ross.philipson@...cle.com
To: ALOK TIWARI <alok.a.tiwari@...cle.com>, linux-kernel@...r.kernel.org,
        x86@...nel.org, linux-integrity@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-crypto@...r.kernel.org,
        kexec@...ts.infradead.org, linux-efi@...r.kernel.org,
        iommu@...ts.linux.dev
Cc: dpsmith@...rtussolutions.com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, hpa@...or.com, dave.hansen@...ux.intel.com,
        ardb@...nel.org, mjg59@...f.ucam.org,
        James.Bottomley@...senpartnership.com, peterhuewe@....de,
        jarkko@...nel.org, jgg@...pe.ca, luto@...capital.net,
        nivedita@...m.mit.edu, herbert@...dor.apana.org.au,
        davem@...emloft.net, corbet@....net, ebiederm@...ssion.com,
        dwmw2@...radead.org, baolu.lu@...ux.intel.com,
        kanth.ghatraju@...cle.com, andrew.cooper3@...rix.com,
        trenchboot-devel@...glegroups.com
Subject: Re: [PATCH v13 04/19] x86: Secure Launch main header file

On 4/12/25 11:34 AM, ALOK TIWARI wrote:
> 
> 
> On 11-04-2025 02:11, Ross Philipson wrote:
>> Introduce the main Secure Launch header file used in the early SL stub
>> and the early setup code.
>>
>> This header file contains the following categories:
>>   - Secure Launch implementation specific structures and definitions.
>>   - Intel TXT architecture specific DRTM structures, definitions and 
>> functions
>> used by Secure Launch.
>>   - DRTM TPM event logging definitions and helper functions.
>>
>> Signed-off-by: Ross Philipson <ross.philipson@...cle.com>
>> ---
> 
> 
>> +#define TXT_HEAP_EXTDATA_TYPE_TPM_EVENT_LOG_PTR        5
>> +
>> +struct txt_heap_event_log_element {
>> +    u64 event_log_phys_addr;
>> +} __packed;
>> +
> 
> can be consistence with PTR

The names come from the TXT spec for the most part. But maybe it will 
look better if I change it. Will see.

> 
>> +#define TXT_HEAP_EXTDATA_TYPE_EVENT_LOG_POINTER2_1    8
>> +
>> +struct txt_heap_event_log_pointer2_1_element {
>> +    u64 phys_addr;
>> +    u32 allocated_event_container_size;
>> +    u32 first_record_offset;
>> +    u32 next_record_offset;
>> +} __packed;
> 
> 
> 
>> +/*
>> + * Find the TPM v2 event log element in the TXT heap. This element 
>> contains
>> + * the information about the size and location of the DRTM event log. 
>> Note
>> + * this is a TXT specific structure.
>> + *
>> + * See:
>> + *   Intel Trusted Execution Technology - Measured Launch Environment 
>> Developer's Guide - Appendix C.
>> + */
>> +static inline struct txt_heap_event_log_pointer2_1_element*
>> +tpm2_find_log2_1_element(struct txt_os_sinit_data *os_sinit_data)
>> +{
>> +    struct txt_heap_ext_data_element *ext_elem;
>> +
>> +    /* The extended element array as at the end of this table */
>> +    ext_elem = (struct txt_heap_ext_data_element *)
>> +        ((u8 *)os_sinit_data + sizeof(struct txt_os_sinit_data));
>> +
>> +    while (ext_elem->type != TXT_HEAP_EXTDATA_TYPE_END) {
>> +        if (ext_elem->type ==
>> +            TXT_HEAP_EXTDATA_TYPE_EVENT_LOG_POINTER2_1) {
>> +            return (struct txt_heap_event_log_pointer2_1_element *)
>> +                ((u8 *)ext_elem +
>> +                    sizeof(struct txt_heap_ext_data_element));
> 
> indentation can be better here

Ack

> 
>> +        }
>> +        ext_elem =
>> +            (struct txt_heap_ext_data_element *)
>> +            ((u8 *)ext_elem + ext_elem->size);
>> +    }
>> +
>> +    return NULL;
>> +}
>> +
> '

Was there an extra empty space here? I will check.

> '
>> +
>> +/*
>> + * External functions avalailable in mainline kernel.
> 
> typo  avalailable -> available

Ack

> 
>> + */
>> +void slaunch_setup_txt(void);
>> +void slaunch_fixup_jump_vector(void);
>> +u32 slaunch_get_flags(void);
>> +struct sl_ap_wake_info *slaunch_get_ap_wake_info(void);
>> +struct acpi_table_header *slaunch_get_dmar_table(struct 
>> acpi_table_header *dmar);
>> +void __noreturn slaunch_txt_reset(void __iomem *txt,
>> +                     const char *msg, u64 error);
>> +void slaunch_finalize(int do_sexit);
>> +
>> +static inline bool slaunch_is_txt_launch(void)
>> +{
>> +    u32 mask =  SL_FLAG_ACTIVE | SL_FLAG_ARCH_TXT;
> 
> extra ' ' after =

Ack will fix these.

> 
>> +
>> +    return (slaunch_get_flags() & mask) == mask;
>> +}
> 
> 
> Thanks,
> Alok
> 
Thanks
Ross


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ