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: <b6655e68246bb19bd1dde17602c80dc4d9c9d2c8.camel@amazon.com>
Date:   Thu, 2 Apr 2020 22:18:54 +0000
From:   "Singh, Balbir" <sblbir@...zon.com>
To:     "bp@...en8.de" <bp@...en8.de>
CC:     "tglx@...utronix.de" <tglx@...utronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "tony.luck@...el.com" <tony.luck@...el.com>,
        "keescook@...omium.org" <keescook@...omium.org>,
        "benh@...nel.crashing.org" <benh@...nel.crashing.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "dave.hansen@...el.com" <dave.hansen@...el.com>
Subject: Re: [PATCH 3/3] arch/x86: Optionally flush L1D on context switch

On Fri, 2020-04-03 at 00:11 +0200, Borislav Petkov wrote:
> CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you can confirm the sender and know
> the content is safe.
> 
> 
> 
> On Thu, Apr 02, 2020 at 05:24:01PM +1100, Balbir Singh wrote:
> > +int enable_l1d_flush_for_task(struct task_struct *tsk)
> > +{
> > +     struct page *page;
> > +     int ret = 0;
> > +
> > +     if (static_cpu_has(X86_FEATURE_FLUSH_L1D))
> > +             goto done;
> > +
> > +     page = READ_ONCE(l1d_flush_pages);
> > +     if (unlikely(!page)) {
> > +             mutex_lock(&l1d_flush_mutex);
> > +             if (!l1d_flush_pages) {
> > +                     l1d_flush_pages = alloc_l1d_flush_pages();
> > +                     if (!l1d_flush_pages)
> > +                             return -ENOMEM;
> 
> Do I see it correctly that you'll return here with l1d_flush_mutex still
> held?

Darn.. :(

I had goto done to release the mutex earlier, let me fix that :)

Thanks,
Balbir Singh

> 
> > +             }
> > +             mutex_unlock(&l1d_flush_mutex);
> > +     }
> > +     /* I don't think we need to worry about KSM */
> 
> Pls use passive voice: no "we" or "I", etc.
> 
> --
> 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