* module ref count
@ 2015-04-21 12:35 Stephan Mueller
2015-04-21 12:56 ` Stephan Mueller
0 siblings, 1 reply; 4+ messages in thread
From: Stephan Mueller @ 2015-04-21 12:35 UTC (permalink / raw)
To: herbert; +Cc: linux-crypto
Hi Herbert,
I am currently working on the template for SP800-38F key wrapping. The module
is operational and calculates what I want.
However, I have one problem I am having difficulties to track down and I am
wondering whether you could point me to the right direction.
When a caller calls
crypto_alloc_aead("kw(aes)", 0, 0);
somehow the refcount of the kernel module implementing the keywrapping is not
increased. Once can see that in lsmod where the "Used by" value remains 0.
Then when the caller deallocates the cipher handle, the refcount is -1
according to lsmod. With that, a second invocation of crypto_alloc_aead will
fail and I even cannot remove the module from the kernel.
Who increases the refcount on the kernel crypto API side?
Thanks a lot
--
Ciao
Stephan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: module ref count
2015-04-21 12:35 module ref count Stephan Mueller
@ 2015-04-21 12:56 ` Stephan Mueller
2015-04-21 14:43 ` Stephan Mueller
0 siblings, 1 reply; 4+ messages in thread
From: Stephan Mueller @ 2015-04-21 12:56 UTC (permalink / raw)
To: herbert; +Cc: linux-crypto
Am Dienstag, 21. April 2015, 14:35:47 schrieb Stephan Mueller:
Hi Stephan,
> Hi Herbert,
>
> I am currently working on the template for SP800-38F key wrapping. The
> module is operational and calculates what I want.
>
> However, I have one problem I am having difficulties to track down and I am
> wondering whether you could point me to the right direction.
>
> When a caller calls
>
> crypto_alloc_aead("kw(aes)", 0, 0);
>
> somehow the refcount of the kernel module implementing the keywrapping is
> not increased. Once can see that in lsmod where the "Used by" value remains
> 0.
>
> Then when the caller deallocates the cipher handle, the refcount is -1
> according to lsmod. With that, a second invocation of crypto_alloc_aead will
> fail and I even cannot remove the module from the kernel.
>
> Who increases the refcount on the kernel crypto API side?
I think I hit an even bigger problem: while playing with other AEAD ciphers, I
see the same thing now:
$ lsmod
Module Size Used by
ansi_cprng 12989 0
drbg 30255 0
algif_rng 12753 0
seqiv 13003 -1
ccm 17731 -1
gcm 23371 -1
Allocation of these ciphers fail.
>
> Thanks a lot
--
Ciao
Stephan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: module ref count
2015-04-21 12:56 ` Stephan Mueller
@ 2015-04-21 14:43 ` Stephan Mueller
2015-04-22 7:26 ` Herbert Xu
0 siblings, 1 reply; 4+ messages in thread
From: Stephan Mueller @ 2015-04-21 14:43 UTC (permalink / raw)
To: herbert; +Cc: linux-crypto
Am Dienstag, 21. April 2015, 14:56:31 schrieb Stephan Mueller:
Hi Stephan,
> Am Dienstag, 21. April 2015, 14:35:47 schrieb Stephan Mueller:
>
> Hi Stephan,
>
> > Hi Herbert,
> >
> > I am currently working on the template for SP800-38F key wrapping. The
> > module is operational and calculates what I want.
> >
> > However, I have one problem I am having difficulties to track down and I
> > am
> > wondering whether you could point me to the right direction.
> >
> > When a caller calls
> >
> > crypto_alloc_aead("kw(aes)", 0, 0);
> >
> > somehow the refcount of the kernel module implementing the keywrapping is
> > not increased. Once can see that in lsmod where the "Used by" value
> > remains
> > 0.
> >
> > Then when the caller deallocates the cipher handle, the refcount is -1
> > according to lsmod. With that, a second invocation of crypto_alloc_aead
> > will fail and I even cannot remove the module from the kernel.
> >
> > Who increases the refcount on the kernel crypto API side?
>
> I think I hit an even bigger problem: while playing with other AEAD ciphers,
> I see the same thing now:
>
> $ lsmod
> Module Size Used by
> ansi_cprng 12989 0
> drbg 30255 0
> algif_rng 12753 0
> seqiv 13003 -1
> ccm 17731 -1
> gcm 23371 -1
>
> Allocation of these ciphers fail.
After updating to the current cryptodev-2.6 tree from today, this issue
vanished.
Sorry for the noise, please disregard the thread.
>
> > Thanks a lot
--
Ciao
Stephan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: module ref count
2015-04-21 14:43 ` Stephan Mueller
@ 2015-04-22 7:26 ` Herbert Xu
0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2015-04-22 7:26 UTC (permalink / raw)
To: Stephan Mueller; +Cc: linux-crypto
On Tue, Apr 21, 2015 at 04:43:35PM +0200, Stephan Mueller wrote:
>
> After updating to the current cryptodev-2.6 tree from today, this issue
> vanished.
I think you missed the thread where Linus's machine broke :)
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-22 7:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-21 12:35 module ref count Stephan Mueller
2015-04-21 12:56 ` Stephan Mueller
2015-04-21 14:43 ` Stephan Mueller
2015-04-22 7:26 ` Herbert Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.