From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:56582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726340AbeKFIvy (ORCPT ); Tue, 6 Nov 2018 03:51:54 -0500 Date: Mon, 5 Nov 2018 18:29:38 -0500 From: Sasha Levin To: Loic Cc: stable@vger.kernel.org, baijiaju1990@163.com, herbert@gondor.apana.org.au Subject: Re: [PATCH] crypto: shash - Fix a sleep-in-atomic bug in shash_setkey_unaligned Message-ID: <20181105232938.GT194472@sasha-vm> References: <20181019185726.7326ffc91d414b20b2e164c6@opensec.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181019185726.7326ffc91d414b20b2e164c6@opensec.fr> Sender: stable-owner@vger.kernel.org List-ID: On Fri, Oct 19, 2018 at 06:57:26PM +0200, Loic wrote: >Hello, > >Please picked up this patch for linux 4.4 and 4.9. >Compiled/tested without problem. > >[ Upstream commit 9039f3ef446e9ffa200200c934f049add9e58426 ] > >From: Jia-Ju Bai >Date: Tue, 3 Oct 2017 10:25:22 +0800 >Subject: [PATCH] crypto: shash - Fix a sleep-in-atomic bug in > shash_setkey_unaligned > >The SCTP program may sleep under a spinlock, and the function call path is: >sctp_generate_t3_rtx_event (acquire the spinlock) > sctp_do_sm > sctp_side_effects > sctp_cmd_interpreter > sctp_make_init_ack > sctp_pack_cookie > crypto_shash_setkey > shash_setkey_unaligned > kmalloc(GFP_KERNEL) > >For the same reason, the orinoco driver may sleep in interrupt handler, >and the function call path is: >orinoco_rx_isr_tasklet > orinoco_rx > orinoco_mic > crypto_shash_setkey > shash_setkey_unaligned > kmalloc(GFP_KERNEL) > >To fix it, GFP_KERNEL is replaced with GFP_ATOMIC. >This bug is found by my static analysis tool and my code review. > >Signed-off-by: Jia-Ju Bai >Signed-off-by: Herbert Xu Queued for 4.4 and 4.9, thank you. -- Thanks, Sasha