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: <456d9a5f-45cb-4307-b8e9-3333a2c71e69@amd.com>
Date: Tue, 9 Jul 2024 10:42:19 +0530
From: "Balasubrmanian, Vignesh" <vigbalas@....com>
To: Borislav Petkov <bp@...en8.de>,
 "Balasubrmanian, Vignesh" <Vignesh.Balasubrmanian@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 "linux-toolchains@...r.kernel.org" <linux-toolchains@...r.kernel.org>,
 "mpe@...erman.id.au" <mpe@...erman.id.au>,
 "npiggin@...il.com" <npiggin@...il.com>,
 "christophe.leroy@...roup.eu" <christophe.leroy@...roup.eu>,
 "aneesh.kumar@...nel.org" <aneesh.kumar@...nel.org>,
 "naveen.n.rao@...ux.ibm.com" <naveen.n.rao@...ux.ibm.com>,
 "ebiederm@...ssion.com" <ebiederm@...ssion.com>,
 "keescook@...omium.org" <keescook@...omium.org>,
 "x86@...nel.org" <x86@...nel.org>,
 "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
 "linux-mm@...ck.org" <linux-mm@...ck.org>,
 "George, Jini Susan" <JiniSusan.George@....com>, "matz@...e.de"
 <matz@...e.de>, "binutils@...rceware.org" <binutils@...rceware.org>,
 "jhb@...eBSD.org" <jhb@...ebsd.org>,
 "felix.willgerodt@...el.com" <felix.willgerodt@...el.com>
Subject: Re: [PATCH v2 1/1] x86/elf: Add a new .note section containing
 Xfeatures information to x86 core files

Apologies for the delay. I am sending the new version patch with below 
changes.

On 5/31/2024 4:28 PM, Borislav Petkov wrote:
> p type, size, offset and flag values for every xfeature that is present.
> + */
> +static int dump_xsave_layout_desc(struct coredump_params *cprm)
> +{
> +       int num_records = 0;
> +       int i;
> +
> +       for_each_extended_xfeature(i, fpu_kernel_cfg.max_features) {

Modifying "fpu_kernel_cfg.max_features" to "fpu_user_cfg.max_features"

Supervisor bits also set inĀ "fpu_kernel_cfg.max_features"

(https://github.com/torvalds/linux/blob/master/arch/x86/kernel/fpu/xstate.c#L777)

> +               struct xfeat_component xc = {
> +                       .type   = i,
> +                       .size   = xstate_sizes[i],
> +                       .offset = xstate_offsets[i],
> +                       /* reserved for future use */
> +                       .flags  = 0,
> +               };
> +
> +               if (!dump_emit(cprm, &xc, sizeof(xc)))
> +                       return 0;
> +
> +               num_records++;
> +       }
> +       return num_records;
> +}
> +
> +static int get_xsave_desc_size(void)
> +{
> +       int cnt = 0;
> +       int i;
> +
changing "int" to "u32" as per review comment.
> +       for_each_extended_xfeature(i, fpu_kernel_cfg.max_features)
> +               cnt++;
> +
> +       return cnt * (sizeof(struct xfeat_component));
> +}
> +
>
> +
> +int elf_coredump_extra_notes_size(void)
> +{
> +       int size;

Adding below check, same as in "elf_coredump_extra_notes_write"

if (!fpu_user_cfg.max_features)

return 0;


thanks,
vigneshbalu.

> +       /* .note header */
> +       size  = sizeof(struct elf_note);
> +       /* name + align */
> +       size += roundup(sizeof(owner_name), 4);
> +       size += get_xsave_desc_size();
> +
>
>   #define NT_S390_TIMER  0x301           /* s390 timer register */
>   #define NT_S390_TODCMP 0x302           /* s390 TOD clock comparator register */
> --
> 2.43.0
>
>
> --
> Regards/Gruss,
>      Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ