Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp187261ybg; Tue, 2 Jun 2020 20:56:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy81i1qQQO+J7TfeBNfp7apYaYISsp6U/neFBW8iKAwoajvnH1t9WVIXX060fo5PKnuLvE3 X-Received: by 2002:a05:6402:3078:: with SMTP id bs24mr14700990edb.284.1591156580193; Tue, 02 Jun 2020 20:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591156580; cv=none; d=google.com; s=arc-20160816; b=m7f9T6flqJBwHfF9AWToYqg22VwScnFqNAeP9ec9sq3fzNTaZKI33EoM6Qr0NfVcwl phRpyW+DkebmW0hnJGhRrXtUCUb1/G5ponD6EVB5+kDDz3JlOKrQh4NekXHlgw1Rp38D oLCBYpSIYrJ6W4LUYxM2W07/Mgfvgulj6wsfcriR5PyejPZOwe4Y1xsAVUIrrbnlUzmZ veBjZx6n5Em6HelIUESRNNN1T01AJyAjuS27ga8GYZUCecF4yU9bCe4P6jVSnI4vCB8A gKYHVNHtKmPYMAnmLPHHoOYWv8uJzuI0pEUlWD+V8boJINlbsKn3DOgPft2KzArwvjPq SdZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=j9YmbVMQ9pvDacugHfsI1E56tgw+gl7gms0r2lZR4/8=; b=oBnwFtgg6kcXZwVF2CwUmFQE2jrbicRFNQSS5Rtu5ZgEfgWeD3VfLr/IVUfSv7UIoo rKQf7r458A6PAnps1lFhMYJUYb6jgH5IQz7JVUgbLr3Ep9pXKgEgKqvP4TueA3tY9XSh YLgtLaHi8sMG0B7bV9bHgbOwaqtGbpIl70ydi2ONT8jkKtlmhabbux3KxFioCpRUsb7D /GBYF01X5RuLzChQ3ok8t+fo9uaI2W1WJPDk2Lvvgibu0fMtfvIgZJSEqp+WVM91HbF/ xTxYxHmTvQnsQB4vUolN+m7xW6our1PGzHgI9MVvVUv0X2KzJwQK1VokEUyYPL44eSxS pc2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="uB/6aBre"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si471890eji.495.2020.06.02.20.55.49; Tue, 02 Jun 2020 20:56:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="uB/6aBre"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725988AbgFCDzo (ORCPT + 99 others); Tue, 2 Jun 2020 23:55:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:53120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbgFCDzo (ORCPT ); Tue, 2 Jun 2020 23:55:44 -0400 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 871A920674; Wed, 3 Jun 2020 03:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591156542; bh=FiUhhNdnCIUsVkjQis8NSHn7BUnltL4V+761roaOZCA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uB/6aBreDvLnfol9tpFO3hQGPvpNvZXnqaN/IFEeyU3qFpEsnxz1n4H6IcmWYxg1I 1ED28OvxAO3sME/Pne5ky5YwoD9Ha+t9bFItspkUCFr9MzyYCsp45HH8pcfcIqFz5s AtdWKj6nRZsA3I8w+AzZR+KoUjXRwfrGgb2RD7JQ= Date: Tue, 2 Jun 2020 20:55:41 -0700 From: Eric Biggers To: Stephan =?iso-8859-1?Q?M=FCller?= Cc: davem@davemloft.net, herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, syzbot Subject: Re: memory leak in crypto_create_tfm Message-ID: <20200603035541.GB50072@sol.localdomain> References: <0000000000002a280b05a725cd93@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0000000000002a280b05a725cd93@google.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Probably a bug in crypto/drbg.c. Stephan, can you take a look? On Tue, Jun 02, 2020 at 08:41:21PM -0700, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit: 19409891 Merge tag 'pnp-5.8-rc1' of git://git.kernel.org/p.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=13165aa6100000 > kernel config: https://syzkaller.appspot.com/x/.config?x=6d41e63a2c7e0715 > dashboard link: https://syzkaller.appspot.com/bug?extid=2e635807decef724a1fa > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17f00ef2100000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=170f2ef2100000 > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > Reported-by: syzbot+2e635807decef724a1fa@syzkaller.appspotmail.com > > executing program > executing program > BUG: memory leak > unreferenced object 0xffff8881175bc480 (size 64): > comm "syz-executor064", pid 6388, jiffies 4294941622 (age 13.280s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > e0 7e 56 84 ff ff ff ff 00 00 00 00 00 00 00 00 .~V............. > backtrace: > [<0000000029c7602f>] kmalloc include/linux/slab.h:560 [inline] > [<0000000029c7602f>] kzalloc include/linux/slab.h:669 [inline] > [<0000000029c7602f>] crypto_create_tfm+0x31/0x100 crypto/api.c:448 > [<00000000bec8cbdb>] crypto_alloc_tfm+0x79/0x1a0 crypto/api.c:527 > [<000000002f9791ba>] drbg_prepare_hrng crypto/drbg.c:1509 [inline] > [<000000002f9791ba>] drbg_instantiate crypto/drbg.c:1587 [inline] > [<000000002f9791ba>] drbg_kcapi_seed+0x432/0x6a9 crypto/drbg.c:1980 > [<0000000041302bb8>] crypto_rng_reset+0x35/0x1a0 crypto/rng.c:53 > [<000000004758c3c4>] alg_setkey crypto/af_alg.c:222 [inline] > [<000000004758c3c4>] alg_setsockopt+0x149/0x190 crypto/af_alg.c:255 > [<000000008bc4b5cb>] __sys_setsockopt+0x112/0x230 net/socket.c:2132 > [<00000000cfbf30da>] __do_sys_setsockopt net/socket.c:2148 [inline] > [<00000000cfbf30da>] __se_sys_setsockopt net/socket.c:2145 [inline] > [<00000000cfbf30da>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2145 > [<00000000fc9c2183>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295 > [<0000000040e080a1>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > BUG: memory leak > unreferenced object 0xffff8881175bc040 (size 64): > comm "syz-executor064", pid 6389, jiffies 4294942172 (age 7.780s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > e0 7e 56 84 ff ff ff ff 00 00 00 00 00 00 00 00 .~V............. > backtrace: > [<0000000029c7602f>] kmalloc include/linux/slab.h:560 [inline] > [<0000000029c7602f>] kzalloc include/linux/slab.h:669 [inline] > [<0000000029c7602f>] crypto_create_tfm+0x31/0x100 crypto/api.c:448 > [<00000000bec8cbdb>] crypto_alloc_tfm+0x79/0x1a0 crypto/api.c:527 > [<000000002f9791ba>] drbg_prepare_hrng crypto/drbg.c:1509 [inline] > [<000000002f9791ba>] drbg_instantiate crypto/drbg.c:1587 [inline] > [<000000002f9791ba>] drbg_kcapi_seed+0x432/0x6a9 crypto/drbg.c:1980 > [<0000000041302bb8>] crypto_rng_reset+0x35/0x1a0 crypto/rng.c:53 > [<000000004758c3c4>] alg_setkey crypto/af_alg.c:222 [inline] > [<000000004758c3c4>] alg_setsockopt+0x149/0x190 crypto/af_alg.c:255 > [<000000008bc4b5cb>] __sys_setsockopt+0x112/0x230 net/socket.c:2132 > [<00000000cfbf30da>] __do_sys_setsockopt net/socket.c:2148 [inline] > [<00000000cfbf30da>] __se_sys_setsockopt net/socket.c:2145 [inline] > [<00000000cfbf30da>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2145 > [<00000000fc9c2183>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295 > [<0000000040e080a1>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > BUG: memory leak > unreferenced object 0xffff88811b3ca080 (size 96): > comm "syz-executor064", pid 6389, jiffies 4294942172 (age 7.780s) > hex dump (first 32 bytes): > 89 c7 08 cb 8a 12 10 6e 00 00 00 00 00 00 00 00 .......n........ > 71 51 5a c2 1b 00 00 00 35 7d 00 00 00 00 00 00 qQZ.....5}...... > backtrace: > [<000000008ec3eca0>] jent_entropy_collector_alloc+0x1b/0xf8 crypto/jitterentropy.c:662 > [<0000000026ed401a>] jent_kcapi_init+0x17/0x40 crypto/jitterentropy-kcapi.c:119 > [<00000000be7d6b06>] crypto_create_tfm+0x89/0x100 crypto/api.c:459 > [<00000000bec8cbdb>] crypto_alloc_tfm+0x79/0x1a0 crypto/api.c:527 > [<000000002f9791ba>] drbg_prepare_hrng crypto/drbg.c:1509 [inline] > [<000000002f9791ba>] drbg_instantiate crypto/drbg.c:1587 [inline] > [<000000002f9791ba>] drbg_kcapi_seed+0x432/0x6a9 crypto/drbg.c:1980 > [<0000000041302bb8>] crypto_rng_reset+0x35/0x1a0 crypto/rng.c:53 > [<000000004758c3c4>] alg_setkey crypto/af_alg.c:222 [inline] > [<000000004758c3c4>] alg_setsockopt+0x149/0x190 crypto/af_alg.c:255 > [<000000008bc4b5cb>] __sys_setsockopt+0x112/0x230 net/socket.c:2132 > [<00000000cfbf30da>] __do_sys_setsockopt net/socket.c:2148 [inline] > [<00000000cfbf30da>] __se_sys_setsockopt net/socket.c:2145 [inline] > [<00000000cfbf30da>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2145 > [<00000000fc9c2183>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295 > [<0000000040e080a1>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > > > --- > This bug is generated by a bot. It may contain errors. > See https://goo.gl/tpsmEJ for more information about syzbot. > syzbot engineers can be reached at syzkaller@googlegroups.com. > > syzbot will keep track of this bug report. See: > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > syzbot can test patches for this bug, for details see: > https://goo.gl/tpsmEJ#testing-patches > > -- > You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group. > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/0000000000002a280b05a725cd93%40google.com.