Return-path: Received: from orcrist.hmeau.com ([104.223.48.154]:51336 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbdJENRO (ORCPT ); Thu, 5 Oct 2017 09:17:14 -0400 Date: Thu, 5 Oct 2017 21:16:31 +0800 From: Herbert Xu To: David Miller Cc: marcelo.leitner@gmail.com, luto@kernel.org, baijiaju1990@163.com, nhorman@tuxdriver.com, vyasevich@gmail.com, kvalo@codeaurora.org, linux-crypto@vger.kernel.org, netdev@vger.kernel.org, linux-sctp@vger.kernel.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH V2] Fix a sleep-in-atomic bug in shash_setkey_unaligned Message-ID: <20171005131631.GA1553@gondor.apana.org.au> (sfid-20171005_151721_596123_544D49D3) References: <20171003052643.GB22750@gondor.apana.org.au> <20171003224505.GE19750@localhost.localdomain> <20171005034054.GB31996@gondor.apana.org.au> <20171004.213758.2210486785503998906.davem@davemloft.net> <20171005101620.GA1246@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20171005101620.GA1246@gondor.apana.org.au> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Thu, Oct 05, 2017 at 06:16:20PM +0800, Herbert Xu wrote: > > That was my point. Functions like sctp_pack_cookie shouldn't be > setting the key in the first place. The setkey should happen at > the point when the key is generated. That's sctp_endpoint_init > which AFAICS only gets called in GFP_KERNEL context. > > Or is there a code-path where sctp_endpoint_init is called in > softirq context? OK, there are indeed code paths where the key is derived in softirq context. Notably sctp_auth_calculate_hmac. So I think this patch is the correct fix and I will push it upstream as well as back to stable. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt