Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1312501ybi; Wed, 3 Jul 2019 13:22:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyu3r2psFVrGgFXQy+CZbo5vggdWAcdlNxMOoHxCxKZHgC5Gz/S9wLaXpehYadFiYFag+/3 X-Received: by 2002:a17:902:9898:: with SMTP id s24mr36390534plp.226.1562185333693; Wed, 03 Jul 2019 13:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562185333; cv=none; d=google.com; s=arc-20160816; b=0QdR5G4eLWaNvmoD7fNrbmv4TJUJtcVFt0bLI8mv5vM/8zJ3UE2OSTy+KRX63daLEb SCOvnMk71K39iKk4gJnBKp1C9ikV5ZE1HTaORkDT0ORHPkrL5orFNWCko/qvNvebWKWJ NZsS1Fa9gC/sUwDBwcio+UvavRu2guPq9m9njrFDc0Vb+RDHpN2jcwkMSdosr4BJqTGa rndOS80i/OKCa9B1sZ48spg3/Rv8FfRXNCeXTXgCrVtv0WwsVzKt5lv/al+NS24mt2C1 BrEk5Knt/X27/RkD3iePfXNNLT5NwI/7zNuB1VhtpsNbJXj4Nw3wv4mD8Essn0PsCkgK 6lFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=2Ck+mmUrxBswL1DvE2BR3kYP4Tqz6inZXEkjvxYFBZ8=; b=WTJkRjfyUt+6QcUJ7qyN9Sux6cK/0wvnwtJSYWiNW6t0IjZ11vixABPoAeBpoLMLRY 4d4jGpm0MoRjCHmLAynCi1BUXwF5gi747yX16EPEOvK6kdxkjanxlK8QHwnccT+5rJuQ qR1OnWvKdNd/zfB84m4Y0SK1SKhX1eW+BhlsXW1Gwjb78QsW8dQoD2GLbfXdpM4V8uQZ Q8qDmyw1psBgcT7tM052BYj4jkLyARND8zK8M1FDEHGWSxgmBKd9QSk+UWmOWXdwo/iU ccFHvj//TjfSmtw90lFDvHrMtXqj1KWdwN4+/rnhlckU2T7MGCt+o5xnjiitJgL+2OY1 C4tQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d37si2986977pla.288.2019.07.03.13.21.58; Wed, 03 Jul 2019 13:22:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727004AbfGCUVO (ORCPT + 99 others); Wed, 3 Jul 2019 16:21:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:50726 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726550AbfGCUVM (ORCPT ); Wed, 3 Jul 2019 16:21:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7AD84AD35; Wed, 3 Jul 2019 20:21:10 +0000 (UTC) Date: Wed, 3 Jul 2019 22:21:08 +0200 From: Michal =?UTF-8?B?U3VjaMOhbmVr?= To: Herbert Xu Cc: Eric Biggers , linux-crypto@vger.kernel.org, chetjain@in.ibm.com, "David S . Miller" , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Steffen Klassert Subject: Re: [PATCH] crypto: user - prevent operating on larval algorithms Message-ID: <20190703222108.467ec204@kitsune.suse.cz> In-Reply-To: <20190703143057.miqgc7blhjjxjmee@gondor.apana.org.au> References: <20190701153154.1569c2dc@kitsune.suse.cz> <20190702211700.16526-1-ebiggers@kernel.org> <20190703143057.miqgc7blhjjxjmee@gondor.apana.org.au> Organization: SUSE Linux X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Jul 2019 22:30:57 +0800 Herbert Xu wrote: > On Tue, Jul 02, 2019 at 02:17:00PM -0700, Eric Biggers wrote: > > From: Eric Biggers > > > > Michal Suchanek reported [1] that running the pcrypt_aead01 test from > > LTP [2] in a loop and holding Ctrl-C causes a NULL dereference of > > alg->cra_users.next in crypto_remove_spawns(), via crypto_del_alg(). > > The test repeatedly uses CRYPTO_MSG_NEWALG and CRYPTO_MSG_DELALG. > > > > The crash occurs when the instance that CRYPTO_MSG_DELALG is trying to > > unregister isn't a real registered algorithm, but rather is a "test > > larval", which is a special "algorithm" added to the algorithms list > > while the real algorithm is still being tested. Larvals don't have > > initialized cra_users, so that causes the crash. Normally pcrypt_aead01 > > doesn't trigger this because CRYPTO_MSG_NEWALG waits for the algorithm > > to be tested; however, CRYPTO_MSG_NEWALG returns early when interrupted. > > Do you have some way to reproduce this reliably? I suppose you would have to send a signal to the process for the call to get interrupted, right? Thanks Michal