Re: [PATCH] crypto: n2 - cure use after free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jan Engelhardt <jengelh@xxxxxxx>
Date: Sat, 16 Dec 2017 02:01:17 +0100

> queue_cache_init is called for every crypto processor found.
> 
> When first invoked, queue_cache[0] is NULL and queue_cache_init will
> allocate a kmem_cache. If queue_cache_init returns a failure code, the
> caller, grab_global_resources, will call queue_cache_destroy to release said
> kmem_cache, but it does this without setting queue_cache_init[0] to NULL.

That's not what's happening exactly.

queue_cache_init() is not failing and returning a failure code.

In fact, it is a very simple function which does nothing more than
create kmem caches so is very much unlikely to fail, especially with
the repeatability that you are seeing (ie. every time).

Instead, what fails is the algorithm registry which you should look
more deeply into the cause of.

And this failure path is how we lead to the problem.

This does need to be fixed, so please fix you commit message and
_also_, more importantly, please CC: the crypto list as well as the
crypto maintainer so that Herbert can see and integrate the fix.

I would also like you to look into why the algorithm registry fails,
if the selftest is running and getting incorrect results for the
algorithm that is a huge issue and must be investigated and fixed.

That is the true regression which is causing the failure path you
see to run at all.

Thank you.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux