Re: [PATCH 2/2] crypto: api - Do not zap spawn->alg

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

 



On Fri, Dec 06, 2019 at 02:50:21PM -0800, Eric Biggers wrote:
>
> This patch causes the below crash.

Yes I got carried away with rearranging the code in the function
crypto_more_spawns.  I shouldn't be using spawn as a list node
after doing the list_move call.  The code now looks like:

	n = list_prev_entry(spawn, list);
	list_move(&spawn->list, secondary_spawns);

	if (list_is_last(&n->list, stack))
		return top;

	n = list_next_entry(n, list);
	if (!spawn->dead)
		n->dead = false;

	return &n->inst->alg.cra_users;

> Also, some comments (e.g. for struct crypto_spawn and crypto_remove_spawns())
> would be really helpful to understand what's going on here.

crypto_remove_spawns is performing a depth-first walk on cra_users
without recursion.  In the specific case of a spawn removal triggered
by a new registration, we will halt the walk when we hit the
newly registered algorithm, and undo any actions that we did
on the path leading to that object.  The function crypto_more_spawns
performs the undo action.

I'll add this to crypto_remove_spawns.

Thanks,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux