[PATCH v6 5/6] crypto: algif_akcipher - add ops_nokey

2016-05-14 Thread Tadeusz Struk
Similar to algif_skcipher and algif_hash, algif_akcipher needs to prevent user space from using the interface in an improper way. This patch adds nokey ops handlers, which do just that. Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/algif_akcipher.c

[PATCH v6 2/6] crypto: AF_ALG -- add setpubkey setsockopt call

2016-05-14 Thread Tadeusz Struk
From: Stephan Mueller For supporting asymmetric ciphers, user space must be able to set the public key. The patch adds a new setsockopt call for setting the public key. Signed-off-by: Stephan Mueller --- crypto/af_alg.c | 18

[PATCH v6 6/6] crypto: AF_ALG - add support for key_id

2016-05-14 Thread Tadeusz Struk
akcipher api or invoke operations defined by a given subtype, depending on the key type. Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/af_alg.c | 10 ++ crypto/algif_akcipher.c | 207 ++- include/crypto/if

[PATCH v6 1/6] crypto: AF_ALG -- add sign/verify API

2016-05-14 Thread Tadeusz Struk
From: Stephan Mueller <smuel...@chronox.de> Add the flags for handling signature generation and signature verification. Also, the patch adds the interface for setting a public key. Signed-off-by: Stephan Mueller <smuel...@chronox.de> Signed-off-by: Tadeusz Struk <tadeusz.

[PATCH v6 0/6] crypto: algif - add akcipher

2016-05-14 Thread Tadeusz Struk
): crypto: AF_ALG -- add sign/verify API crypto: AF_ALG -- add setpubkey setsockopt call crypto: AF_ALG -- add asymmetric cipher interface crypto: algif_akcipher - enable compilation Tadeusz Struk (2): crypto: algif_akcipher - add ops_nokey crypto: AF_ALG - add

Re: v4.6-rc1 regression bisected, Problem loading in-kernel X.509 certificate (-2)

2016-05-03 Thread Tadeusz Struk
Hi Jamie, On 05/03/2016 01:35 PM, David Howells wrote: > (cc'ing Tadeusz as he did the pkcs1 padding function) > > Jamie Heilman wrote: > Problem loading in-kernel X.509 certificate (-2) >>> >>> ENOENT? Hmmm... The only place that is generated is in the

Re: v4.6-rc1 regression bisected, Problem loading in-kernel X.509 certificate (-2)

2016-05-03 Thread Tadeusz Struk
On 05/03/2016 07:26 PM, Jamie Heilman wrote: >>> Alrighty, presumably relevant bits: >>> > > >>> > > X.509: Cert Issuer: Build time autogenerated kernel key >>> > > X.509: Cert Subject: Build time autogenerated kernel key >>> > > X.509: Cert Key Algo: rsa >>> > > X.509: Cert Valid period:

[PATCH RESEND v5 4/6] crypto: algif_akcipher - enable compilation

2016-05-05 Thread Tadeusz Struk
From: Stephan Mueller <smuel...@chronox.de> Add the Makefile and Kconfig updates to allow algif_akcipher to be compiled. Signed-off-by: Stephan Mueller <smuel...@chronox.de> Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/Kconfig |9 + crypto/Ma

[PATCH RESEND v5 3/6] crypto: AF_ALG -- add asymmetric cipher interface

2016-05-05 Thread Tadeusz Struk
ed-off-by: Stephan Mueller <smuel...@chronox.de> Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/algif_akcipher.c | 542 +++ 1 file changed, 542 insertions(+) create mode 100644 crypto/algif_akcipher.c diff --git a/crypto/algif_a

[PATCH RESEND v5 2/6] crypto: AF_ALG -- add setpubkey setsockopt call

2016-05-05 Thread Tadeusz Struk
From: Stephan Mueller For supporting asymmetric ciphers, user space must be able to set the public key. The patch adds a new setsockopt call for setting the public key. Signed-off-by: Stephan Mueller --- crypto/af_alg.c | 18

[PATCH RESEND v5 5/6] crypto: algif_akcipher - add ops_nokey

2016-05-05 Thread Tadeusz Struk
Similar to algif_skcipher and algif_hash, algif_akcipher needs to prevent user space from using the interface in an improper way. This patch adds nokey ops handlers, which do just that. Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/algif_akcipher.c

[PATCH RESEND v5 1/6] crypto: AF_ALG -- add sign/verify API

2016-05-05 Thread Tadeusz Struk
From: Stephan Mueller <smuel...@chronox.de> Add the flags for handling signature generation and signature verification. Also, the patch adds the interface for setting a public key. Signed-off-by: Stephan Mueller <smuel...@chronox.de> Signed-off-by: Tadeusz Struk <tadeusz.

[PATCH RESEND v5 0/6] crypto: algif - add akcipher

2016-05-05 Thread Tadeusz Struk
-- add setpubkey setsockopt call crypto: AF_ALG -- add asymmetric cipher interface crypto: algif_akcipher - enable compilation Tadeusz Struk (2): crypto: algif_akcipher - add ops_nokey crypto: AF_ALG - add support for key_id crypto/Kconfig |9 crypto/Makefile

Re: v4.6-rc1 regression bisected, Problem loading in-kernel X.509 certificate (-2)

2016-05-04 Thread Tadeusz Struk
pkcs1pad template needs CRYPTO_MANAGER so it needs to be explicitly selected by CRYPTO_RSA. Reported-by: Jamie Heilman <ja...@audible.transient.net> Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/Kco

[PATCH RESEND v5 6/6] crypto: AF_ALG - add support for key_id

2016-05-05 Thread Tadeusz Struk
akcipher api or invoke operations defined by a given subtype, depending on the key type. Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/af_alg.c | 10 ++ crypto/algif_akcipher.c | 207 ++- include/crypto/if

Re: [RFC PATCH] KEYS: Provide keyctls to do public key operations

2016-04-15 Thread Tadeusz Struk
Hi David, On 04/14/2016 03:00 PM, David Howells wrote: > diff --git a/crypto/asymmetric_keys/signature.c > b/crypto/asymmetric_keys/signature.c > index 11b7ba170904..8ecbeda16b53 100644 > --- a/crypto/asymmetric_keys/signature.c > +++ b/crypto/asymmetric_keys/signature.c Since this file

[PATCH v5 6/6] crypto: AF_ALG - add support for key_id

2016-04-15 Thread Tadeusz Struk
or invoke operations defined by a given subtype, depending on the key type. Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/af_alg.c | 10 ++ crypto/algif_akcipher.c | 207 ++- include/crypto/if_alg.h |1 i

[PATCH v5 4/6] crypto: algif_akcipher - enable compilation

2016-04-15 Thread Tadeusz Struk
From: Stephan Mueller <smuel...@chronox.de> Add the Makefile and Kconfig updates to allow algif_akcipher to be compiled. Signed-off-by: Stephan Mueller <smuel...@chronox.de> Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/Kconfig |9 + crypto/Ma

[PATCH v5 5/6] crypto: algif_akcipher - add ops_nokey

2016-04-15 Thread Tadeusz Struk
Similar to algif_skcipher and algif_hash, algif_akcipher needs to prevent user space from using the interface in an improper way. This patch adds nokey ops handlers, which do just that. Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/algif_akcipher.c

[PATCH v5 0/6] crypto: algif - add akcipher

2016-04-15 Thread Tadeusz Struk
--- Stephan Mueller (4): crypto: AF_ALG -- add sign/verify API crypto: AF_ALG -- add setpubkey setsockopt call crypto: AF_ALG -- add asymmetric cipher interface crypto: algif_akcipher - enable compilation Tadeusz Struk (2): crypto: algif_akcipher - add ops_nokey

[PATCH v5 2/6] crypto: AF_ALG -- add setpubkey setsockopt call

2016-04-15 Thread Tadeusz Struk
From: Stephan Mueller <smuel...@chronox.de> For supporting asymmetric ciphers, user space must be able to set the public key. The patch adds a new setsockopt call for setting the public key. Signed-off-by: Stephan Mueller <smuel...@chronox.de> Signed-off-by: Tadeusz Struk

[PATCH v5 1/6] crypto: AF_ALG -- add sign/verify API

2016-04-15 Thread Tadeusz Struk
From: Stephan Mueller <smuel...@chronox.de> Add the flags for handling signature generation and signature verification. Also, the patch adds the interface for setting a public key. Signed-off-by: Stephan Mueller <smuel...@chronox.de> Signed-off-by: Tadeusz Struk <tadeusz.

[PATCH v5 3/6] crypto: AF_ALG -- add asymmetric cipher interface

2016-04-15 Thread Tadeusz Struk
ed-off-by: Stephan Mueller <smuel...@chronox.de> Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- crypto/algif_akcipher.c | 542 +++ 1 file changed, 542 insertions(+) create mode 100644 crypto/algif_akcipher.c diff --git a/crypto/algif_a

Re: [PATCH v5 6/6] crypto: AF_ALG - add support for key_id

2016-04-15 Thread Tadeusz Struk
; > url: > https://github.com/0day-ci/linux/commits/Tadeusz-Struk/crypto-algif-add-akcipher/20160416-043207 > base: > https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git > master > config: i386-allmodconfig (attached as .config) > reproduce: >

Re: [PATCH 0/3] crypto: af_alg - add TLS type encryption

2016-04-13 Thread Tadeusz Struk
Hi Fridolin, On 04/12/2016 04:13 AM, Fridolin Pokorny wrote: > we were experimenting with this. We have a prove of concept of a kernel > TLS type socket, so called AF_KTLS, which is based on Dave Watson's > RFC5288 patch. It handles both TLS and DTLS, unfortunately it is not > ready now to be

Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id

2016-07-05 Thread Tadeusz Struk
Hi Mat, On 06/29/2016 11:43 AM, Mat Martineau wrote: >> +ret = verify_signature(key, ); >> +if (!ret) { >> +req->dst_len = sizeof(digest); > > I think you fixed the BUG_ON() problem but there's still an issue with > the handling of the digest. Check the use of sig->digest in >

Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id

2016-07-08 Thread Tadeusz Struk
Hi Mat, On 07/06/2016 12:38 PM, Mat Martineau wrote: >> So it looks like the only thing that we need to return to the user in >> this case is the return code. Do you agree? > > The way verify_signature is implemented today, the only output is the > return code. For verify, maybe no read is

Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id

2016-07-08 Thread Tadeusz Struk
On 07/08/2016 09:38 AM, Mat Martineau wrote: > Are the inputs and outputs defined for ALG_OP_VERIFY in SET_KEY mode > going to work for hardware keys (like TPM) in SET_KEY_ID mode? That's > needed if the verify SET_KEY_ID mode is to be added later. Yes, we will just need to change the

[PATCH RFC 1/2] driver core: allow EPROBE_DEFER after boot

2017-02-06 Thread Tadeusz Struk
the core to busy loop. Reviewed-by: Ira Weiny <ira.we...@intel.com> Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- drivers/base/dd.c | 26 +- drivers/base/driver.c |2 +- include/linux/device.h |2 ++ 3 files changed, 12 insertions(+),

[PATCH RFC 2/2] IB/hfi1: Fix port ordering issue in a multiport device

2017-02-06 Thread Tadeusz Struk
is IB device unit numbers are in reverse order from the faceplate numbering. This leads to confusion, and errors. Use EPROBE_DEFER error code to enforce correct port order. Reviewed-by: Ira Weiny <ira.we...@intel.com> Signed-off-by: Tadeusz Struk <tadeusz.st...@intel.com> --- drivers/i

Re: Problem with RSA test from testmgr

2017-03-01 Thread Tadeusz Struk
Hi Corentin, On 03/01/2017 04:04 AM, Corentin Labbe wrote: >> I would think the issue is that the OpenSSL BIGNUM lib has some issues: when >> calculating m^e mod n, m has to be equal to the key size. The kernel's MPI >> code handles the case where m is smaller than the key size. >> >> Note, in

Re: Problem with RSA test from testmgr

2017-03-02 Thread Tadeusz Struk
Hi Stephan, On 03/01/2017 10:08 PM, Stephan Müller wrote: >> memset(ptextp, 0, 256); >> memcpy(ptextp + 64 - 8, ptext_ex, plen); > I actually have tested that and it did not return the data the kernel > implementation would return It did for me: Result 64 plen=8 63 1c cd 7b e1 7e e4 de

Re: Problem with RSA test from testmgr

2017-03-02 Thread Tadeusz Struk
On 03/01/2017 10:21 PM, Corentin Labbe wrote: > I am finishing a patch that made testmgr test both (padded and unpadded). Even if you patch the test vectors there is no guarantee that a user of the API will always have the plain text padded. It can be anything between 1 and the key size. This

Re: [PATCH] tpm: fix race condition in tpm_common_write()

2018-05-23 Thread Tadeusz Struk
On 05/23/2018 06:23 AM, Jarkko Sakkinen wrote: > Ouch o_O Do you have a fixes tag for this one? > This one is quite tricky. The original bug was introduced by abce9ac292e13 (tpm: Propagate error from tpm_transmit to fix a timeout hang) and the code back then was in

[PATCH v2 1/2] tpm: add ptr to the tpm_space struct to file_priv

2018-06-11 Thread Tadeusz Struk
Add a ptr to struct tpm_space to the file_priv to have an easy access to it in the async job without the need to allocate memory. This also allows to consolidate of the write operations for the two interfaces. Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev-common.c |8

[PATCH v2 2/2] tpm: add support for nonblocking operation

2018-06-11 Thread Tadeusz Struk
Currently the TPM driver only supports blocking calls, which doesn't allow asynchronous IO operations to the TPM hardware. This patch changes it and adds support for nonblocking write and a new poll function to enable applications, which want to take advantage of this. Signed-off-by: Tadeusz

[PATCH v2 0/2] tpm: add support for nonblocking operation

2018-06-11 Thread Tadeusz Struk
what's needed is in the file_priv struct. - Renamed the 'work' member of the timer to avoid confusion. Now there are 'timeout_work' and 'async_work'. - Removed the global wait queue and moved it to file_priv. - Only creating the work queue when the first file is opened. Tadeusz Struk (2): tpm

Re: [PATCH v2 2/2] tpm: add support for nonblocking operation

2018-06-11 Thread Tadeusz Struk
On 06/11/2018 07:53 PM, kbuild test robot wrote: > Hi Tadeusz, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on char-misc/char-misc-testing] > [also build test ERROR on next-20180608] > [cannot apply to v4.17] Hi, Thanks for the report. This patch should go

Re: [PATCH v3 2/2] tpm: add support for nonblocking operation

2018-06-13 Thread Tadeusz Struk
On 06/13/2018 10:55 AM, J Freyensee wrote: >> +    /* >> + * If in nonblocking mode schedule an async job to send >> + * the command return the size. >> + * In case of error the err code will be returned in >> + * the subsequent read call. >> + */ >> +    if (file->f_flags &

Re: [PATCH v2 2/2] tpm: add support for nonblocking operation

2018-06-12 Thread Tadeusz Struk
On 06/11/2018 07:53 PM, kbuild test robot wrote: > Hi Tadeusz, > # save the attached .config to linux build tree > make ARCH=i386 > > All error/warnings (new ones prefixed by >>): > >>> drivers/char//tpm/tpm-dev-common.c:223:1: warning: data definition has no >>> type or

[PATCH v3 1/2] tpm: add ptr to the tpm_space struct to file_priv

2018-06-12 Thread Tadeusz Struk
Add a ptr to struct tpm_space to the file_priv to have an easy access to it in the async job without the need to allocate memory. This also allows to consolidate of the write operations for the two interfaces. Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev-common.c |8

[PATCH v3 2/2] tpm: add support for nonblocking operation

2018-06-12 Thread Tadeusz Struk
Currently the TPM driver only supports blocking calls, which doesn't allow asynchronous IO operations to the TPM hardware. This patch changes it and adds support for nonblocking write and a new poll function to enable applications, which want to take advantage of this. Signed-off-by: Tadeusz

[PATCH v3 0/2] tpm: add support for nonblocking operation

2018-06-12 Thread Tadeusz Struk
' and 'async_work'. - Removed the global wait queue and moved it to file_priv. - Only creating the work queue when the first file is opened. Tadeusz Struk (2): tpm: add ptr to the tpm_space struct to file_priv tpm: add support for nonblocking operation drivers/char/tpm/tpm-dev-common.c | 150

Re: [PATCH v3 0/2] tpm: add support for nonblocking operation

2018-06-19 Thread Tadeusz Struk
On 06/19/2018 06:10 AM, Jarkko Sakkinen wrote: > On Tue, Jun 12, 2018 at 10:58:26AM -0700, Tadeusz Struk wrote: >> The TCG SAPI specification [1] defines a set of functions, which allows >> applications to use the TPM device in either blocking or non-blocking >> fashion. &g

Re: [PATCH v3 0/2] tpm: add support for nonblocking operation

2018-06-20 Thread Tadeusz Struk
On 06/20/2018 04:59 PM, James Bottomley wrote: > I'm slightly surprised by this statement. I thought IoT Node.js > runtimes (of which there are far too many, so I haven't looked at all > of them) use libuv or one of the forks: > > http://libuv.org/ > > As the basis for their I/O handling?

Re: [PATCH v3 0/2] tpm: add support for nonblocking operation

2018-06-21 Thread Tadeusz Struk
On 06/20/2018 10:26 PM, James Bottomley wrote: >> Yes, it does polling: >> http://docs.libuv.org/en/v1.x/design.html#the-i-o-loop > But that's for networking. You'll be talking to the TPM RM over the > file descriptor so that follows the thread pool model in > >

Re: [PATCH v3 0/2] tpm: add support for nonblocking operation

2018-06-21 Thread Tadeusz Struk
On 06/21/2018 10:17 AM, Jarkko Sakkinen wrote: > On Tue, Jun 19, 2018 at 05:45:35PM -0700, Tadeusz Struk wrote: >> Hi Jarkko, >> Thanks for reviewing the patch. >> There are applications/frameworks where a worker thread is not an option. >> Take for example the IoT us

Re: [PATCH v4 2/2] tpm: add support for nonblocking operation

2018-08-10 Thread Tadeusz Struk
On 08/10/2018 12:00 PM, James Bottomley wrote: > On Fri, 2018-08-10 at 11:56 -0700, Tadeusz Struk wrote: >> On 08/10/2018 11:48 AM, James Bottomley wrote: >>> On Fri, 2018-08-10 at 11:21 -0700, Tadeusz Struk wrote: >>>> and the feedback I got from Jason was: >

Re: [PATCH v4 2/2] tpm: add support for nonblocking operation

2018-08-10 Thread Tadeusz Struk
On 08/10/2018 11:48 AM, James Bottomley wrote: > On Fri, 2018-08-10 at 11:21 -0700, Tadeusz Struk wrote: >> and the feedback I got from Jason was: >> >> "I wonder if it is worth creating this when the first file is >> opened.. Lots of systems have TPMs but few

Re: [PATCH v4 1/2] tpm: add ptr to the tpm_space struct to file_priv

2018-08-10 Thread Tadeusz Struk
On 08/10/2018 10:27 AM, Jarkko Sakkinen wrote: > On Tue, Aug 07, 2018 at 01:27:44PM -0700, Tadeusz Struk wrote: >> Add a ptr to struct tpm_space to the file_priv to have an easy >> access to it in the async job without the need to allocate memory. >> This also allows to con

Re: [PATCH v4 2/2] tpm: add support for nonblocking operation

2018-08-10 Thread Tadeusz Struk
On 08/10/2018 10:43 AM, Jarkko Sakkinen wrote: >> +static struct workqueue_struct *tpm_dev_wq; > A naming contradiction with tpm_common_read() and tpm_common_write(). To > sort that up I would suggest adding a commit to the patch set that > renames these functions as tpm_dev_common_read() and >

Re: [PATCH v3 RESEND 2/2] tpm: add support for nonblocking operation

2018-08-06 Thread Tadeusz Struk
On 08/06/2018 04:05 PM, James Bottomley wrote: > For an async interface, shouldn't I be able to queue an > arbitrary number of commands without blocking? That was the approach in the v1 version of this patch, but Jason requested this to be changed so that only one command at a time can be

[PATCH v3 RESEND 0/2] tpm: add support for nonblocking operation

2018-08-06 Thread Tadeusz Struk
r to avoid confusion. Now there are 'timeout_work' and 'async_work'. - Removed the global wait queue and moved it to file_priv. - Only creating the work queue when the first file is opened. Tadeusz Struk (2): tpm: add ptr to the tpm_space struct to file_priv tpm: add support for n

[PATCH v3 RESEND 1/2] tpm: add ptr to the tpm_space struct to file_priv

2018-08-06 Thread Tadeusz Struk
Add a ptr to struct tpm_space to the file_priv to have an easy access to it in the async job without the need to allocate memory. This also allows to consolidate of the write operations for the two interfaces. Tested-by: Philip Tricca Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev

[PATCH v3 RESEND 2/2] tpm: add support for nonblocking operation

2018-08-06 Thread Tadeusz Struk
Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev-common.c | 145 +++-- drivers/char/tpm/tpm-dev.c| 16 +++- drivers/char/tpm/tpm-dev.h| 16 +++- drivers/char/tpm/tpm-interface.c |1 drivers/char/tpm/tpm.h|1

Re: [PATCH v3 RESEND 2/2] tpm: add support for nonblocking operation

2018-08-07 Thread Tadeusz Struk
On 08/06/2018 05:35 PM, James Bottomley wrote: > On Mon, 2018-08-06 at 17:09 -0700, Tadeusz Struk wrote: >> On 08/06/2018 04:05 PM, James Bottomley wrote: >>> For an async interface, shouldn't I be able to queue an >>> arbitrary number of commands without blocking?

[PATCH v4 1/2] tpm: add ptr to the tpm_space struct to file_priv

2018-08-07 Thread Tadeusz Struk
Add a ptr to struct tpm_space to the file_priv to have an easy access to it in the async job without the need to allocate memory. This also allows to consolidate of the write operations for the two interfaces. Tested-by: Philip Tricca Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev

[PATCH v4 2/2] tpm: add support for nonblocking operation

2018-08-07 Thread Tadeusz Struk
Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev-common.c | 149 - drivers/char/tpm/tpm-dev.c| 16 +++- drivers/char/tpm/tpm-dev.h| 17 +++- drivers/char/tpm/tpm-interface.c |1 drivers/char/tpm/tpm.h|1

[PATCH v4 0/2] tpm: add support for nonblocking operation

2018-08-07 Thread Tadeusz Struk
when the first file is opened. Tadeusz Struk (2): tpm: add ptr to the tpm_space struct to file_priv tpm: add support for nonblocking operation drivers/char/tpm/tpm-dev-common.c | 150 +++-- drivers/char/tpm/tpm-dev.c| 22 +++-- driver

Re: [PATCH v3 RESEND 2/2] tpm: add support for nonblocking operation

2018-08-07 Thread Tadeusz Struk
On 08/07/2018 11:20 AM, Jason Gunthorpe wrote: > Doesn't lockdep complain when locks are left held after returning to > user space? Even if it doesn't, that is a pretty ugly thing to do. I didn't notice anything from lockdep during my testing, but I will change it to release the lock before

[PATCH v5 2/2] tpm: add support for nonblocking operation

2018-08-13 Thread Tadeusz Struk
Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev-common.c | 142 - drivers/char/tpm/tpm-dev.c|1 drivers/char/tpm/tpm-dev.h| 13 ++- drivers/char/tpm/tpm-interface.c | 24 +- drivers/char/tpm/tpm.h|2

[PATCH v5 0/2] tpm: add support for nonblocking operation

2018-08-13 Thread Tadeusz Struk
ork' and 'async_work'. - Removed the global wait queue and moved it to file_priv. - Only creating the work queue when the first file is opened. Tadeusz Struk (2): tpm: add ptr to the tpm_space struct to file_priv tpm: add support for nonblocking operation drivers/char/tpm/tpm

[PATCH v5 1/2] tpm: add ptr to the tpm_space struct to file_priv

2018-08-13 Thread Tadeusz Struk
Add a ptr to struct tpm_space to the file_priv to have an easy access to it in the async job without the need to allocate memory. This also allows to consolidate of the write operations for the two interfaces. Tested-by: Philip Tricca Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev

Re: [PATCH] tpm: add support for partial reads

2018-07-23 Thread Tadeusz Struk
On 07/23/2018 01:19 PM, Jarkko Sakkinen wrote: > In this case I do not have any major evidence of any major benefit *and* > the change breaks the ABI. As I said before - this does not break the ABI. As for the benefits - it help user space in how they implement the receive path. Application does

Re: [PATCH] tpm: add support for partial reads

2018-07-23 Thread Tadeusz Struk
On 07/23/2018 02:13 PM, James Bottomley wrote: > The current patch does, you even provided a use case in your last email > (it's do command to get sizing followed by do command with correctly > sized buffer). The example I provided was: #1 send a command, #2 read the response header (10 bytes),

Re: [PATCH] tpm: add support for partial reads

2018-07-23 Thread Tadeusz Struk
On 07/23/2018 02:56 PM, Jason Gunthorpe wrote: > The proposed patch doesn't clear the data_pending if the entire buffer > is not consumed, so of course it is ABI breaking, that really isn't OK. The data_pending will be cleared by the timeout handler if the user doesn't read the response fully

Re: [PATCH] tpm: add support for partial reads

2018-07-23 Thread Tadeusz Struk
On 07/23/2018 03:08 PM, Jason Gunthorpe wrote: > On Mon, Jul 23, 2018 at 03:00:20PM -0700, Tadeusz Struk wrote: >> On 07/23/2018 02:56 PM, Jason Gunthorpe wrote: >>> The proposed patch doesn't clear the data_pending if the entire buffer >>> is not consumed, so o

Re: [PATCH] tpm: add support for partial reads

2018-07-19 Thread Tadeusz Struk
On 07/19/2018 10:19 AM, James Bottomley wrote: > That's just an implementation, though, what's the use case? Hi James, The use case is described in the TCTI spec [1] in the "3.2.5.2 receive" section. Thanks, -- Tadeusz [1]

[PATCH] tpm: add support for partial reads

2018-07-19 Thread Tadeusz Struk
b.com/tpm2-software/tpm2-tss/commit/ce982f67a67dc08e24683d30b05800648d8a264c Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev-common.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/t

Re: [PATCH] tpm: add support for partial reads

2018-07-19 Thread Tadeusz Struk
On 07/19/2018 08:52 AM, Tadeusz Struk wrote: > Currently to read a response from the TPM device an application needs > provide "big enough" buffer for the whole response and read it in one go. > The application doesn't know how big the response it beforehand so it > always

Re: [PATCH] tpm: add support for partial reads

2018-07-19 Thread Tadeusz Struk
On 07/19/2018 11:47 AM, James Bottomley wrote: > On Thu, 2018-07-19 at 10:54 -0700, Tadeusz Struk wrote: >> On 07/19/2018 10:19 AM, James Bottomley wrote: >>> That's just an implementation, though, what's the use case? >> >> Hi James, >> The use c

Re: [PATCH] tpm: add support for partial reads

2018-07-19 Thread Tadeusz Struk
On 07/19/2018 12:52 PM, James Bottomley wrote: > The ABI break is the error case as I outlined above. We can't assume > everyone uses the current interface without getting an error and one > error and your hosed is a nasty failure case to change the interface > to. Well, if there is a broken

Re: [PATCH] tpm: add support for partial reads

2018-07-19 Thread Tadeusz Struk
On 07/19/2018 01:27 PM, James Bottomley wrote: > On Thu, 2018-07-19 at 13:12 -0700, Tadeusz Struk wrote: >> On 07/19/2018 12:52 PM, James Bottomley wrote: >>> The ABI break is the error case as I outlined above.  We can't >>> assume everyone uses the current interfa

[PATCH v6 2/2] tpm: add support for nonblocking operation

2018-09-10 Thread Tadeusz Struk
Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev-common.c | 141 - drivers/char/tpm/tpm-dev.c|1 drivers/char/tpm/tpm-dev.h| 13 ++- drivers/char/tpm/tpm-interface.c | 24 +- drivers/char/tpm/tpm.h|2

[PATCH v6 1/2] tpm: add ptr to the tpm_space struct to file_priv

2018-09-10 Thread Tadeusz Struk
Add a ptr to struct tpm_space to the file_priv and consolidate of the write operations for the two interfaces. Tested-by: Philip Tricca Signed-off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev-common.c |8 +--- drivers/char/tpm/tpm-dev.c| 10 ++ drivers/char/tpm/tpm

[PATCH v6 0/2] tpm: add support for nonblocking operation

2018-09-10 Thread Tadeusz Struk
hing what's needed is in the file_priv struct. - Renamed the 'work' member of the timer to avoid confusion. Now there are 'timeout_work' and 'async_work'. - Removed the global wait queue and moved it to file_priv. - Only creating the work queue when the first file is opened. Tadeusz Struk (2): tpm: add

Re: [PATCH v5 0/2] tpm: add support for nonblocking operation

2018-09-10 Thread Tadeusz Struk
On 08/31/2018 01:58 AM, Jarkko Sakkinen wrote: > Just the change to the commit message. Mislooked patchwork, the typo was > in my response :-) I'll do recheck for 2/2. Check those comments before > v6 if there is anything else. Hi, I have done the changes you requested and ran the "checkpatch.pl

[PATCH v2] tpm: add support for partial reads

2018-10-29 Thread Tadeusz Struk
-by: Tadeusz Struk --- Changes in v2: - Allow writes after only partial response is consumed to maintain backwords compatibility. --- drivers/char/tpm/tpm-dev-common.c | 38 - drivers/char/tpm/tpm-dev.h|2 ++ 2 files changed, 31 insertions

Re: [PATCH v2] tpm: add support for partial reads

2018-11-15 Thread Tadeusz Struk
Hi Jarkko, On 11/5/18 5:39 AM, Jarkko Sakkinen wrote: >> Changes in v2: >> - Allow writes after only partial response is consumed to maintain >>backwords compatibility. > I do not understand what this bullet means. Do you deny writes somehow? No I don't. This comment was wrt the first

[PATCH v3] tpm: add support for partial reads

2018-11-15 Thread Tadeusz Struk
, until the whole response is consumed. The user can also read only part of the response and ignore the rest by issuing a new write to send a new command. Signed-off-by: Tadeusz Struk --- The usecase is implemented in this TSS commit: https://github.com/tpm2-software/tpm2-tss/commit

Re: [PATCH v2] tpm: add support for partial reads

2018-11-15 Thread Tadeusz Struk
On 11/5/18 5:44 AM, Jarkko Sakkinen wrote: > You don't explain what the commit does at all. > >> The usecase is implemented in this TSS commit: >> https://github.com/tpm2-software/tpm2-tss/commit/ce982f67a67dc08e24683d30b05800648d8a264c > We do not want this as part of the commit message. You

Re: [PATCH v3] tpm: add support for partial reads

2018-11-15 Thread Tadeusz Struk
On 11/15/18 3:31 PM, Jarkko Sakkinen wrote: > You could drop these memset() calls and also one from > tpm_timeout_work(). The call could be done once in the beginning of > tpm_common_write() instead of having three different call sites. > Don't we want to clean the buffer as the response is

[PATCH 1/2] tpm: rename data_pending to transmit_result

2018-11-16 Thread Tadeusz Struk
off-by: Tadeusz Struk --- drivers/char/tpm/tpm-dev-common.c | 20 ++-- drivers/char/tpm/tpm-dev.h|4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c index 99b5133a9

[PATCH v4 2/2] tpm: add support for partial reads

2018-11-16 Thread Tadeusz Struk
, until the whole response is consumed. The user can also read only part of the response and ignore the rest by issuing a new write to send a new command. Signed-off-by: Tadeusz Struk --- The usecase is implemented in this TSS commit: https://github.com/tpm2-software/tpm2-tss/commit

Re: [PATCH v5] tpm: add support for partial reads

2018-11-20 Thread Tadeusz Struk
On 11/20/18 3:07 PM, Jarkko Sakkinen wrote: + /* Holds the resul of the last successful call to tpm_transmit() */ >>> This comment is cruft. >> Do you want me to remove it? This is the comment you proposed. > As I explained before it made sense before you made the remark that > it can only

[PATCH v6] tpm: add support for partial reads

2018-11-21 Thread Tadeusz Struk
, until the whole response is consumed. The user can also read only part of the response and ignore the rest by issuing a new write to send a new command. Signed-off-by: Tadeusz Struk --- The usecase is implemented in this TSS commit: https://github.com/tpm2-software/tpm2-tss/commit

Re: [PATCH] selftests: add TPM 2.0 tests

2018-11-27 Thread Tadeusz Struk
On 11/27/18 2:10 PM, Jarkko Sakkinen wrote: > Added the tests that I've been using for testing TPM 2.0 functionality > for long time but have out-of-tree so far residing in > > https://github.com/jsakkine-intel/tpm2-scripts > > Cc: Tadeusz Struk > Signed-off-by: Jarkko Sakk

Re: [PATCH v5] tpm: add support for partial reads

2018-11-20 Thread Tadeusz Struk
On 11/20/18 4:48 AM, Jarkko Sakkinen wrote: >> The usecase is implemented in this TSS commit: >> https://github.com/tpm2-software/tpm2-tss/commit/ce982f67a67dc08e24683d30b05800648d8a264c > Can you implement test for this to > > https://github.com/jsakkine-intel/tpm2-scripts Just created a PR for

Re: [PATCH v5] tpm: add support for partial reads

2018-11-20 Thread Tadeusz Struk
On 11/20/18 4:48 AM, Jarkko Sakkinen wrote: >> +/* Holds the resul of the last successful call to tpm_transmit() */ > This comment is cruft. Do you want me to remove it? This is the comment you proposed. > >> +size_t response_length; > data_pending would be now perfectly fine name now

Re: [PATCH v4 2/2] tpm: add support for partial reads

2018-11-19 Thread Tadeusz Struk
On 11/19/18 9:28 AM, Jarkko Sakkinen wrote: > Ah, you are correct. > > You should add a boolean flag instead of introducing a new variable for > holding amount that has been read because obviously one read operation > is enough for backwards compatibility. > > The code could read the code to

Re: [PATCH v4 2/2] tpm: add support for partial reads

2018-11-19 Thread Tadeusz Struk
On 11/19/18 5:58 AM, Jarkko Sakkinen wrote: > Please explain a scenario where "!ret_size" would no work given that > both size and partial_data have always positive value? Right, I only looked at the one line above before responding. I'll change it to !ret_size > > I don't understand. In order

[PATCH v5] tpm: add support for partial reads

2018-11-19 Thread Tadeusz Struk
, until the whole response is consumed. The user can also read only part of the response and ignore the rest by issuing a new write to send a new command. Signed-off-by: Tadeusz Struk --- The usecase is implemented in this TSS commit: https://github.com/tpm2-software/tpm2-tss/commit

Re: [PATCH v4 2/2] tpm: add support for partial reads

2018-11-18 Thread Tadeusz Struk
On 11/17/18 11:48 PM, Jarkko Sakkinen wrote: >> +if (priv->transmit_result || priv->partial_data) { >> +if (*off == 0) >> +priv->partial_data = priv->transmit_result; >> + >> +ret_size = min_t(ssize_t, size, priv->partial_data); >> +if

Re: [PATCH v6 0/2] tpm: add support for nonblocking operation

2018-09-16 Thread Tadeusz Struk
On 9/16/18 5:03 AM, Jarkko Sakkinen wrote: > I tried to test this but I get 404 from > https://github.com/tstruk/tpm2-tss/tree/async This has been already merged to tss upstream https://github.com/tpm2-software/tpm2-tss To enable it you need to configure tss with --enable-tcti-device-async=yes

[PATCH RFC 1/2] crypto: Simple crypto algorithm load balancer

2014-01-17 Thread Tadeusz Struk
allocated 3 times. That's ~0% Signed-off-by: Tadeusz Struk --- crypto/api.c | 25 ++--- include/linux/crypto.h |3 ++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/crypto/api.c b/crypto/api.c index a2b39c5..0c0f1c3 100644 --- a/crypto/api.c +++ b

[PATCH RFC 2/2] crypto: Simple load balancer test module

2014-01-17 Thread Tadeusz Struk
Test module for the simple algorithm load balancer Signed-off-by: Tadeusz Struk --- crypto/Kconfig|6 ++ crypto/Makefile |1 + crypto/test_alg_loadbalance.c | 231 + 3 files changed, 247 insertions(+) create mode

[RFC][PATCH 3/4] crypto: QAT dh895xcc accelerator support

2014-06-03 Thread Tadeusz Struk
Third patch adds dh895xcc hardware specific code. It hooks to the common infrastructure and provides acceleration for crypto algorithms. Signed-off-by: Tadeusz Struk Acked-by: John Griffin Reviewed-by: Bruce W. Allan --- drivers/crypto/qat/qat_dh895xcc/Makefile | 8 + drivers

[RFC][PATCH 4/4] crypto: Updated makefiles to add QAT

2014-06-03 Thread Tadeusz Struk
Update to makefiles etc. Signed-off-by: Tadeusz Struk --- Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS | 6 ++ drivers/crypto/Kconfig | 1 + drivers/crypto/Makefile | 1 + firmware/Makefile| 1 + 5 files

[RFC][PATCH 0/4] crypto: Intel QAT driver

2014-06-03 Thread Tadeusz Struk
on the hardware accelerator and the Quick Assist can be on: https://01.org/packet-processing/intel%C2%AE-quickassist-technology-drivers-and-patches Signed-off-by: Tadeusz Struk Signed-off-by: Karen Xiang Signed-off-by: Pingchaox Yang Acked-by: John Griffin Acked-by: Bo Cui Reviewed-by: Bruce W. Allan

Re: [RFC][PATCH 4/4] crypto: Updated makefiles to add QAT

2014-06-03 Thread Tadeusz Struk
On 06/03/2014 12:16 PM, Randy Dunlap wrote: >> +source "drivers/crypto/qat/Kconfig" > Missing that file ^^^ > Hi, Something went wrong. I need to resend v2. Thanks Randy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to

<    1   2   3   4   5   6   7   >