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: <1512749871.4364.9.camel@linux.vnet.ibm.com>
Date:   Fri, 08 Dec 2017 11:17:51 -0500
From:   Mimi Zohar <zohar@...ux.vnet.ibm.com>
To:     Jason Gunthorpe <jgg@...pe.ca>, Alexander.Steffen@...ineon.com
Cc:     pmenzel@...gen.mpg.de, linux-integrity@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [Regression 4.15-rc2] New messages `tpm tpm0: A TPM error
 (2314) occurred continue selftest`

On Fri, 2017-12-08 at 08:56 -0700, Jason Gunthorpe wrote:
> On Fri, Dec 08, 2017 at 12:14:04PM +0000, Alexander.Steffen@...ineon.com wrote:
> 
> > Is it really that ugly? I still need delay_msec to increase the
> > delay each round. I can see the benefit of your suggestion when it
> > is important to get the timing exactly right (and also account for
> > time spent elsewhere, when our code might not be executing). But in
> > this case having delays that are approximately right (or longer than
> > intended) is sufficient.
> 
> For timeouts like this we really need to be above the TPM specified
> delay in all cases, even if usleep_range selected something
> smaller/larger.. The only way to do that is with an absolute timeout..
> 
> 
> > Anyway, from the log messages it is clear that tpm_msleep got called
> > seven times with delays of 20/40/80/160/320/640/1280ms. But still
> > all timestamps lie within the same second. How can this be with a
> > cumulated delay of ~2.5s?
> 
> Yes, that does seem to be the bug, our sleep function doesn't work
> aynmore for some reason :|
> 
> > Also, I've just noticed that despite the name tpm_msleep calls
> > usleep_range, not msleep. Can this have an influence? Should
> > tpm_msleep call msleep for longer delays, as suggested by
> > Documentation/timers/timers-howto.txt?
> 
> This change was introduced recently and is probably the source of this
> regression.

msleep() waited a lot longer than the requested time, causing long
delays.  Using usleep_range() still waits more than the requested
time, but less than msleep().

static inline void tpm_msleep(unsigned int delay_msec)
{
        usleep_range((delay_msec * 1000) - TPM_TIMEOUT_RANGE_US,
                     delay_msec * 1000);
};

Other TPM performance improvements have not yet been upstreamed.

Mimi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ