From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754591AbcAORbJ (ORCPT ); Fri, 15 Jan 2016 12:31:09 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:33821 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754543AbcAORbF (ORCPT ); Fri, 15 Jan 2016 12:31:05 -0500 MIME-Version: 1.0 In-Reply-To: <20160115135900.GA31813@gondor.apana.org.au> References: <20160114141341.GA21300@gondor.apana.org.au> <20160115135900.GA31813@gondor.apana.org.au> From: Dmitry Vyukov Date: Fri, 15 Jan 2016 18:30:44 +0100 Message-ID: Subject: Re: [v2 PATCH 0/2] crypto: Fix race condition in *_check_key To: Herbert Xu Cc: "David S. Miller" , linux-crypto@vger.kernel.org, LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Eric Dumazet , Sasha Levin Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2016 at 2:59 PM, Herbert Xu wrote: > On Fri, Jan 15, 2016 at 10:06:11AM +0100, Dmitry Vyukov wrote: >> >> With these patches I see lots of: >> >> [ INFO: possible recursive locking detected ] >> 4.4.0+ #250 Not tainted >> --------------------------------------------- >> syz-executor/16742 is trying to acquire lock: >> (sk_lock-AF_ALG){+.+.+.}, at: [< inline >] lock_sock >> include/net/sock.h:1480 >> (sk_lock-AF_ALG){+.+.+.}, at: [] >> hash_check_key.isra.3+0xd2/0x210 crypto/algif_hash.c:261 >> >> but task is already holding lock: >> (sk_lock-AF_ALG){+.+.+.}, at: [< inline >] lock_sock >> include/net/sock.h:1480 >> (sk_lock-AF_ALG){+.+.+.}, at: [] >> hash_check_key.isra.3+0x26/0x210 crypto/algif_hash.c:252 >> >> other info that might help us debug this: >> Possible unsafe locking scenario: >> >> CPU0 >> ---- >> lock(sk_lock-AF_ALG); >> lock(sk_lock-AF_ALG); >> >> *** DEADLOCK *** >> >> May be due to missing lock nesting notation > > Indeed. Here is an updated version. With these patches the original bug is fixed and don't see any new. Tested-by: Dmitry Vyukov