From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:60712 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbdJEEiC (ORCPT ); Thu, 5 Oct 2017 00:38:02 -0400 Date: Wed, 04 Oct 2017 21:37:58 -0700 (PDT) Message-Id: <20171004.213758.2210486785503998906.davem@davemloft.net> (sfid-20171005_063806_626682_505FC3AE) To: herbert@gondor.apana.org.au 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 From: David Miller In-Reply-To: <20171005034054.GB31996@gondor.apana.org.au> References: <20171003052643.GB22750@gondor.apana.org.au> <20171003224505.GE19750@localhost.localdomain> <20171005034054.GB31996@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Herbert Xu Date: Thu, 5 Oct 2017 11:40:54 +0800 > On Tue, Oct 03, 2017 at 07:45:06PM -0300, Marcelo Ricardo Leitner wrote: >> >> > Usually if you're invoking setkey from a non-sleeping code-path >> > you're probably doing something wrong. >> >> Usually but not always. There are 3 calls to that function on SCTP >> code: >> - pack a cookie, which is sent on an INIT_ACK packet to the client >> - unpack the cookie above, after it is sent back by the client on a >> COOKIE_ECHO packet >> - send a chunk authenticated by a hash > > I'm not talking about the code-path in question. I'm talking > about the function which generates the secret key in the first > place. AFAICS that's only called in GFP_KERNEL context. What > am I missing? The setkey happens in functions like sctp_pack_cookie() and sctp_unpack_cookie(), which seems to run from software interrupts. From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH V2] Fix a sleep-in-atomic bug in shash_setkey_unaligned Date: Wed, 04 Oct 2017 21:37:58 -0700 (PDT) Message-ID: <20171004.213758.2210486785503998906.davem@davemloft.net> References: <20171003052643.GB22750@gondor.apana.org.au> <20171003224505.GE19750@localhost.localdomain> <20171005034054.GB31996@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: marcelo.leitner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, baijiaju1990-9Onoh4P/yGk@public.gmane.org, nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org, vyasevich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-sctp-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org Return-path: In-Reply-To: <20171005034054.GB31996-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org> Sender: linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-crypto.vger.kernel.org From: Herbert Xu Date: Thu, 5 Oct 2017 11:40:54 +0800 > On Tue, Oct 03, 2017 at 07:45:06PM -0300, Marcelo Ricardo Leitner wrote: >> >> > Usually if you're invoking setkey from a non-sleeping code-path >> > you're probably doing something wrong. >> >> Usually but not always. There are 3 calls to that function on SCTP >> code: >> - pack a cookie, which is sent on an INIT_ACK packet to the client >> - unpack the cookie above, after it is sent back by the client on a >> COOKIE_ECHO packet >> - send a chunk authenticated by a hash > > I'm not talking about the code-path in question. I'm talking > about the function which generates the secret key in the first > place. AFAICS that's only called in GFP_KERNEL context. What > am I missing? The setkey happens in functions like sctp_pack_cookie() and sctp_unpack_cookie(), which seems to run from software interrupts. From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Date: Thu, 05 Oct 2017 04:37:58 +0000 Subject: Re: [PATCH V2] Fix a sleep-in-atomic bug in shash_setkey_unaligned Message-Id: <20171004.213758.2210486785503998906.davem@davemloft.net> List-Id: References: <20171003052643.GB22750@gondor.apana.org.au> <20171003224505.GE19750@localhost.localdomain> <20171005034054.GB31996@gondor.apana.org.au> In-Reply-To: <20171005034054.GB31996-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org Cc: marcelo.leitner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, baijiaju1990-9Onoh4P/yGk@public.gmane.org, nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org, vyasevich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-sctp-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org From: Herbert Xu Date: Thu, 5 Oct 2017 11:40:54 +0800 > On Tue, Oct 03, 2017 at 07:45:06PM -0300, Marcelo Ricardo Leitner wrote: >> >> > Usually if you're invoking setkey from a non-sleeping code-path >> > you're probably doing something wrong. >> >> Usually but not always. There are 3 calls to that function on SCTP >> code: >> - pack a cookie, which is sent on an INIT_ACK packet to the client >> - unpack the cookie above, after it is sent back by the client on a >> COOKIE_ECHO packet >> - send a chunk authenticated by a hash > > I'm not talking about the code-path in question. I'm talking > about the function which generates the secret key in the first > place. AFAICS that's only called in GFP_KERNEL context. What > am I missing? The setkey happens in functions like sctp_pack_cookie() and sctp_unpack_cookie(), which seems to run from software interrupts.